diff --git a/css/0.css b/css/0.css index e12c371e1..da241aaee 100644 --- a/css/0.css +++ b/css/0.css @@ -15,4 +15,4 @@ * Date: 2018-10-02T14:29:27.829Z */@-webkit-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0deg);transform:translateY(-50%) rotate(0deg)}to{-webkit-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@-o-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0deg);-o-transform:translateY(-50%) rotate(0deg);transform:translateY(-50%) rotate(0deg)}to{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0deg);-o-transform:translateY(-50%) rotate(0deg);transform:translateY(-50%) rotate(0deg)}to{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@font-face{font-family:context-menu-icons;font-style:normal;font-weight:400;src:url(../fonts/context-menu-icons.eot);src:url(../fonts/context-menu-icons.eot#iefix) format("embedded-opentype"),url(../fonts/context-menu-icons.woff2) format("woff2"),url(../fonts/context-menu-icons.woff) format("woff"),url(../fonts/context-menu-icons.ttf) format("truetype")}.context-menu-icon-add:before{content:"\EA01"}.context-menu-icon-copy:before{content:"\EA02"}.context-menu-icon-cut:before{content:"\EA03"}.context-menu-icon-delete:before{content:"\EA04"}.context-menu-icon-edit:before{content:"\EA05"}.context-menu-icon-loading:before{content:"\EA06"}.context-menu-icon-paste:before{content:"\EA07"}.context-menu-icon-quit:before{content:"\EA08"}.context-menu-icon:before{position:absolute;top:50%;left:0;width:2em;font-family:context-menu-icons;font-size:1em;font-style:normal;font-weight:400;line-height:1;color:#2980b9;text-align:center;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.context-menu-icon.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-disabled:before{color:#bbb}.context-menu-icon.context-menu-icon-loading:before{-webkit-animation:cm-spin 2s infinite;-o-animation:cm-spin 2s infinite;animation:cm-spin 2s infinite}.context-menu-icon.context-menu-icon--fa{display:list-item;font-family:inherit;line-height:inherit}.context-menu-icon.context-menu-icon--fa:before{position:absolute;top:50%;left:0;width:2em;font-family:FontAwesome;font-size:1em;font-style:normal;font-weight:400;line-height:1;color:#2980b9;text-align:center;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.context-menu-icon.context-menu-icon--fa.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-icon--fa.context-menu-disabled:before{color:#bbb}.context-menu-icon.context-menu-icon--fa5{display:list-item;font-family:inherit;line-height:inherit}.context-menu-icon.context-menu-icon--fa5 i,.context-menu-icon.context-menu-icon--fa5 svg{position:absolute;top:.3em;left:.5em;color:#2980b9}.context-menu-icon.context-menu-icon--fa5.context-menu-hover>i,.context-menu-icon.context-menu-icon--fa5.context-menu-hover>svg{color:#fff}.context-menu-icon.context-menu-icon--fa5.context-menu-disabled i,.context-menu-icon.context-menu-icon--fa5.context-menu-disabled svg{color:#bbb}.context-menu-list{position:absolute;display:inline-block;min-width:13em;max-width:26em;padding:.25em 0;margin:.3em;font-family:inherit;font-size:inherit;list-style-type:none;background:#fff;border:1px solid #bebebe;border-radius:.2em;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.5);box-shadow:0 2px 5px rgba(0,0,0,.5)}.context-menu-item{position:relative;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;padding:.2em 2em;color:#2f2f2f;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff}.context-menu-separator{padding:0;margin:.35em 0;border-bottom:1px solid #e6e6e6}.context-menu-item>label>input,.context-menu-item>label>textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.context-menu-item.context-menu-hover{color:#fff;cursor:pointer;background-color:#2980b9}.context-menu-item.context-menu-disabled{color:#bbb;cursor:default;background-color:#fff}.context-menu-input.context-menu-hover{color:#2f2f2f;cursor:default}.context-menu-submenu:after{position:absolute;top:50%;right:.5em;z-index:1;width:0;height:0;content:"";border-color:transparent transparent transparent #2f2f2f;border-style:solid;border-width:.25em 0 .25em .25em;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%)}.context-menu-item.context-menu-input{padding:.3em .6em}.context-menu-input>label>*{vertical-align:top}.context-menu-input>label>input[type=checkbox],.context-menu-input>label>input[type=radio]{position:relative;top:.12em;margin-right:.4em}.context-menu-input>label{margin:0}.context-menu-input>label,.context-menu-input>label>input[type=text],.context-menu-input>label>select,.context-menu-input>label>textarea{display:block;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.context-menu-input>label>textarea{height:7em}.context-menu-item>.context-menu-list{top:.3em;right:-.3em;display:none}.context-menu-item.context-menu-visible>.context-menu-list{display:block}.context-menu-accesskey{text-decoration:underline} -/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:transparent}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{right:0}.sp-color,.sp-top-inner{position:absolute;top:0;left:0;bottom:0}.sp-color{right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid #000;background:#fff;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:1px solid #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:50%}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0;right:0;bottom:0;left:84%;height:28px}.sp-alpha,.sp-alpha-handle,.sp-clear,.sp-container,.sp-container.sp-dragging .sp-input,.sp-container button,.sp-dragger,.sp-preview,.sp-replacer,.sp-slider{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-buttons-disabled .sp-button-container,.sp-container.sp-input-disabled .sp-input-container,.sp-container.sp-palette-buttons-disabled .sp-palette-button-container,.sp-initial-disabled .sp-initial,.sp-palette-disabled .sp-palette-container,.sp-palette-only .sp-picker-container{display:none}.sp-sat{background-image:-webkit-gradient(linear,0 0,100% 0,from(#fff),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-moz-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-o-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-ms-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:linear-gradient(90deg,#fff,rgba(204,154,129,0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1,startColorstr="#FFFFFFFF",endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear,0 100%,0 0,from(#000),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-moz-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-o-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-ms-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:linear-gradient(0deg,#000,rgba(204,154,129,0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81",endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-ms-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-o-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(.17,#ff0),color-stop(.33,#0f0),color-stop(.5,#0ff),color-stop(.67,#00f),color-stop(.83,#f0f),to(red));background:-webkit-linear-gradient(top,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);background:linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000",endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00",endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00",endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff",endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff",endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff",endColorstr="#ff0000")}.sp-hidden{display:none!important}.sp-cf:after,.sp-cf:before{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media (max-device-width:480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;left:0}.sp-dragger,.sp-slider{cursor:pointer;position:absolute;top:0}.sp-slider{height:3px;left:-1px;right:-1px;border:1px solid #000;background:#fff;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:1px solid #f0c49b;padding:0}.sp-clear,.sp-color,.sp-container,.sp-container button,.sp-container input,.sp-hue{font:normal 12px Lucida Grande,Lucida Sans Unicode,Lucida Sans,Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-clear,.sp-color,.sp-hue{border:1px solid #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container,.sp-input{width:100%}.sp-input{font-size:12px!important;border:1px inset;padding:4px 5px;margin:0;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-palette-container,.sp-picker-container{float:left;position:relative;padding:10px 10px 300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:1px solid #fff}.sp-palette-container{border-right:1px solid #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:2px solid transparent}.sp-palette .sp-thumb-el.sp-thumb-active,.sp-palette .sp-thumb-el:hover{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:1px solid #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:50%}.sp-button-container,.sp-palette-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:1px solid #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer.sp-active,.sp-replacer:hover{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:1px solid #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:1px solid #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top,#eee,#ccc);background-image:-moz-linear-gradient(top,#eee,#ccc);background-image:-ms-linear-gradient(top,#eee,#ccc);background-image:-o-linear-gradient(top,#eee,#ccc);background-image:linear-gradient(180deg,#eee,#ccc);border:1px solid;border-color:#ccc #ccc #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top,#ddd,#bbb);background-image:-moz-linear-gradient(top,#ddd,#bbb);background-image:-ms-linear-gradient(top,#ddd,#bbb);background-image:-o-linear-gradient(top,#ddd,#bbb);background-image:linear-gradient(180deg,#ddd,#bbb);border:1px solid;border-color:#bbb #bbb #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid;border-color:#aaa #aaa #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f!important;padding:2px;margin:0 5px 0 0;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f!important;text-decoration:underline}.sp-palette span.sp-thumb-active,.sp-palette span:hover{border-color:#000}.sp-alpha,.sp-preview,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-alpha-inner,.sp-preview-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:50%;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}@font-face{font-family:yarnFont;src:url(../fonts/droid-sans-mono.ttf)}:root{--menu-dropdown-max-height:700px}body{overflow:hidden;-webkit-user-select:none;line-height:1.6em}h1,h2,h3,h4,h5,h6{margin:0;padding:0}.editor,button,input,select,textarea{outline:none}input[type=checkbox]{width:20px;height:20px;padding:0;line-height:0;vertical-align:bottom;margin:0 0 6px}::-webkit-scrollbar{background:-webkit-linear-gradient(top,#eee,#f4f4f4 50%,#eee);border-radius:12px;border-bottom:1px solid #e8e8e8;border-top:1px solid #e8e8e8;border-color:#ccc #e8e8e8;border-style:solid;border-width:1px;cursor:pointer}::-webkit-scrollbar-button{display:none}::-webkit-scrollbar-thumb{background:#ccc;border-radius:12px;border:1px solid #ccc;cursor:pointer}::-webkit-scrollbar-thumb:hover{background:#289aa5;border:1px solid #148691}.hidden,.templates{display:none!important}#app-bg{position:fixed;top:0;left:0;bottom:0;right:0;transform-style:preserve-3d;z-index:-1}#app{position:absolute;top:0;left:0;width:100%;height:100%;cursor:default;display:none}.app-zoom{bottom:5px;right:5px}.app-zoom-alt{left:5px;right:unset}.app-sort{bottom:60px;right:5px}.app-sort-alt{left:5px;right:unset}.app-undo-redo{bottom:115px;right:5px}.app-undo-redo-alt{left:82px;right:unset}.app-add-node{position:absolute;bottom:115px;right:98px;width:60px;height:38px;background:#fff;color:grey;border-radius:5px;padding:5px;line-height:40px;z-index:10000;cursor:pointer;text-align:center;transition:opacity .2s}.app-add-node-alt{left:5px;right:unset}.app-add-node:hover{color:#000}.app-add-node span{margin:auto;width:22px;height:22px}.app-add-node:active{opacity:0}.app-button{position:absolute;background:#fff;border-radius:5px;padding:5px;z-index:10000}.app-button span{width:22px;height:22px;margin:8px;float:left;cursor:pointer;text-align:center;transition:opacity .25s;color:grey}.app-button span:hover{color:#000}.app-button span:active{opacity:0}.arrows{width:100%;height:100%}.arrows,.grid-canvas{position:absolute;top:0;bottom:0;left:0;right:0}.nodes{overflow:hidden;width:100%;height:100%}.node,.nodes,.nodes-holder{position:absolute}.node{width:200px;height:200px;background:#fff;border-radius:2px;box-shadow:0 1px 1px rgba(0,0,0,.5);cursor:pointer;transition:border .25s;outline-width:1px;outline-style:solid;outline-color:transparent;outline-offset:50px}.node .title{padding:0 10px;height:40px;line-height:40px;font-size:.9em;font-weight:700;transition:color .25s,background .25s}.node .body,.node .title{box-sizing:border-box;width:100%;overflow:hidden}.node .body{position:absolute;top:40px;height:calc(100% - 48px);padding:8px;font-size:.8em;font-family:yarnFont;color:#666;line-height:1.3em}.node .body p{display:inline;margin:0;padding:0}.node .body-expanded,.node:hover .body{overflow:auto}.node .tags{position:absolute;box-sizing:border-box;width:100%;padding:2px 4px;bottom:0;border-top:1px solid #ddd;background:#ebebeb;overflow:hidden}.node .tags span{padding:4px 8px;margin:4px 4px 0 0;font-size:.8em;border-radius:4px;background-color:#e0d6c5;color:#8d8374}.node .colorDown,.node .colorUp,.node .delete,.node .edit{position:absolute;top:6px;bottom:164px;line-height:30px;opacity:0;transition:opacity .125s;background:#fff;border-radius:5px;text-align:center;height:30px;width:28px}.node .delete{right:6px}.node .colorUp{right:39px;border-top-left-radius:0;border-bottom-left-radius:0}.node .colorDown{right:67px;border-top-right-radius:0;border-bottom-right-radius:0}.node:hover .colorDown,.node:hover .colorUp,.node:hover .delete,.node:hover .edit{opacity:.5}.node .colorDown:hover,.node .colorUp:hover,.node .delete:hover,.node .edit:hover{opacity:1;transition:opacity .2s}.node .resize{position:absolute;right:0;bottom:0;width:20px;height:20px;background-color:#ddd}.inactive,.inactive:hover{border:1px solid #fff;cursor:default}.inactive .delete,.inactive .edit,.inactive:hover .delete,.inactive:hover .edit{opacity:0}.playtestLink:hover,.title-container.active>div,.title-container.active>div:hover{text-decoration:underline;text-decoration-color:#ff0062}.body.active,.body.active:hover,.tags.active{border:1px solid #ff0062!important}.settings-dialog{position:absolute;width:100%;height:100%;z-index:10004;background:rgba(0,0,0,.5);color:grey}.settings-form{position:absolute;box-sizing:border-box;left:15%;top:10%;width:70%;height:80%;padding:15px;background:#fff;border-radius:4px;box-shadow:0 1px 1px #000;overflow-y:auto;text-align:center}.settings-form h3{margin-bottom:10px}.settings-row{display:flex}.settings-column{flex:50%}.settings-item{width:auto;padding:10px;margin-bottom:5px;margin-right:5px;display:flex;flex-wrap:wrap;justify-content:space-between;text-align:left}.settings-icon{color:grey}.settings-label{padding-right:2px}.settings-value{flex:1}.settings-value>input{width:-webkit-fill-available;margin-right:2px}.markup{flex:50%;display:flex}.markup #theme,select{flex:60%}.markup button{margin-left:2px;flex:40%}.slider{-webkit-appearance:none;width:100%;height:5px;border-radius:5px;background:#d3d3d3;outline:none;opacity:.7;-webkit-transition:.2s;transition:opacity .2s}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:15px;height:15px;border-radius:50%;background:#2470f7;cursor:pointer}.slider::-moz-range-thumb{width:25px;height:25px;border-radius:50%;background:#2470f7;cursor:pointer}.icon{display:inline-block;height:1em;width:1em;stroke-width:0;stroke:currentColor;fill:currentColor;vertical-align:-.125em;overflow:visible}.icon-lg{font-size:1.333em;line-height:.75em;vertical-align:-.225em}.icon-fw{width:1.25em;text-align:center}.icon-flip{transform:scaleX(-1)}.node-editor{background:none;pointer-events:none;z-index:10004}#node-editor-background,.node-editor{position:absolute;width:100%;height:100%}#node-editor-background{z-index:10002;background:rgba(0,0,0,.5);z-index:10004}.node-editor .form{position:absolute;box-sizing:border-box;left:5%;top:5%;width:90%;height:90%;padding:15px 15px 5px;background:#fff;border-radius:4px;box-shadow:0 1px 1px #000;display:flex;flex-flow:column;overflow:hidden;z-index:10002;pointer-events:all}.node-editor .form .close{position:absolute;right:4px;top:4px;background-position:-64px 0}.node-editor .form input[type=text]{box-sizing:border-box;width:100%;font-size:1.2em;color:#666;padding:10px 0;margin-bottom:5px;border:none;border-bottom:2px solid #eee;font-family:Lucida Console,Monaco,monospace}input#editorTitle{width:calc(100% - 230px);padding-right:10px}.node-editor .form .bbcode-toolbar,.node-editor .form .toggle-toolbar{float:left;width:100%;font-size:.8em}.node-editor .form .toggle-toolbar{padding-top:5px}.bbcode-button{cursor:pointer;text-align:center;border-radius:12px;background-color:#fff;overflow:hidden;color:#000;border:2px solid #e7e7e7;-webkit-transition-duration:.4s;transition-duration:.4s;text-decoration:none;display:inline-block;min-width:20px;max-width:120px;white-space:nowrap;text-overflow:ellipsis}.bbcode-button.rotated{transform:rotate(90deg)}.bbcode-button:hover{background-color:#e7e7e7}.bbcode-button.active{background-color:#78c9be}.split-editor{position:relative!important;top:30px!important;left:0!important;height:calc(100% - 30px)!important;float:left;border-radius:0!important;box-shadow:none!important;min-width:710px;max-width:calc(100% - 190px)}.split-editor-right{right:0!important;float:right!important}.split-editor-unfocused{opacity:.6!important}.bbcode-button-separator{color:grey;opacity:.2;line-height:22px}.float-right{float:right!important}.bbcode-button-right{float:right;margin:0 2px}.bbcode-button-separator-float-right{float:right;line-height:22px;margin:0 2px}#edit-node-in-vscode{float:right;font-size:125%}.title-error{color:red}.title-warning{color:#ff8c00}.title-error,.title-warning{word-break:break-all;white-space:normal}.menu:hover .title{width:100%}#editor-resize-handle{height:calc(100% - 30px);width:10px;position:relative;flex:0 0 auto;right:0;float:left;top:30px;background:#e7e7e7;cursor:ew-resize;pointer-events:all}#editor-resize-handle span{display:flex;justify-content:center;text-align:center;align-items:center;height:calc(100% - 30px)}.styled-checkbox input{-webkit-transition-duration:.4s;transition-duration:.4s;outline:none;opacity:0;display:none}.styled-checkbox label{padding:2px 6px;color:grey;border-radius:12px;border:2px solid #e7e7e7}.styled-checkbox input:checked+label{padding:2px 6px;color:#000;background-color:#daeff1;border:2px solid #b0d9cd}.styled-checkbox input:checked+label.transcribe-button{padding:2px 6px;color:#000;background-color:#efc7c7;border:2px solid #dc8484}.node-editor .form .editor-counter{right:20px;width:100%;float:left;font-size:.8em}.node-editor .form .editor{white-space:pre;box-sizing:border-box;min-height:100%;padding:0;margin:0;line-height:1.5em;font-size:.9em;color:#666;font-family:yarnFont}.editor-container{margin-top:2px;width:100%;height:100%;float:left;overflow:hidden;position:relative}.editor-container .editor-play,.editor-container .editor-preview{display:none;max-height:100%;width:100%;overflow-y:auto;white-space:pre;box-sizing:border-box;font-size:.9em;line-height:1.5em;color:#666;font-family:yarnFont;cursor:pointer;height:100%;position:absolute}#editor-preview{display:flex!important;flex-direction:column!important}.editor-take-half{left:0;width:50%}.editor-play,.editor-take-half{display:flex;position:absolute;top:0}.editor-play{left:50%;overflow-y:hidden!important;-webkit-tap-highlight-color:transparent}#commandDebugLabel{overflow-y:auto;overflow-x:hidden;width:50%;resize:none;font:normal arial,calibri}.editor-play.inYarnMode{left:0}#commandDebugLabel.inYarnMode{width:100%}.story-playtest-answer,.story-playtest-bubble{color:#000;width:90%;border-radius:17px;padding:2px 8px;margin:4px;background:#7df1c1;font:large arial,calibri;white-space:break-spaces}.story-playtest-answer{background:#dedede!important;opacity:.7}.answer-post{margin-right:0;margin-left:10%;width:80%}.story-animated-dots{display:flex}.story-animated-dots p{animation-name:jumping-dots;animation-duration:.7s;animation-iteration-count:infinite;animation-timing-function:linear}.story-animated-dots p:nth-child(2){animation-delay:.2s}.story-animated-dots p:nth-child(3){animation-delay:.4s}@keyframes jumping-dots{20%{transform:translateY(0)}40%{transform:translateY(2px)}60%{transform:translateY(3px)}80%{transform:translateY(2px)}}#NVrichTextLabel{position:absolute;bottom:10px;padding:10px}.editor p,.node .body p{display:inline;margin:0;padding:0}.linkname{color:#3ecfe9}.linkbounds{color:#0ec0e0}.condition{color:#e93ecf}.conditionbounds{color:#e00ec0}.comment{color:#44fe66}.node-delete{position:absolute;width:100%;height:100%;z-index:10004;background:rgba(0,0,0,.5)}.node-delete .form{margin-left:auto;margin-right:auto;margin-top:100px;padding:20px;width:200px;height:120px;background:#fff;border-radius:4px;box-shadow:0 1px 1px #000}.node-delete .form .close{display:block;margin-left:auto;margin-right:auto;margin-top:50px;background-position:-64px 0}#marquee{z-index:10000;display:none;position:absolute;pointer-events:none;border:1px solid #49eff1;background-color:rgba(29,94,95,.2)}.title{box-sizing:border-box;padding:5px;width:100%;line-height:20px;font-weight:700;float:left}.app-menu{z-index:10003}.file-tabs{position:absolute;bottom:60px;left:27px;min-width:27px;opacity:.3;z-index:10002;transform:rotate(270deg);transform-origin:left;display:flex;gap:3px}.file-tabs .bbcode-button{max-width:200px}.file-tabs:hover{opacity:.9}.file-tabs-buttons{display:flex;gap:3px;max-width:61vh;overflow:hidden;transition:max-width .15s ease-in}.file-tabs-buttons.collapsed{max-width:0}.app-search{z-index:10004}.menu:hover .dropdown,input:focus+span+.dropdown{max-height:var(--menu-dropdown-max-height)}input:focus+span+.dropdown{overflow-y:auto}.menu .dropdown{clear:left;overflow:auto;max-height:0;transition:max-height .5s;-ms-overflow-style:none;scrollbar-width:none}.menu .dropdown::-webkit-scrollbar{display:none}.menu .dropdown .item{display:block;box-sizing:border-box;padding:7px}.menu .dropdown .search-field{box-sizing:border-box;float:left;display:block;width:100%;padding:10px;text-align:center}.item img{width:24px}.add-link{position:absolute;top:15px;right:15px;height:40px;font-family:sans-serif;line-height:1.6em;font-size:.9em;cursor:default;box-shadow:0 0 1px 1px #e8e8e8;z-index:10000;background-color:#fff;max-width:40%}.add-link:hover{background:#e8e8e8}#linkHelperMenuFilter{border-right:2px solid #e8e8e8;border-left:2px solid #e8e8e8;border-bottom:0}#add-link-title{line-height:40px;text-align:center;padding:0;width:100%}.tooltip{opacity:.7;position:absolute;text-align:center;z-index:99!important}.button-bubble{width:20px;height:20px;position:absolute;overflow-wrap:break-word}.button-bubble:after{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;background:#444;border-radius:8px;color:#fff;content:attr(title);margin:-62px -110px 0;font-size:16px;padding:13px;width:220px;z-index:99!important}.button-bubble:before{border:solid;border-color:#444 transparent;border-width:12px 6px 0;content:"";left:45%;bottom:30px;position:absolute}.disabled{opacity:.65;pointer-events:none;cursor:not-allowed}.storyPreviewChoiceButton{color:#290018;font-size:1.2em;margin:3px}.app-info{position:absolute;left:20px;bottom:20px;font-size:.8em;text-transform:uppercase;line-height:1.2em;opacity:.5}#addPwa{position:absolute;left:15px;bottom:60px;color:#6b3877}.app-info span{display:block}.app-title{font-weight:700}.app-version:before{content:"Version "}.menu-icon{color:#000}.ace-content{cursor:text}.ace_tooltip{background-color:unset}.editor-preview img,.story-playtest-bubble>img{max-height:200px;border-radius:7px}.editor-preview img:hover,.story-playtest-bubble>img:hover{max-height:unset;max-width:90%}@media screen and (max-width:900px){.settings-row{flex-direction:column}}@media only screen and (min-width:600px){.show-when-narrow{display:none}}@media only screen and (max-width:600px){.hide-when-narrow{display:none!important}.show-when-narrow{display:inline!important}.node-editor .form{top:8%;height:92%;padding:2px 2px 5px;line-height:0;border-radius:4px;display:flex!important;flex-flow:column!important}.node-editor .form .toggle-toolbar,.toggle-toolbar{padding:0;font-size:.6em!important}.editor-counter{white-space:nowrap}.node-editor .form input[type=text]{font-size:1em!important;padding:0!important;margin-top:0!important;margin-bottom:0!important;border-bottom:0!important}input#editorTitle{width:calc(60% - 25px)}.settings-form{left:5%!important;top:5%!important;width:90%!important;height:90%!important}button.bbcode-button{border:1px solid #e7e7e7!important;font-size:.8em;padding:1px 2px 0!important}.bbcode-toolbar .styled-checkbox label{font-size:.8em;padding:4px 0 3px!important}.context-menu-visible>.context-menu-list{left:0!important;top:40px!important}.menu:hover .dropdown.shrink-when-narrow{max-height:45vh!important}.app-search,.menu{opacity:.85}#linkHelperMenuFilter{min-height:35px}.emojipicker-container,.tooltip{top:15%!important;left:15%!important}.app-undo-redo span{display:inline}.app-sort{display:none}.app-undo-redo{bottom:60px}.app-add-node{bottom:60px;opacity:.5}.app-button{opacity:.5}.settings-form,.settings-item{padding:1px}.ace_gutter{width:26px!important}.ace_gutter-cell{padding-left:0!important;right:unset;font-size:small}.ace_mobile-button{display:none}.ace_scroller{left:23px!important}.add-link{top:0;right:20px;height:20px;border-radius:4px}#add-link-title{line-height:20px}}.twitter-tweet-rendered{position:relative!important;height:0!important;padding-bottom:56.25%!important}.twitter-tweet-rendered>iframe{position:absolute!important;top:0!important;left:0!important;width:100%!important;height:100%!important}.editor-preview font>iframe{display:flex}input[type=search]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}@keyframes opacityPulse{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}.opacity-pulse{animation:opacityPulse 3s ease-out;animation-iteration-count:infinite;opacity:0}.centered{transform:translate(50%,50%);position:absolute;display:flex;flex:1;align-items:center}.swal2-content{max-height:50vh!important}@keyframes fadeIn{to{opacity:1}}.fade-in{animation:fadeIn .5s ease-in 1 forwards;opacity:0}.is-paused{animation-play-state:paused}.flex-wrap{display:flex;flex-wrap:wrap;gap:3px;align-items:center}.syntax-mode-banner{position:absolute;bottom:0;filter:blur(1px);opacity:.15;max-width:50vw;z-index:-9999}div.jsoneditor-tree{min-height:50vh;max-height:70vh;overflow:auto}@media only screen and (max-width:600px){.swal2-popup{padding:2px!important}.swal2-actions{margin:1px!important}}.swal2-title{width:100%}.swal2-content{max-height:80vh;overflow:auto}.form-control>input{max-width:100px}.je-table{display:flex;justify-content:center;flex-wrap:wrap} \ No newline at end of file +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:transparent}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{right:0}.sp-color,.sp-top-inner{position:absolute;top:0;left:0;bottom:0}.sp-color{right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid #000;background:#fff;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:1px solid #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:50%}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0;right:0;bottom:0;left:84%;height:28px}.sp-alpha,.sp-alpha-handle,.sp-clear,.sp-container,.sp-container.sp-dragging .sp-input,.sp-container button,.sp-dragger,.sp-preview,.sp-replacer,.sp-slider{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-buttons-disabled .sp-button-container,.sp-container.sp-input-disabled .sp-input-container,.sp-container.sp-palette-buttons-disabled .sp-palette-button-container,.sp-initial-disabled .sp-initial,.sp-palette-disabled .sp-palette-container,.sp-palette-only .sp-picker-container{display:none}.sp-sat{background-image:-webkit-gradient(linear,0 0,100% 0,from(#fff),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-moz-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-o-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-ms-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:linear-gradient(90deg,#fff,rgba(204,154,129,0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1,startColorstr="#FFFFFFFF",endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear,0 100%,0 0,from(#000),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-moz-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-o-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-ms-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:linear-gradient(0deg,#000,rgba(204,154,129,0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81",endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-ms-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-o-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(.17,#ff0),color-stop(.33,#0f0),color-stop(.5,#0ff),color-stop(.67,#00f),color-stop(.83,#f0f),to(red));background:-webkit-linear-gradient(top,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);background:linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000",endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00",endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00",endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff",endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff",endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff",endColorstr="#ff0000")}.sp-hidden{display:none!important}.sp-cf:after,.sp-cf:before{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media (max-device-width:480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;left:0}.sp-dragger,.sp-slider{cursor:pointer;position:absolute;top:0}.sp-slider{height:3px;left:-1px;right:-1px;border:1px solid #000;background:#fff;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:1px solid #f0c49b;padding:0}.sp-clear,.sp-color,.sp-container,.sp-container button,.sp-container input,.sp-hue{font:normal 12px Lucida Grande,Lucida Sans Unicode,Lucida Sans,Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-clear,.sp-color,.sp-hue{border:1px solid #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container,.sp-input{width:100%}.sp-input{font-size:12px!important;border:1px inset;padding:4px 5px;margin:0;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-palette-container,.sp-picker-container{float:left;position:relative;padding:10px 10px 300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:1px solid #fff}.sp-palette-container{border-right:1px solid #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:2px solid transparent}.sp-palette .sp-thumb-el.sp-thumb-active,.sp-palette .sp-thumb-el:hover{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:1px solid #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:50%}.sp-button-container,.sp-palette-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:1px solid #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer.sp-active,.sp-replacer:hover{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:1px solid #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:1px solid #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top,#eee,#ccc);background-image:-moz-linear-gradient(top,#eee,#ccc);background-image:-ms-linear-gradient(top,#eee,#ccc);background-image:-o-linear-gradient(top,#eee,#ccc);background-image:linear-gradient(180deg,#eee,#ccc);border:1px solid;border-color:#ccc #ccc #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top,#ddd,#bbb);background-image:-moz-linear-gradient(top,#ddd,#bbb);background-image:-ms-linear-gradient(top,#ddd,#bbb);background-image:-o-linear-gradient(top,#ddd,#bbb);background-image:linear-gradient(180deg,#ddd,#bbb);border:1px solid;border-color:#bbb #bbb #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid;border-color:#aaa #aaa #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f!important;padding:2px;margin:0 5px 0 0;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f!important;text-decoration:underline}.sp-palette span.sp-thumb-active,.sp-palette span:hover{border-color:#000}.sp-alpha,.sp-preview,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-alpha-inner,.sp-preview-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:50%;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}@font-face{font-family:yarnFont;src:url(../fonts/droid-sans-mono.ttf)}:root{--menu-dropdown-max-height:700px}body{overflow:hidden;-webkit-user-select:none;line-height:1.6em}h1,h2,h3,h4,h5,h6{margin:0;padding:0}.editor,button,input,select,textarea{outline:none}input[type=checkbox]{width:20px;height:20px;padding:0;line-height:0;vertical-align:bottom;margin:0 0 6px}::-webkit-scrollbar{background:-webkit-linear-gradient(top,#eee,#f4f4f4 50%,#eee);border-radius:12px;border-bottom:1px solid #e8e8e8;border-top:1px solid #e8e8e8;border-color:#ccc #e8e8e8;border-style:solid;border-width:1px;cursor:pointer}::-webkit-scrollbar-button{display:none}::-webkit-scrollbar-thumb{background:#ccc;border-radius:12px;border:1px solid #ccc;cursor:pointer}::-webkit-scrollbar-thumb:hover{background:#289aa5;border:1px solid #148691}.hidden,.templates{display:none!important}#app-bg{position:fixed;top:0;left:0;bottom:0;right:0;transform-style:preserve-3d;z-index:-1}#app{position:absolute;top:0;left:0;width:100%;height:100%;cursor:default;display:none}.app-zoom{bottom:5px;right:5px}.app-zoom-alt{left:5px;right:unset}.app-sort{bottom:60px;right:5px}.app-sort-alt{left:5px;right:unset}.app-undo-redo{bottom:115px;right:5px}.app-undo-redo-alt{left:82px;right:unset}.app-add-node{position:absolute;bottom:115px;right:98px;width:60px;height:38px;background:#fff;color:grey;border-radius:5px;padding:5px;line-height:40px;z-index:10000;cursor:pointer;text-align:center;transition:opacity .2s}.app-add-node-alt{left:5px;right:unset}.app-add-node:hover{color:#000}.app-add-node span{margin:auto;width:22px;height:22px}.app-add-node:active{opacity:0}.app-button{position:absolute;background:#fff;border-radius:5px;padding:5px;z-index:10000}.app-button span{width:22px;height:22px;margin:8px;float:left;cursor:pointer;text-align:center;transition:opacity .25s;color:grey}.app-button span:hover{color:#000}.app-button span:active{opacity:0}.arrows{width:100%;height:100%}.arrows,.grid-canvas{position:absolute;top:0;bottom:0;left:0;right:0}.nodes{overflow:hidden;width:100%;height:100%}.node,.nodes,.nodes-holder{position:absolute}.node{width:200px;height:200px;background:#fff;border-radius:2px;box-shadow:0 1px 1px rgba(0,0,0,.5);cursor:pointer;transition:border .25s;outline-width:1px;outline-style:solid;outline-color:transparent;outline-offset:50px}.node .title{padding:0 10px;height:40px;line-height:40px;font-size:.9em;font-weight:700;transition:color .25s,background .25s}.node .body,.node .title{box-sizing:border-box;width:100%;overflow:hidden}.node .body{position:absolute;top:40px;height:calc(100% - 48px);padding:8px;font-size:.8em;font-family:yarnFont;color:#666;line-height:1.3em}.node .body p{display:inline;margin:0;padding:0}.node .body-expanded,.node:hover .body{overflow:auto}.node .tags{position:absolute;box-sizing:border-box;width:100%;padding:2px 4px;bottom:0;border-top:1px solid #ddd;background:#ebebeb;overflow:hidden}.node .tags span{padding:4px 8px;margin:4px 4px 0 0;font-size:.8em;border-radius:4px;background-color:#e0d6c5;color:#8d8374}.node .colorDown,.node .colorUp,.node .delete,.node .edit{position:absolute;top:6px;bottom:164px;line-height:30px;opacity:0;transition:opacity .125s;background:#fff;border-radius:5px;text-align:center;height:30px;width:28px}.node .delete{right:6px}.node .colorUp{right:39px;border-top-left-radius:0;border-bottom-left-radius:0}.node .colorDown{right:67px;border-top-right-radius:0;border-bottom-right-radius:0}.node:hover .colorDown,.node:hover .colorUp,.node:hover .delete,.node:hover .edit{opacity:.5}.node .colorDown:hover,.node .colorUp:hover,.node .delete:hover,.node .edit:hover{opacity:1;transition:opacity .2s}.node .resize{position:absolute;right:0;bottom:0;width:20px;height:20px;background-color:#ddd}.inactive,.inactive:hover{border:1px solid #fff;cursor:default}.inactive .delete,.inactive .edit,.inactive:hover .delete,.inactive:hover .edit{opacity:0}.playtestLink:hover,.title-container.active>div,.title-container.active>div:hover{text-decoration:underline;text-decoration-color:#ff0062}.body.active,.body.active:hover,.tags.active{border:1px solid #ff0062!important}.settings-dialog{position:absolute;width:100%;height:100%;z-index:10004;background:rgba(0,0,0,.5);color:grey}.settings-form{position:absolute;box-sizing:border-box;left:15%;top:10%;width:70%;height:80%;padding:15px;background:#fff;border-radius:4px;box-shadow:0 1px 1px #000;overflow-y:auto;text-align:center}.settings-form h3{margin-bottom:10px}.settings-row{display:flex}.settings-column{flex:50%}.settings-item{width:auto;padding:10px;margin-bottom:5px;margin-right:5px;display:flex;flex-wrap:wrap;justify-content:space-between;text-align:left}.settings-icon{color:grey}.settings-label{padding-right:2px}.settings-value{flex:1}.settings-value>input{width:-webkit-fill-available;margin-right:2px}.markup{flex:50%;display:flex}.markup #theme,select{flex:60%}.markup button{margin-left:2px;flex:40%}.slider{-webkit-appearance:none;width:100%;height:5px;border-radius:5px;background:#d3d3d3;outline:none;opacity:.7;-webkit-transition:.2s;transition:opacity .2s}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:15px;height:15px;border-radius:50%;background:#2470f7;cursor:pointer}.slider::-moz-range-thumb{width:25px;height:25px;border-radius:50%;background:#2470f7;cursor:pointer}.icon{display:inline-block;height:1em;width:1em;stroke-width:0;stroke:currentColor;fill:currentColor;vertical-align:-.125em;overflow:visible}.icon-lg{font-size:1.333em;line-height:.75em;vertical-align:-.225em}.icon-fw{width:1.25em;text-align:center}.icon-flip{transform:scaleX(-1)}.node-editor{background:none;pointer-events:none;z-index:10004}#node-editor-background,.node-editor{position:absolute;width:100%;height:100%}#node-editor-background{z-index:10002;background:rgba(0,0,0,.5);z-index:10004}.node-editor .form{position:absolute;box-sizing:border-box;left:5%;top:5%;width:90%;height:90%;padding:15px 15px 5px;background:#fff;border-radius:4px;box-shadow:0 1px 1px #000;display:flex;flex-flow:column;overflow:hidden;z-index:10002;pointer-events:all}.node-editor .form .close{position:absolute;right:4px;top:4px;background-position:-64px 0}.node-editor .form input[type=text]{box-sizing:border-box;width:100%;font-size:1.2em;color:#666;padding:10px 0;margin-bottom:5px;border:none;border-bottom:2px solid #eee;font-family:Lucida Console,Monaco,monospace}input#editorTitle{width:calc(100% - 230px);padding-right:10px}.node-editor .form .bbcode-toolbar,.node-editor .form .toggle-toolbar{float:left;width:100%;font-size:.8em}.node-editor .form .toggle-toolbar{padding-top:5px}.bbcode-button{cursor:pointer;text-align:center;border-radius:12px;background-color:#fff;overflow:hidden;color:#000;border:2px solid #e7e7e7;-webkit-transition-duration:.4s;transition-duration:.4s;text-decoration:none;display:inline-block;min-width:20px;max-width:120px;white-space:nowrap;text-overflow:ellipsis}.bbcode-button.rotated{transform:rotate(90deg)}.bbcode-button:hover{background-color:#e7e7e7}.bbcode-button.active{background-color:#78c9be}.split-editor{position:relative!important;top:30px!important;left:0!important;height:calc(100% - 30px)!important;float:left;border-radius:0!important;box-shadow:none!important;min-width:710px;max-width:calc(100% - 190px)}.split-editor-right{right:0!important;float:right!important}.split-editor-unfocused{opacity:.6!important}.bbcode-button-separator{color:grey;opacity:.2;line-height:22px}.float-right{float:right!important}.bbcode-button-right{float:right;margin:0 2px}.bbcode-button-separator-float-right{float:right;line-height:22px;margin:0 2px}#edit-node-in-vscode{float:right;font-size:125%}.title-error{color:red}.title-warning{color:#ff8c00}.title-error,.title-warning{word-break:break-all;white-space:normal}.menu:hover .title{width:100%}#editor-resize-handle{height:calc(100% - 30px);width:10px;position:relative;flex:0 0 auto;right:0;float:left;top:30px;background:#e7e7e7;cursor:ew-resize;pointer-events:all}#editor-resize-handle span{display:flex;justify-content:center;text-align:center;align-items:center;height:calc(100% - 30px)}.styled-checkbox input{-webkit-transition-duration:.4s;transition-duration:.4s;outline:none;opacity:0;display:none}.styled-checkbox label{padding:2px 6px;color:grey;border-radius:12px;border:2px solid #e7e7e7}.styled-checkbox input:checked+label{padding:2px 6px;color:#000;background-color:#daeff1;border:2px solid #b0d9cd}.styled-checkbox input:checked+label.transcribe-button{padding:2px 6px;color:#000;background-color:#efc7c7;border:2px solid #dc8484}.node-editor .form .editor-counter{right:20px;width:100%;float:left;font-size:.8em}.node-editor .form .editor{white-space:pre;box-sizing:border-box;min-height:100%;padding:0;margin:0;line-height:1.5em;font-size:.9em;color:#666;font-family:yarnFont}.editor-container{margin-top:2px;width:100%;height:100%;float:left;overflow:hidden;position:relative}.editor-container .editor-play,.editor-container .editor-preview{display:none;max-height:100%;width:100%;overflow-y:auto;white-space:pre;box-sizing:border-box;font-size:.9em;line-height:1.5em;color:#666;font-family:yarnFont;cursor:pointer;height:100%;position:absolute}#editor-preview{display:flex!important;flex-direction:column!important}.editor-take-half{left:0;width:50%}.editor-play,.editor-take-half{display:flex;position:absolute;top:0}.editor-play{left:50%;overflow-y:hidden!important;-webkit-tap-highlight-color:transparent}#commandDebugLabel{overflow-y:auto;overflow-x:hidden;width:50%;resize:none;font:normal arial,calibri}.editor-play.inYarnMode{left:0}#commandDebugLabel.inYarnMode{width:100%}.story-playtest-answer,.story-playtest-bubble{color:#000;width:90%;border-radius:17px;padding:2px 8px;margin:4px;background:#7df1c1;font:large arial,calibri;white-space:break-spaces}.story-playtest-answer{background:#dedede!important;opacity:.7}.answer-post{margin-right:0;margin-left:10%;width:80%}.story-animated-dots{display:flex}.story-animated-dots p{animation-name:jumping-dots;animation-duration:.7s;animation-iteration-count:infinite;animation-timing-function:linear}.story-animated-dots p:nth-child(2){animation-delay:.2s}.story-animated-dots p:nth-child(3){animation-delay:.4s}@keyframes jumping-dots{20%{transform:translateY(0)}40%{transform:translateY(2px)}60%{transform:translateY(3px)}80%{transform:translateY(2px)}}#NVrichTextLabel{position:absolute;bottom:10px;padding:10px}.editor p,.node .body p{display:inline;margin:0;padding:0}.linkname{color:#3ecfe9}.linkbounds{color:#0ec0e0}.condition{color:#e93ecf}.conditionbounds{color:#e00ec0}.comment{color:#44fe66}.node-delete{position:absolute;width:100%;height:100%;z-index:10004;background:rgba(0,0,0,.5)}.node-delete .form{margin-left:auto;margin-right:auto;margin-top:100px;padding:20px;width:200px;height:120px;background:#fff;border-radius:4px;box-shadow:0 1px 1px #000}.node-delete .form .close{display:block;margin-left:auto;margin-right:auto;margin-top:50px;background-position:-64px 0}#marquee{z-index:10000;display:none;position:absolute;pointer-events:none;border:1px solid #49eff1;background-color:rgba(29,94,95,.2)}.title{box-sizing:border-box;padding:5px;width:100%;line-height:20px;font-weight:700;float:left}.app-menu{z-index:10003}.file-tabs{position:absolute;bottom:60px;left:27px;min-width:27px;opacity:.3;z-index:10002;transform:rotate(270deg);transform-origin:left;display:flex;gap:3px}.file-tabs .bbcode-button{max-width:200px}.file-tabs:hover{opacity:.9}.file-tabs-buttons{display:flex;gap:3px;max-width:61vh;overflow:hidden;transition:max-width .15s ease-in}.file-tabs-buttons.collapsed{max-width:0}.app-search{z-index:10004}.menu:hover .dropdown,input:focus+span+.dropdown{max-height:var(--menu-dropdown-max-height)}input:focus+span+.dropdown{overflow-y:auto}.menu .dropdown{clear:left;overflow:auto;max-height:0;transition:max-height .5s;-ms-overflow-style:none;scrollbar-width:none}.menu .dropdown::-webkit-scrollbar{display:none}.menu .dropdown .item{display:block;box-sizing:border-box;padding:7px}.menu .dropdown .search-field{box-sizing:border-box;float:left;display:block;width:100%;padding:10px;text-align:center}.item img{width:24px}.add-link{position:absolute;top:15px;right:15px;height:40px;font-family:sans-serif;line-height:1.6em;font-size:.9em;cursor:default;box-shadow:0 0 1px 1px #e8e8e8;z-index:10000;background-color:#fff;max-width:40%}.add-link:hover{background:#e8e8e8}#linkHelperMenuFilter{border-right:2px solid #e8e8e8;border-left:2px solid #e8e8e8;border-bottom:0}#add-link-title{line-height:40px;text-align:center;padding:0;width:100%}.tooltip{opacity:.7;position:absolute;text-align:center;z-index:99!important}.button-bubble{width:20px;height:20px;position:absolute;overflow-wrap:break-word}.button-bubble:after{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;background:#444;border-radius:8px;color:#fff;content:attr(title);margin:-62px -110px 0;font-size:16px;padding:13px;width:220px;z-index:99!important}.button-bubble:before{border:solid;border-color:#444 transparent;border-width:12px 6px 0;content:"";left:45%;bottom:30px;position:absolute}.disabled{opacity:.65;pointer-events:none;cursor:not-allowed}.storyPreviewChoiceButton{color:#290018;font-size:1.2em;margin:3px}.app-info{position:absolute;left:20px;bottom:20px;font-size:.8em;text-transform:uppercase;line-height:1.2em;opacity:.5}#addPwa{position:absolute;left:15px;bottom:60px;color:#6b3877}.app-info span{display:block}.app-title{font-weight:700}.app-version:before{content:"Version "}.menu-icon{color:#000}.ace-content{cursor:text}.ace_tooltip{background-color:unset}.editor-preview img,.story-playtest-bubble>img{max-height:200px;border-radius:7px}.editor-preview img:hover,.story-playtest-bubble>img:hover{max-height:unset;max-width:90%}@media screen and (max-width:900px){.settings-row{flex-direction:column}}@media only screen and (min-width:600px){.show-when-narrow{display:none}}@media only screen and (max-width:600px){.hide-when-narrow{display:none!important}.show-when-narrow{display:inline!important}.node-editor .form{top:8%;height:92%;padding:2px 2px 5px;line-height:0;border-radius:4px;display:flex!important;flex-flow:column!important}.node-editor .form .toggle-toolbar,.toggle-toolbar{padding:0;font-size:.6em!important}.editor-counter{white-space:nowrap}.node-editor .form input[type=text]{font-size:1em!important;padding:0!important;margin-top:0!important;margin-bottom:0!important;border-bottom:0!important}input#editorTitle{width:calc(60% - 25px)}.settings-form{left:5%!important;top:5%!important;width:90%!important;height:90%!important}button.bbcode-button{border:1px solid #e7e7e7!important;font-size:.8em;padding:1px 2px 0!important}.bbcode-toolbar .styled-checkbox label{font-size:.8em;padding:4px 0 3px!important}.context-menu-visible>.context-menu-list{left:0!important;top:40px!important}.menu:hover .dropdown.shrink-when-narrow{max-height:45vh!important}.app-search,.menu{opacity:.85}#linkHelperMenuFilter{min-height:35px}.emojipicker-container,.tooltip{top:15%!important;left:15%!important}.app-undo-redo span{display:inline}.app-sort{display:none}.app-undo-redo{bottom:60px}.app-add-node{bottom:60px;opacity:.5}.app-button{opacity:.5}.settings-form,.settings-item{padding:1px}.ace_gutter{width:26px!important}.ace_gutter-cell{padding-left:0!important;right:unset;font-size:small}.ace_mobile-button{display:none}.ace_scroller{left:23px!important}.add-link{top:0;right:20px;height:20px;border-radius:4px}#add-link-title{line-height:20px}}.twitter-tweet-rendered{position:relative!important;height:0!important;padding-bottom:56.25%!important}.twitter-tweet-rendered>iframe{position:absolute!important;top:0!important;left:0!important;width:100%!important;height:100%!important}.editor-preview font>iframe{display:flex}input[type=search]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}@keyframes opacityPulse{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}.opacity-pulse{animation:opacityPulse 3s ease-out;animation-iteration-count:infinite;opacity:0}.centered{transform:translate(50%,50%);position:absolute;display:flex;flex:1;align-items:center}.swal2-content{max-height:50vh!important}@keyframes fadeIn{to{opacity:1}}.fade-in{animation:fadeIn .5s ease-in 1 forwards;opacity:0}.is-paused{animation-play-state:paused}.flex-wrap{display:flex;flex-wrap:wrap;gap:3px;align-items:center}.syntax-mode-banner{position:absolute;bottom:0;filter:blur(1px);opacity:.15;max-width:50vw;z-index:-9999}@media only screen and (max-width:600px){.swal2-popup{padding:2px!important}.swal2-actions{margin:1px!important}}.swal2-title{width:100%}.swal2-content{max-height:80vh;overflow:auto}.table{width:100%}.table-editable{width:100%;position:relative}.table-header{top:0}.table-footer,.table-header{position:sticky;background-color:#007;color:#0ff}.table-footer{bottom:0;display:flex;justify-content:space-between}.table-editable .glyphicon{font-size:20px}.table-remove{color:#700;cursor:pointer;text-align:center}.cell{width:180px;max-width:180px;text-align:left;padding-left:3px;padding-right:3px}.table-remove:hover{color:red}.table-down:hover,.table-up:hover{color:#00f}.table-add{width:120px;color:#070;cursor:pointer;text-align:center}.table-add:hover{color:#0b0}.hide{display:none} \ No newline at end of file diff --git a/index.html b/index.html index a00810ba5..71db4541a 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ -Yarn
 
\ No newline at end of file + event: { change: app.workspace.updateArrows }">
\ No newline at end of file diff --git a/js/main.9bf617ddccfee721ee25.js b/js/main.9bf617ddccfee721ee25.js deleted file mode 100644 index 2cdce0bd1..000000000 --- a/js/main.9bf617ddccfee721ee25.js +++ /dev/null @@ -1,15 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{0:function(t,e){},"0PmM":function(t,e,n){ -/*! - * /** - * * @name JSON Editor - * * @description JSON Schema Based Editor - * * This library is the continuation of jdorn's great work (see also https://github.com/jdorn/json-editor/issues/800) - * * @version "2.5.4" - * * @author Jeremy Dorn - * * @see https://github.com/jdorn/json-editor/ - * * @see https://github.com/json-editor/json-editor - * * @license MIT - * * @example see README.md and docs/ for requirements, examples and usage info - * * / - */ -window,t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=166)}([function(t,e,n){var i=n(35),r=n(94),o=n(70),a=n(63),s=n(121),l=a.set,c=a.getterFor("Array Iterator");t.exports=s(Array,"Array",(function(t,e){l(this,{type:"Array Iterator",target:i(t),index:0,kind:e})}),(function(){var t=c(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var i=n(14),r=n(22),o=n(54),a=n(64),s=n(23),l=n(90),c=n(112),u=n(17),d=n(28),p=n(66),h=n(27),f=n(29),m=n(32),y=n(35),g=n(62),b=n(60),v=n(55),w=n(67),_=n(65),k=n(141),x=n(88),C=n(47),S=n(30),E=n(74),T=n(40),O=n(45),j=n(83),P=n(75),L=n(76),R=n(84),I=n(19),A=n(114),N=n(115),D=n(91),F=n(63),B=n(51).forEach,M=P("hidden"),V=I("toPrimitive"),H=F.set,z=F.getterFor("Symbol"),$=Object.prototype,q=r.Symbol,U=o("JSON","stringify"),W=C.f,G=S.f,Y=k.f,J=E.f,K=j("symbols"),Z=j("op-symbols"),X=j("string-to-symbol-registry"),Q=j("symbol-to-string-registry"),tt=j("wks"),et=r.QObject,nt=!et||!et.prototype||!et.prototype.findChild,it=s&&u((function(){return 7!=v(G({},"a",{get:function(){return G(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=W($,e);i&&delete $[e],G(t,e,n),i&&t!==$&&G($,e,i)}:G,rt=function(t,e){var n=K[t]=v(q.prototype);return H(n,{type:"Symbol",tag:t,description:e}),s||(n.description=e),n},ot=c?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof q},at=function(t,e,n){t===$&&at(Z,e,n),f(t);var i=g(e,!0);return f(n),d(K,i)?(n.enumerable?(d(t,M)&&t[M][i]&&(t[M][i]=!1),n=v(n,{enumerable:b(0,!1)})):(d(t,M)||G(t,M,b(1,{})),t[M][i]=!0),it(t,i,n)):G(t,i,n)},st=function(t,e){f(t);var n=y(e),i=w(n).concat(dt(n));return B(i,(function(e){s&&!lt.call(n,e)||at(t,e,n[e])})),t},lt=function(t){var e=g(t,!0),n=J.call(this,e);return!(this===$&&d(K,e)&&!d(Z,e))&&(!(n||!d(this,e)||!d(K,e)||d(this,M)&&this[M][e])||n)},ct=function(t,e){var n=y(t),i=g(e,!0);if(n!==$||!d(K,i)||d(Z,i)){var r=W(n,i);return!r||!d(K,i)||d(n,M)&&n[M][i]||(r.enumerable=!0),r}},ut=function(t){var e=Y(y(t)),n=[];return B(e,(function(t){d(K,t)||d(L,t)||n.push(t)})),n},dt=function(t){var e=t===$,n=Y(e?Z:y(t)),i=[];return B(n,(function(t){!d(K,t)||e&&!d($,t)||i.push(K[t])})),i};l||(O((q=function(){if(this instanceof q)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=R(t),n=function(t){this===$&&n.call(Z,t),d(this,M)&&d(this[M],e)&&(this[M][e]=!1),it(this,e,b(1,t))};return s&&nt&&it($,e,{configurable:!0,set:n}),rt(e,t)}).prototype,"toString",(function(){return z(this).tag})),O(q,"withoutSetter",(function(t){return rt(R(t),t)})),E.f=lt,S.f=at,C.f=ct,_.f=k.f=ut,x.f=dt,A.f=function(t){return rt(I(t),t)},s&&(G(q.prototype,"description",{configurable:!0,get:function(){return z(this).description}}),a||O($,"propertyIsEnumerable",lt,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:q}),B(w(tt),(function(t){N(t)})),i({target:"Symbol",stat:!0,forced:!l},{for:function(t){var e=String(t);if(d(X,e))return X[e];var n=q(e);return X[e]=n,Q[n]=e,n},keyFor:function(t){if(!ot(t))throw TypeError(t+" is not a symbol");if(d(Q,t))return Q[t]},useSetter:function(){nt=!0},useSimple:function(){nt=!1}}),i({target:"Object",stat:!0,forced:!l,sham:!s},{create:function(t,e){return void 0===e?v(t):st(v(t),e)},defineProperty:at,defineProperties:st,getOwnPropertyDescriptor:ct}),i({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:ut,getOwnPropertySymbols:dt}),i({target:"Object",stat:!0,forced:u((function(){x.f(1)}))},{getOwnPropertySymbols:function(t){return x.f(m(t))}}),U&&i({target:"JSON",stat:!0,forced:!l||u((function(){var t=q();return"[null]"!=U([t])||"{}"!=U({a:t})||"{}"!=U(Object(t))}))},{stringify:function(t,e,n){for(var i,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(i=e,(h(e)||void 0!==t)&&!ot(t))return p(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!ot(e))return e}),r[1]=e,U.apply(null,r)}}),q.prototype[V]||T(q.prototype,V,q.prototype.valueOf),D(q,"Symbol"),L[M]=!0},function(t,e,n){var i=n(14),r=n(23),o=n(22),a=n(28),s=n(27),l=n(30).f,c=n(108),u=o.Symbol;if(r&&"function"==typeof u&&(!("description"in u.prototype)||void 0!==u().description)){var d={},p=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof p?new u(t):void 0===t?u():u(t);return""===t&&(d[e]=!0),e};c(p,u);var h=p.prototype=u.prototype;h.constructor=p;var f=h.toString,m="Symbol(test)"==String(u("test")),y=/^Symbol\((.*)\)[^)]+$/;l(h,"description",{configurable:!0,get:function(){var t=s(this)?this.valueOf():this,e=f.call(t);if(a(d,t))return"";var n=m?e.slice(7,-1):e.replace(y,"$1");return""===n?void 0:n}}),i({global:!0,forced:!0},{Symbol:p})}},function(t,e,n){n(115)("iterator")},function(t,e,n){var i=n(45),r=Date.prototype,o=r.toString,a=r.getTime;new Date(NaN)+""!="Invalid Date"&&i(r,"toString",(function(){var t=a.call(this);return t==t?o.call(this):"Invalid Date"}))},function(t,e,n){var i=n(95),r=n(45),o=n(152);i||r(Object.prototype,"toString",o,{unsafe:!0})},function(t,e,n){var i=n(45),r=n(29),o=n(17),a=n(97),s=RegExp.prototype,l=s.toString,c=o((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),u="toString"!=l.name;(c||u)&&i(RegExp.prototype,"toString",(function(){var t=r(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in s)?a.call(t):n)}),{unsafe:!0})},function(t,e,n){var i=n(125).charAt,r=n(63),o=n(121),a=r.set,s=r.getterFor("String Iterator");o(String,"String",(function(t){a(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=s(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=i(n,r),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){var i=n(22),r=n(126),o=n(0),a=n(40),s=n(19),l=s("iterator"),c=s("toStringTag"),u=o.values;for(var d in r){var p=i[d],h=p&&p.prototype;if(h){if(h[l]!==u)try{a(h,l,u)}catch(t){h[l]=u}if(h[c]||a(h,c,d),r[d])for(var f in o)if(h[f]!==o[f])try{a(h,f,o[f])}catch(t){h[f]=o[f]}}}},function(t,e,n){n(14)({target:"Object",stat:!0,sham:!n(23)},{create:n(55)})},function(t,e,n){var i=n(14),r=n(17),o=n(32),a=n(77),s=n(123);i({target:"Object",stat:!0,forced:r((function(){a(1)})),sham:!s},{getPrototypeOf:function(t){return a(o(t))}})},function(t,e,n){n(14)({target:"Object",stat:!0},{setPrototypeOf:n(96)})},function(t,e,n){var i=n(14),r=n(54),o=n(56),a=n(29),s=n(27),l=n(55),c=n(131),u=n(17),d=r("Reflect","construct"),p=u((function(){function t(){}return!(d((function(){}),[],t)instanceof t)})),h=!u((function(){d((function(){}))})),f=p||h;i({target:"Reflect",stat:!0,forced:f,sham:f},{construct:function(t,e){o(t),a(e);var n=arguments.length<3?t:o(arguments[2]);if(h&&!p)return d(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return i.push.apply(i,e),new(c.apply(t,i))}var r=n.prototype,u=l(s(r)?r:Object.prototype),f=Function.apply.call(t,u,e);return s(f)?f:u}})},function(t,e,n){var i=n(14),r=n(23);i({target:"Object",stat:!0,forced:!r,sham:!r},{defineProperty:n(30).f})},function(t,e,n){var i=n(22),r=n(47).f,o=n(40),a=n(45),s=n(82),l=n(108),c=n(89);t.exports=function(t,e){var n,u,d,p,h,f=t.target,m=t.global,y=t.stat;if(n=m?i:y?i[f]||s(f,{}):(i[f]||{}).prototype)for(u in e){if(p=e[u],d=t.noTargetGet?(h=r(n,u))&&h.value:n[u],!c(m?u:f+(y?".":"#")+u,t.forced)&&void 0!==d){if(typeof p==typeof d)continue;l(p,d)}(t.sham||d&&d.sham)&&o(p,"sham",!0),a(n,u,p,t)}}},function(t,e,n){var i=n(14),r=n(17),o=n(35),a=n(47).f,s=n(23),l=r((function(){a(1)}));i({target:"Object",stat:!0,forced:!s||l,sham:!s},{getOwnPropertyDescriptor:function(t,e){return a(o(t),e)}})},function(t,e,n){var i=n(14),r=n(27),o=n(29),a=n(28),s=n(47),l=n(77);i({target:"Reflect",stat:!0},{get:function t(e,n){var i,c,u=arguments.length<3?e:arguments[2];return o(e)===u?e[n]:(i=s.f(e,n))?a(i,"value")?i.value:void 0===i.get?void 0:i.get.call(u):r(c=l(e))?t(c,n,u):void 0}})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(14),r=n(17),o=n(66),a=n(27),s=n(32),l=n(36),c=n(68),u=n(92),d=n(69),p=n(19),h=n(117),f=p("isConcatSpreadable"),m=h>=51||!r((function(){var t=[];return t[f]=!1,t.concat()[0]!==t})),y=d("concat"),g=function(t){if(!a(t))return!1;var e=t[f];return void 0!==e?!!e:o(t)};i({target:"Array",proto:!0,forced:!m||!y},{concat:function(t){var e,n,i,r,o,a=s(this),d=u(a,0),p=0;for(e=-1,i=arguments.length;e9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n=9007199254740991)throw TypeError("Maximum allowed index exceeded");c(d,p++,o)}return d.length=p,d}})},function(t,e,n){var i=n(22),r=n(83),o=n(28),a=n(84),s=n(90),l=n(112),c=r("wks"),u=i.Symbol,d=l?u:u&&u.withoutSetter||a;t.exports=function(t){return o(c,t)||(s&&o(u,t)?c[t]=u[t]:c[t]=d("Symbol."+t)),c[t]}},function(t,e,n){var i=n(14),r=n(119);i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},function(t,e,n){var i=n(22),r=n(126),o=n(119),a=n(40);for(var s in r){var l=i[s],c=l&&l.prototype;if(c&&c.forEach!==o)try{a(c,"forEach",o)}catch(t){c.forEach=o}}},function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n(138))},function(t,e,n){var i=n(17);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,n){var i=n(14),r=n(78);i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},function(t,e,n){n(14)({target:"Array",stat:!0},{isArray:n(66)})},function(t,e,n){var i=n(14),r=n(85).includes,o=n(94);i({target:"Array",proto:!0,forced:!n(37)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(27);t.exports=function(t){if(!i(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var i=n(23),r=n(104),o=n(29),a=n(62),s=Object.defineProperty;e.f=i?s:function(t,e,n){if(o(t),e=a(e,!0),o(n),r)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(14),r=n(27),o=n(66),a=n(86),s=n(36),l=n(35),c=n(68),u=n(19),d=n(69),p=n(37),h=d("slice"),f=p("slice",{ACCESSORS:!0,0:0,1:2}),m=u("species"),y=[].slice,g=Math.max;i({target:"Array",proto:!0,forced:!h||!f},{slice:function(t,e){var n,i,u,d=l(this),p=s(d.length),h=a(t,p),f=a(void 0===e?p:e,p);if(o(d)&&("function"!=typeof(n=d.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[m])&&(n=void 0):n=void 0,n===Array||void 0===n))return y.call(d,h,f);for(i=new(void 0===n?Array:n)(g(f-h,0)),u=0;h1?arguments[1]:void 0)}})},function(t,e,n){var i=n(61),r=n(39);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(50),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e,n){var i=n(23),r=n(17),o=n(28),a=Object.defineProperty,s={},l=function(t){throw t};t.exports=function(t,e){if(o(s,t))return s[t];e||(e={});var n=[][t],c=!!o(e,"ACCESSORS")&&e.ACCESSORS,u=o(e,0)?e[0]:l,d=o(e,1)?e[1]:void 0;return s[t]=!!n&&!r((function(){if(c&&!i)return!0;var t={length:-1};c?a(t,1,{enumerable:!0,get:l}):t[1]=1,n.call(t,u,d)}))}},function(t,e,n){var i=n(14),r=n(142);i({target:"Array",stat:!0,forced:!n(146)((function(t){Array.from(t)}))},{from:r})},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(23),r=n(30),o=n(60);t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(14),r=n(149).left,o=n(52),a=n(37),s=o("reduce"),l=a("reduce",{1:0});i({target:"Array",proto:!0,forced:!s||!l},{reduce:function(t){return r(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var i=n(14),r=n(32),o=n(67);i({target:"Object",stat:!0,forced:n(17)((function(){o(1)}))},{keys:function(t){return o(r(t))}})},function(t,e,n){var i=n(99),r=n(29),o=n(32),a=n(36),s=n(50),l=n(39),c=n(100),u=n(101),d=Math.max,p=Math.min,h=Math.floor,f=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g;i("replace",2,(function(t,e,n,i){var y=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,g=i.REPLACE_KEEPS_$0,b=y?"$":"$0";return[function(n,i){var r=l(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r,i):e.call(String(r),n,i)},function(t,i){if(!y&&g||"string"==typeof i&&-1===i.indexOf(b)){var o=n(e,t,this,i);if(o.done)return o.value}var l=r(t),h=String(this),f="function"==typeof i;f||(i=String(i));var m=l.global;if(m){var w=l.unicode;l.lastIndex=0}for(var _=[];;){var k=u(l,h);if(null===k)break;if(_.push(k),!m)break;""===String(k[0])&&(l.lastIndex=c(h,a(l.lastIndex),w))}for(var x,C="",S=0,E=0;E<_.length;E++){k=_[E];for(var T=String(k[0]),O=d(p(s(k.index),h.length),0),j=[],P=1;P=S&&(C+=h.slice(S,O)+I,S=O+T.length)}return C+h.slice(S)}];function v(t,n,i,r,a,s){var l=i+t.length,c=r.length,u=m;return void 0!==a&&(a=o(a),u=f),e.call(s,u,(function(e,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,i);case"'":return n.slice(l);case"<":s=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return e;if(u>c){var d=h(u/10);return 0===d?e:d<=c?void 0===r[d-1]?o.charAt(1):r[d-1]+o.charAt(1):e}s=r[u-1]}return void 0===s?"":s}))}}))},function(t,e,n){var i=n(14),r=n(51).map,o=n(69),a=n(37),s=o("map"),l=a("map");i({target:"Array",proto:!0,forced:!s||!l},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var i=n(22),r=n(40),o=n(28),a=n(82),s=n(106),l=n(63),c=l.get,u=l.enforce,d=String(String).split("String");(t.exports=function(t,e,n,s){var l=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||r(n,"name",e),u(n).source=d.join("string"==typeof e?e:"")),t!==i?(l?!p&&t[e]&&(c=!0):delete t[e],c?t[e]=n:r(t,e,n)):c?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},function(t,e,n){var i=n(99),r=n(29),o=n(36),a=n(39),s=n(100),l=n(101);i("match",1,(function(t,e,n){return[function(e){var n=a(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,n):new RegExp(e)[t](String(n))},function(t){var i=n(e,t,this);if(i.done)return i.value;var a=r(t),c=String(this);if(!a.global)return l(a,c);var u=a.unicode;a.lastIndex=0;for(var d,p=[],h=0;null!==(d=l(a,c));){var f=String(d[0]);p[h]=f,""===f&&(a.lastIndex=s(c,o(a.lastIndex),u)),h++}return 0===h?null:p}]}))},function(t,e,n){var i=n(23),r=n(74),o=n(60),a=n(35),s=n(62),l=n(28),c=n(104),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(t,e){if(t=a(t),e=s(e,!0),c)try{return u(t,e)}catch(t){}if(l(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e,n){var i=n(14),r=n(61),o=n(35),a=n(52),s=[].join,l=r!=Object,c=a("join",",");i({target:"Array",proto:!0,forced:l||!c},{join:function(t){return s.call(o(this),void 0===t?",":t)}})},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(116),r=n(61),o=n(32),a=n(36),s=n(92),l=[].push,c=function(t){var e=1==t,n=2==t,c=3==t,u=4==t,d=6==t,p=5==t||d;return function(h,f,m,y){for(var g,b,v=o(h),w=r(v),_=i(f,m,3),k=a(w.length),x=0,C=y||s,S=e?C(h,k):n?C(h,0):void 0;k>x;x++)if((p||x in w)&&(b=_(g=w[x],x,v),t))if(e)S[x]=b;else if(b)switch(t){case 3:return!0;case 5:return g;case 6:return x;case 2:l.call(S,g)}else if(u)return!1;return d?-1:c||u?u:S}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(t,e,n){var i=n(17);t.exports=function(t,e){var n=[][t];return!!n&&i((function(){n.call(null,e||function(){throw 1},1)}))}},function(t,e,n){var i=n(99),r=n(98),o=n(29),a=n(39),s=n(156),l=n(100),c=n(36),u=n(101),d=n(78),p=n(17),h=[].push,f=Math.min,m=!p((function(){return!RegExp(4294967295,"y")}));i("split",2,(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=String(a(this)),o=void 0===n?4294967295:n>>>0;if(0===o)return[];if(void 0===t)return[i];if(!r(t))return e.call(i,t,o);for(var s,l,c,u=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,m=new RegExp(t.source,p+"g");(s=d.call(m,i))&&!((l=m.lastIndex)>f&&(u.push(i.slice(f,s.index)),s.length>1&&s.index=o));)m.lastIndex===s.index&&m.lastIndex++;return f===i.length?!c&&m.test("")||u.push(""):u.push(i.slice(f)),u.length>o?u.slice(0,o):u}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var r=a(this),o=null==e?void 0:e[t];return void 0!==o?o.call(e,r,n):i.call(String(r),e,n)},function(t,r){var a=n(i,t,this,r,i!==e);if(a.done)return a.value;var d=o(t),p=String(this),h=s(d,RegExp),y=d.unicode,g=(d.ignoreCase?"i":"")+(d.multiline?"m":"")+(d.unicode?"u":"")+(m?"y":"g"),b=new h(m?d:"^(?:"+d.source+")",g),v=void 0===r?4294967295:r>>>0;if(0===v)return[];if(0===p.length)return null===u(b,p)?[p]:[];for(var w=0,_=0,k=[];_"+t+"<\/script>"},h=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;h=i?function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e}(i):((e=c("iframe")).style.display="none",l.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F);for(var n=a.length;n--;)delete h.prototype[a[n]];return h()};s[u]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(d.prototype=r(t),n=new d,d.prototype=null,n[u]=t):n=h(),void 0===e?n:o(n,e)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var i=n(14),r=n(124).values;i({target:"Object",stat:!0},{values:function(t){return r(t)}})},function(t,e,n){var i=n(14),r=n(124).entries;i({target:"Object",stat:!0},{entries:function(t){return r(t)}})},function(t,e,n){var i=n(23),r=n(22),o=n(89),a=n(127),s=n(30).f,l=n(65).f,c=n(98),u=n(97),d=n(128),p=n(45),h=n(17),f=n(63).set,m=n(153),y=n(19)("match"),g=r.RegExp,b=g.prototype,v=/a/g,w=/a/g,_=new g(v)!==v,k=d.UNSUPPORTED_Y;if(i&&o("RegExp",!_||k||h((function(){return w[y]=!1,g(v)!=v||g(w)==w||"/a/i"!=g(v,"i")})))){for(var x=function(t,e){var n,i=this instanceof x,r=c(t),o=void 0===e;if(!i&&r&&t.constructor===x&&o)return t;_?r&&!o&&(t=t.source):t instanceof x&&(o&&(e=u.call(t)),t=t.source),k&&(n=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var s=a(_?new g(t,e):g(t,e),i?this:b,x);return k&&n&&f(s,{sticky:n}),s},C=function(t){t in x||s(x,t,{configurable:!0,get:function(){return g[t]},set:function(e){g[t]=e}})},S=l(g),E=0;S.length>E;)C(S[E++]);b.constructor=x,x.prototype=b,p(r,"RegExp",x)}m("RegExp")},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(17),r=n(49),o="".split;t.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?o.call(t,""):Object(t)}:Object},function(t,e,n){var i=n(27);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var i,r,o,a=n(139),s=n(22),l=n(27),c=n(40),u=n(28),d=n(75),p=n(76),h=s.WeakMap;if(a){var f=new h,m=f.get,y=f.has,g=f.set;i=function(t,e){return g.call(f,t,e),e},r=function(t){return m.call(f,t)||{}},o=function(t){return y.call(f,t)}}else{var b=d("state");p[b]=!0,i=function(t,e){return c(t,b,e),e},r=function(t){return u(t,b)?t[b]:{}},o=function(t){return u(t,b)}}t.exports={set:i,get:r,has:o,enforce:function(t){return o(t)?r(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e){t.exports=!1},function(t,e,n){var i=n(111),r=n(87).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},function(t,e,n){var i=n(49);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){var i=n(111),r=n(87);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e,n){var i=n(62),r=n(30),o=n(60);t.exports=function(t,e,n){var a=i(e);a in t?r.f(t,a,o(0,n)):t[a]=n}},function(t,e,n){var i=n(17),r=n(19),o=n(117),a=r("species");t.exports=function(t){return o>=51||!i((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e){t.exports={}},function(t,e,n){var i=n(14),r=n(155);i({global:!0,forced:parseInt!=r},{parseInt:r})},function(t,e,n){var i=n(14),r=n(51).filter,o=n(69),a=n(37),s=o("filter"),l=a("filter");i({target:"Array",proto:!0,forced:!s||!l},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var i=n(14),r=n(85).indexOf,o=n(52),a=n(37),s=[].indexOf,l=!!s&&1/[1].indexOf(1,-0)<0,c=o("indexOf"),u=a("indexOf",{ACCESSORS:!0,1:0});i({target:"Array",proto:!0,forced:l||!c||!u},{indexOf:function(t){return l?s.apply(this,arguments)||0:r(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!i.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:i},function(t,e,n){var i=n(83),r=n(84),o=i("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},function(t,e){t.exports={}},function(t,e,n){var i=n(28),r=n(32),o=n(75),a=n(123),s=o("IE_PROTO"),l=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=r(t),i(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?l:null}},function(t,e,n){var i,r,o=n(97),a=n(128),s=RegExp.prototype.exec,l=String.prototype.replace,c=s,u=(i=/a/,r=/b*/g,s.call(i,"a"),s.call(r,"a"),0!==i.lastIndex||0!==r.lastIndex),d=a.UNSUPPORTED_Y||a.BROKEN_CARET,p=void 0!==/()??/.exec("")[1];(u||p||d)&&(c=function(t){var e,n,i,r,a=this,c=d&&a.sticky,h=o.call(a),f=a.source,m=0,y=t;return c&&(-1===(h=h.replace("y","")).indexOf("g")&&(h+="g"),y=String(t).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==t[a.lastIndex-1])&&(f="(?: "+f+")",y=" "+y,m++),n=new RegExp("^(?:"+f+")",h)),p&&(n=new RegExp("^"+f+"$(?!\\s)",h)),u&&(e=a.lastIndex),i=s.call(c?n:a,y),c?i?(i.input=i.input.slice(m),i[0]=i[0].slice(m),i.index=a.lastIndex,a.lastIndex+=i[0].length):a.lastIndex=0:u&&i&&(a.lastIndex=a.global?i.index+i[0].length:e),p&&i&&i.length>1&&l.call(i[0],n,(function(){for(r=1;r1?arguments[1]:void 0)}})},function(t,e,n){var i=n(39),r="["+n(81)+"]",o=RegExp("^"+r+r+"*"),a=RegExp(r+r+"*$"),s=function(t){return function(e){var n=String(i(e));return 1&t&&(n=n.replace(o,"")),2&t&&(n=n.replace(a,"")),n}};t.exports={start:s(1),end:s(2),trim:s(3)}},function(t,e){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(t,e,n){var i=n(22),r=n(40);t.exports=function(t,e){try{r(i,t,e)}catch(n){i[t]=e}return e}},function(t,e,n){var i=n(64),r=n(107);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+i).toString(36)}},function(t,e,n){var i=n(35),r=n(36),o=n(86),a=function(t){return function(e,n,a){var s,l=i(e),c=r(l.length),u=o(a,c);if(t&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e,n){var i=n(50),r=Math.max,o=Math.min;t.exports=function(t,e){var n=i(t);return n<0?r(n+e,0):o(n,e)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var i=n(17),r=/#|\.prototype\./,o=function(t,e){var n=s[a(t)];return n==c||n!=l&&("function"==typeof e?i(e):!!e)},a=o.normalize=function(t){return String(t).replace(r,".").toLowerCase()},s=o.data={},l=o.NATIVE="N",c=o.POLYFILL="P";t.exports=o},function(t,e,n){var i=n(17);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())}))},function(t,e,n){var i=n(30).f,r=n(28),o=n(19)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(27),r=n(66),o=n(19)("species");t.exports=function(t,e){var n;return r(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!r(n.prototype)?i(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},function(t,e,n){var i=n(14),r=n(51).find,o=n(94),a=n(37),s=!0,l=a("find");"find"in[]&&Array(1).find((function(){s=!1})),i({target:"Array",proto:!0,forced:s||!l},{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),o("find")},function(t,e,n){var i=n(19),r=n(55),o=n(30),a=i("unscopables"),s=Array.prototype;null==s[a]&&o.f(s,a,{configurable:!0,value:r(null)}),t.exports=function(t){s[a][t]=!0}},function(t,e,n){var i={};i[n(19)("toStringTag")]="z",t.exports="[object z]"===String(i)},function(t,e,n){var i=n(29),r=n(148);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,o){return i(n),r(o),e?t.call(n,o):n.__proto__=o,n}}():void 0)},function(t,e,n){var i=n(29);t.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){var i=n(27),r=n(49),o=n(19)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==r(t))}},function(t,e,n){n(24);var i=n(45),r=n(17),o=n(19),a=n(78),s=n(40),l=o("species"),c=!r((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),u="$0"==="a".replace(/./,"$0"),d=o("replace"),p=!!/./[d]&&""===/./[d]("a","$0"),h=!r((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,d){var f=o(t),m=!r((function(){var e={};return e[f]=function(){return 7},7!=""[t](e)})),y=m&&!r((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[l]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return e=!0,null},n[f](""),!e}));if(!m||!y||"replace"===t&&(!c||!u||p)||"split"===t&&!h){var g=/./[f],b=n(f,""[t],(function(t,e,n,i,r){return e.exec===a?m&&!r?{done:!0,value:g.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}}),{REPLACE_KEEPS_$0:u,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),v=b[0],w=b[1];i(String.prototype,t,v),i(RegExp.prototype,f,2==e?function(t,e){return w.call(t,this,e)}:function(t){return w.call(t,this)})}d&&s(RegExp.prototype[f],"sham",!0)}},function(t,e,n){var i=n(125).charAt;t.exports=function(t,e,n){return e+(n?i(t,e).length:1)}},function(t,e,n){var i=n(49),r=n(78);t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==i(t))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(t,e)}},function(t,e,n){var i=n(14),r=n(157);i({global:!0,forced:parseFloat!=r},{parseFloat:r})},function(t,e,n){var i,r=n(14),o=n(47).f,a=n(36),s=n(129),l=n(39),c=n(130),u=n(64),d="".startsWith,p=Math.min,h=c("startsWith");r({target:"String",proto:!0,forced:!(!u&&!h&&(i=o(String.prototype,"startsWith"),i&&!i.writable)||h)},{startsWith:function(t){var e=String(l(this));s(t);var n=a(p(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return d?d.call(e,i,n):e.slice(n,n+i.length)===i}})},function(t,e,n){var i=n(23),r=n(17),o=n(105);t.exports=!i&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var i=n(22),r=n(27),o=i.document,a=r(o)&&r(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e,n){var i=n(107),r=Function.toString;"function"!=typeof i.inspectSource&&(i.inspectSource=function(t){return r.call(t)}),t.exports=i.inspectSource},function(t,e,n){var i=n(22),r=n(82),o=i["__core-js_shared__"]||r("__core-js_shared__",{});t.exports=o},function(t,e,n){var i=n(28),r=n(109),o=n(47),a=n(30);t.exports=function(t,e){for(var n=r(e),s=a.f,l=o.f,c=0;cl;)i(s,n=e[l++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var i=n(90);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var i=n(23),r=n(30),o=n(29),a=n(67);t.exports=i?Object.defineProperties:function(t,e){o(t);for(var n,i=a(e),s=i.length,l=0;s>l;)r.f(t,n=i[l++],e[n]);return t}},function(t,e,n){var i=n(19);e.f=i},function(t,e,n){var i=n(110),r=n(28),o=n(114),a=n(30).f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});r(e,t)||a(e,t,{value:o.f(t)})}},function(t,e,n){var i=n(56);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var i,r,o=n(22),a=n(118),s=o.process,l=s&&s.versions,c=l&&l.v8;c?r=(i=c.split("."))[0]+i[1]:a&&(!(i=a.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/))&&(r=i[1]),t.exports=r&&+r},function(t,e,n){var i=n(54);t.exports=i("navigator","userAgent")||""},function(t,e,n){var i=n(51).forEach,r=n(52),o=n(37),a=r("forEach"),s=o("forEach");t.exports=a&&s?[].forEach:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}},function(t,e,n){var i=n(95),r=n(49),o=n(19)("toStringTag"),a="Arguments"==r(function(){return arguments}());t.exports=i?r:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:a?r(e):"Object"==(i=r(e))&&"function"==typeof e.callee?"Arguments":i}},function(t,e,n){var i=n(14),r=n(147),o=n(77),a=n(96),s=n(91),l=n(40),c=n(45),u=n(19),d=n(64),p=n(70),h=n(122),f=h.IteratorPrototype,m=h.BUGGY_SAFARI_ITERATORS,y=u("iterator"),g=function(){return this};t.exports=function(t,e,n,u,h,b,v){r(n,e,u);var w,_,k,x=function(t){if(t===h&&O)return O;if(!m&&t in E)return E[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},C=e+" Iterator",S=!1,E=t.prototype,T=E[y]||E["@@iterator"]||h&&E[h],O=!m&&T||x(h),j="Array"==e&&E.entries||T;if(j&&(w=o(j.call(new t)),f!==Object.prototype&&w.next&&(d||o(w)===f||(a?a(w,f):"function"!=typeof w[y]&&l(w,y,g)),s(w,C,!0,!0),d&&(p[C]=g))),"values"==h&&T&&"values"!==T.name&&(S=!0,O=function(){return T.call(this)}),d&&!v||E[y]===O||l(E,y,O),p[e]=O,h)if(_={values:x("values"),keys:b?O:x("keys"),entries:x("entries")},v)for(k in _)(m||S||!(k in E))&&c(E,k,_[k]);else i({target:e,proto:!0,forced:m||S},_);return _}},function(t,e,n){var i,r,o,a=n(77),s=n(40),l=n(28),c=n(19),u=n(64),d=c("iterator"),p=!1;[].keys&&("next"in(o=[].keys())?(r=a(a(o)))!==Object.prototype&&(i=r):p=!0),null==i&&(i={}),u||l(i,d)||s(i,d,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:p}},function(t,e,n){var i=n(17);t.exports=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,n){var i=n(23),r=n(67),o=n(35),a=n(74).f,s=function(t){return function(e){for(var n,s=o(e),l=r(s),c=l.length,u=0,d=[];c>u;)n=l[u++],i&&!a.call(s,n)||d.push(t?[n,s[n]]:s[n]);return d}};t.exports={entries:s(!0),values:s(!1)}},function(t,e,n){var i=n(50),r=n(39),o=function(t){return function(e,n){var o,a,s=String(r(e)),l=i(n),c=s.length;return l<0||l>=c?t?"":void 0:(o=s.charCodeAt(l))<55296||o>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):o:t?s.slice(l,l+2):a-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){var i=n(27),r=n(96);t.exports=function(t,e,n){var o,a;return r&&"function"==typeof(o=e.constructor)&&o!==n&&i(a=o.prototype)&&a!==n.prototype&&r(t,a),t}},function(t,e,n){var i=n(17);function r(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=i((function(){var t=r("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=i((function(){var t=r("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},function(t,e,n){var i=n(98);t.exports=function(t){if(i(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var i=n(19)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[i]=!1,"/./"[t](e)}catch(t){}}return!1}},function(t,e,n){var i=n(56),r=n(27),o=[].slice,a={},s=function(t,e,n){if(!(e in a)){for(var i=[],r=0;r9007199254740991)throw TypeError("Maximum allowed length exceeded");for(u=l(y,i),d=0;dg-i+n;d--)delete y[d-1]}else if(n>i)for(d=g-i;d>b;d--)h=d+n-1,(p=d+i-1)in y?y[h]=y[p]:delete y[h];for(d=0;d=0;)n+=p[e],p[e]=c(n/t),n=n%t*1e7},g=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==p[t]){var n=String(p[t]);e=""===e?n:e+a.call("0",7-n.length)+n}return e};if(d<0||d>20)throw RangeError("Incorrect fraction digits");if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(h="-",l=-l),l>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(l*u(2,69,1))-69)<0?l*u(2,-e,1):l/u(2,e,1),n*=4503599627370496,(e=52-e)>0){for(m(0,n),i=d;i>=7;)m(1e7,0),i-=7;for(m(u(10,i,1),0),i=e-1;i>=23;)y(1<<23),i-=23;y(1<0?h+((s=f.length)<=d?"0."+a.call("0",d-s)+f:f.slice(0,s-d)+"."+f.slice(s-d)):h+f}})},function(t,e,n){var i=n(23),r=n(22),o=n(89),a=n(45),s=n(28),l=n(49),c=n(127),u=n(62),d=n(17),p=n(55),h=n(65).f,f=n(47).f,m=n(30).f,y=n(80).trim,g=r.Number,b=g.prototype,v="Number"==l(p(b)),w=function(t){var e,n,i,r,o,a,s,l,c=u(t,!1);if("string"==typeof c&&c.length>2)if(43===(e=(c=y(c)).charCodeAt(0))||45===e){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===e){switch(c.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+c}for(a=(o=c.slice(2)).length,s=0;sr)return NaN;return parseInt(o,i)}return+c};if(o("Number",!g(" 0o1")||!g("0b1")||g("+0x1"))){for(var _,k=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof k&&(v?d((function(){b.valueOf.call(n)})):"Number"!=l(n))?c(new g(w(e)),n,k):w(e)},x=i?h(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),C=0;x.length>C;C++)s(g,_=x[C])&&!s(k,_)&&m(k,_,f(g,_));k.prototype=b,b.constructor=k,a(r,"Number",k)}},function(t,e){},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var i=n(22),r=n(106),o=i.WeakMap;t.exports="function"==typeof o&&/native code/.test(r(o))},function(t,e,n){var i=n(54);t.exports=i("document","documentElement")},function(t,e,n){var i=n(35),r=n(65).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return r(t)}catch(t){return a.slice()}}(t):r(i(t))}},function(t,e,n){var i=n(116),r=n(32),o=n(143),a=n(144),s=n(36),l=n(68),c=n(145);t.exports=function(t){var e,n,u,d,p,h,f=r(t),m="function"==typeof this?this:Array,y=arguments.length,g=y>1?arguments[1]:void 0,b=void 0!==g,v=c(f),w=0;if(b&&(g=i(g,y>2?arguments[2]:void 0,2)),null==v||m==Array&&a(v))for(n=new m(e=s(f.length));e>w;w++)h=b?g(f[w],w):f[w],l(n,w,h);else for(p=(d=v.call(f)).next,n=new m;!(u=p.call(d)).done;w++)h=b?o(d,g,[u.value,w],!0):u.value,l(n,w,h);return n.length=w,n}},function(t,e,n){var i=n(29);t.exports=function(t,e,n,r){try{return r?e(i(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&i(o.call(t)),e}}},function(t,e,n){var i=n(19),r=n(70),o=i("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[o]===t)}},function(t,e,n){var i=n(120),r=n(70),o=n(19)("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||r[i(t)]}},function(t,e,n){var i=n(19)("iterator"),r=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){r=!0}};a[i]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var o={};o[i]=function(){return{next:function(){return{done:n=!0}}}},t(o)}catch(t){}return n}},function(t,e,n){var i=n(122).IteratorPrototype,r=n(55),o=n(60),a=n(91),s=n(70),l=function(){return this};t.exports=function(t,e,n){var c=e+" Iterator";return t.prototype=r(i,{next:o(1,n)}),a(t,c,!1,!0),s[c]=l,t}},function(t,e,n){var i=n(27);t.exports=function(t){if(!i(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,n){var i=n(56),r=n(32),o=n(61),a=n(36),s=function(t){return function(e,n,s,l){i(n);var c=r(e),u=o(c),d=a(c.length),p=t?d-1:0,h=t?-1:1;if(s<2)for(;;){if(p in u){l=u[p],p+=h;break}if(p+=h,t?p<0:d<=p)throw TypeError("Reduce of empty array with no initial value")}for(;t?p>=0:d>p;p+=h)p in u&&(l=n(l,u[p],p,c));return l}};t.exports={left:s(!1),right:s(!0)}},function(t,e,n){var i=n(14),r=n(151);i({target:"Object",stat:!0,forced:Object.assign!==r},{assign:r})},function(t,e,n){var i=n(23),r=n(17),o=n(67),a=n(88),s=n(74),l=n(32),c=n(61),u=Object.assign,d=Object.defineProperty;t.exports=!u||r((function(){if(i&&1!==u({b:1},u(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol();return t[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=u({},t)[n]||"abcdefghijklmnopqrst"!=o(u({},e)).join("")}))?function(t,e){for(var n=l(t),r=arguments.length,u=1,d=a.f,p=s.f;r>u;)for(var h,f=c(arguments[u++]),m=d?o(f).concat(d(f)):o(f),y=m.length,g=0;y>g;)h=m[g++],i&&!p.call(f,h)||(n[h]=f[h]);return n}:u},function(t,e,n){var i=n(95),r=n(120);t.exports=i?{}.toString:function(){return"[object "+r(this)+"]"}},function(t,e,n){var i=n(54),r=n(30),o=n(19),a=n(23),s=o("species");t.exports=function(t){var e=i(t),n=r.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var i=n(14),r=n(51).every,o=n(52),a=n(37),s=o("every"),l=a("every");i({target:"Array",proto:!0,forced:!s||!l},{every:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var i=n(22),r=n(80).trim,o=n(81),a=i.parseInt,s=/^[+-]?0[Xx]/,l=8!==a(o+"08")||22!==a(o+"0x16");t.exports=l?function(t,e){var n=r(String(t));return a(n,e>>>0||(s.test(n)?16:10))}:a},function(t,e,n){var i=n(29),r=n(56),o=n(19)("species");t.exports=function(t,e){var n,a=i(t).constructor;return void 0===a||null==(n=i(a)[o])?e:r(n)}},function(t,e,n){var i=n(22),r=n(80).trim,o=n(81),a=i.parseFloat,s=1/a(o+"-0")!=-1/0;t.exports=s?function(t){var e=r(String(t)),n=a(e);return 0===n&&"-"==e.charAt(0)?-0:n}:a},function(t,e,n){var i=n(14),r=n(23);i({target:"Object",stat:!0,forced:!r,sham:!r},{defineProperties:n(113)})},function(t,e,n){var i=n(14),r=n(23),o=n(109),a=n(35),s=n(47),l=n(68);i({target:"Object",stat:!0,sham:!r},{getOwnPropertyDescriptors:function(t){for(var e,n,i=a(t),r=s.f,c=o(i),u={},d=0;c.length>d;)void 0!==(n=r(i,e=c[d++]))&&l(u,e,n);return u}})},function(t,e,n){var i=n(14),r=n(22),o=n(118),a=[].slice,s=function(t){return function(e,n){var i=arguments.length>2,r=i?a.call(arguments,2):void 0;return t(i?function(){("function"==typeof e?e:Function(e)).apply(this,r)}:e,n)}};i({global:!0,bind:!0,forced:/MSIE .\./.test(o)},{setTimeout:s(r.setTimeout),setInterval:s(r.setInterval)})},function(t,e,n){var i=n(49);t.exports=function(t){if("number"!=typeof t&&"Number"!=i(t))throw TypeError("Incorrect invocation");return+t}},function(t,e,n){var i=n(50),r=n(39);t.exports="".repeat||function(t){var e=String(r(this)),n="",o=i(t);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){var i=n(14),r=n(80).trim;i({target:"String",proto:!0,forced:n(164)("trim")},{trim:function(){return r(this)}})},function(t,e,n){var i=n(17),r=n(81);t.exports=function(t){return i((function(){return!!r[t]()||"​…᠎"!="​…᠎"[t]()||r[t].name!==t}))}},function(t,e,n){n(14)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},function(t,e,n){n.r(e),n.d(e,"JSONEditor",(function(){return ss})),n(1),n(2),n(3),n(18),n(93),n(20),n(38),n(25),n(0),n(41),n(31),n(4),n(33),n(150),n(13),n(42),n(5),n(57),n(6),n(7),n(21),n(8),n(58),n(59),n(24),n(43),n(26);var i=["actionscript","batchfile","c","c++","cpp","coffee","csharp","css","dart","django","ejs","erlang","golang","groovy","handlebars","haskell","haxe","html","ini","jade","java","javascript","json","less","lisp","lua","makefile","matlab","mysql","objectivec","pascal","perl","pgsql","php","python","r","ruby","sass","scala","scss","smarty","sql","sqlserver","stylus","svg","twig","vbscript","xml","yaml"],r=[function(t){return"string"===t.type&&"color"===t.format&&"colorpicker"},function(t){return"string"===t.type&&["ip","ipv4","ipv6","hostname"].includes(t.format)&&"ip"},function(t){return"string"===t.type&&i.includes(t.format)&&"ace"},function(t){return"string"===t.type&&["xhtml","bbcode"].includes(t.format)&&"sceditor"},function(t){return"string"===t.type&&"markdown"===t.format&&"simplemde"},function(t){return"string"===t.type&&"jodit"===t.format&&"jodit"},function(t){return"string"===t.type&&"autocomplete"===t.format&&"autocomplete"},function(t){return"string"===t.type&&"uuid"===t.format&&"uuid"},function(t){return"info"===t.format&&"info"},function(t){return"button"===t.format&&"button"},function(t){if(("integer"===t.type||"number"===t.type)&&"stepper"===t.format)return"stepper"},function(t){if(t.links)for(var e=0;et.length)&&(e=t.length);for(var n=0,i=new Array(e);n255)throw new Error("error_ipv4")}))}(e);break;case"ipv6":!function(t){if(!t.match("^(?:(?:(?:[a-fA-F0-9]{1,4}:){6}|(?=(?:[a-fA-F0-9]{0,4}:){2,6}(?:[0-9]{1,3}.){3}[0-9]{1,3}$)(([0-9a-fA-F]{1,4}:){1,5}|:)((:[0-9a-fA-F]{1,4}){1,5}:|:)|::(?:[a-fA-F0-9]{1,4}:){5})(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]).){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])|(?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}|(?=(?:[a-fA-F0-9]{0,4}:){0,7}[a-fA-F0-9]{0,4}$)(([0-9a-fA-F]{1,4}:){1,7}|:)((:[0-9a-fA-F]{1,4}){1,7}|:)|(?:[a-fA-F0-9]{1,4}:){7}:|:(:[a-fA-F0-9]{1,4}){7})$"))throw new Error("error_ipv6")}(e);break;case"hostname":!function(t){if(!t.match("(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9].)+[a-zA-Z]{2,63}$)"))throw new Error("error_hostname")}(e)}return[]}catch(t){return[{path:n,property:"format",message:i(t.message)}]}}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t){return!(null===t||"object"!==u(t)||t.nodeType||t===t.window||t.constructor&&!y(t.constructor.prototype,"isPrototypeOf"))}function p(t){return d(t)?h({},t):Array.isArray(t)?t.map(p):t}function h(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;it.length)&&(e=t.length);for(var n=0,i=new Array(e);nt.minimum:e>=t.minimum;return window.math?i=window.math[t.exclusiveMinimum?"larger":"largerEq"](window.math.bignumber(e),window.math.bignumber(t.minimum)):window.Decimal&&(i=new window.Decimal(e)[t.exclusiveMinimum?"gt":"gte"](new window.Decimal(t.minimum))),i?[]:[{path:n,property:"minimum",message:this.translate(t.exclusiveMinimum?"error_minimum_excl":"error_minimum_incl",[t.minimum])}]}},this._validateStringSubSchema={maxLength:function(t,e,n){var i=[];return"".concat(e).length>t.maxLength&&i.push({path:n,property:"maxLength",message:this.translate("error_maxLength",[t.maxLength])}),i},minLength:function(t,e,n){return"".concat(e).lengtht.maxItems?[{path:n,property:"maxItems",message:this.translate("error_maxItems",[t.maxItems])}]:[]},minItems:function(t,e,n){return e.lengtht.maxProperties?[{path:n,property:"maxProperties",message:this.translate("error_maxProperties",[t.maxProperties])}]:[]},minProperties:function(t,e,n){return Object.keys(e).lengthl){i="error_property_names_exceeds_maxlength";break}return!0;case"const":if(l!==s){i="error_property_names_const_mismatch";break}return!0;case"enum":if(!Array.isArray(l)){i="error_property_names_enum";break}if(l.forEach((function(t){t===s&&(c=!0)})),!c){i="error_property_names_enum_mismatch";break}return!0;case"pattern":if("string"!=typeof l){i="error_property_names_pattern";break}if(!new RegExp(l).test(s)){i="error_property_names_pattern_mismatch";break}return!0;default:return o.push({path:n,property:"propertyNames",message:r.translate("error_property_names_unsupported",[a])}),!1}return o.push({path:n,property:"propertyNames",message:r.translate(i,[s])}),!1}))?void 0:"break"};t:for(var c=0;c2&&void 0!==arguments[2]?arguments[2]:1e7,i={match:0,extra:0};if("object"===x(t)&&null!==t){var r=this._getSchema(e).properties;for(var o in r)if(y(r,o)){if("object"===x(t[o])&&"object"===x(r[o])&&"object"===x(r[o].properties)){var a=this.fitTest(t[o],r[o],n/100);i.match+=a.match,i.extra+=a.extra}void 0!==t[o]&&(i.match+=n)}else i.extra+=n}return i}},{key:"_getSchema",value:function(t){return void 0===t?h({},this.jsoneditor.expandRefs(this.schema)):t}},{key:"validate",value:function(t){return this._validateSchema(this.schema,t)}},{key:"_validateSchema",value:function(t,e,n){var i=this,r=[];return n=n||this.jsoneditor.root.formname,t=h({},this.jsoneditor.expandRefs(t)),void 0===e?this._validateV3Required(t,e,n):(Object.keys(t).forEach((function(o){i._validateSubSchema[o]&&r.push.apply(r,w(i._validateSubSchema[o].call(i,t,e,n)))})),r.push.apply(r,w(this._validateByValueType(t,e,n))),t.links&&t.links.forEach((function(o,a){o.rel&&"describedby"===o.rel.toLowerCase()&&(t=i._expandSchemaLink(t,a),r.push.apply(r,w(i._validateSchema(t,e,n,i.translate))))})),["date","time","datetime-local"].includes(t.format)&&r.push.apply(r,w(this._validateDateTimeSubSchema(t,e,n))),["uuid"].includes(t.format)&&r.push.apply(r,w(this._validateUUIDSchema(t,e,n))),r.push.apply(r,w(this._validateCustomValidator(t,e,n))),this._removeDuplicateErrors(r))}},{key:"_expandSchemaLink",value:function(t,e){var n=t.links[e].href,i=this.jsoneditor.root.getValue(),r=this.jsoneditor.compileTemplate(n,this.jsoneditor.template),o=document.location.origin+document.location.pathname+r(i);return t.links=t.links.slice(0,e).concat(t.links.slice(e+1)),h({},t,this.jsoneditor.refs[o])}},{key:"_validateV3Required",value:function(t,e,n){return(void 0!==t.required&&!0===t.required||void 0===t.required&&!0===this.jsoneditor.options.required_by_default)&&"info"!==t.type?[{path:n,property:"required",message:this.translate("error_notset")}]:[]}},{key:"_validateByValueType",value:function(t,e,n){var i=this,r=[];if(null===e)return r;if("number"==typeof e)Object.keys(t).forEach((function(o){i._validateNumberSubSchema[o]&&r.push.apply(r,w(i._validateNumberSubSchema[o].call(i,t,e,n)))}));else if("string"==typeof e)Object.keys(t).forEach((function(o){i._validateStringSubSchema[o]&&r.push.apply(r,w(i._validateStringSubSchema[o].call(i,t,e,n)))}));else if(Array.isArray(e))Object.keys(t).forEach((function(o){i._validateArraySubSchema[o]&&r.push.apply(r,w(i._validateArraySubSchema[o].call(i,t,e,n)))}));else if("object"===x(e)){var o={};Object.keys(t).forEach((function(a){i._validateObjectSubSchema[a]&&r.push.apply(r,w(i._validateObjectSubSchema[a].call(i,t,e,n,o)))})),void 0!==t.additionalProperties||!this.jsoneditor.options.no_additional_properties||t.oneOf||t.anyOf||t.allOf||(t.additionalProperties=!1),Object.keys(t).forEach((function(a){void 0!==i._validateObjectSubSchema2[a]&&r.push.apply(r,w(i._validateObjectSubSchema2[a].call(i,t,e,n,o)))}))}return r}},{key:"_validateUUIDSchema",value:function(t,e,n){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?[]:[{path:n,property:"format",message:this.translate("error_pattern",["^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"])}]}},{key:"_validateNumberSubSchemaMultipleDivisible",value:function(t,e,n){var i=t.multipleOf||t.divisibleBy,r=e/i===Math.floor(e/i);return window.math?r=window.math.mod(window.math.bignumber(e),window.math.bignumber(i)).equals(0):window.Decimal&&(r=new window.Decimal(e).mod(new window.Decimal(i)).equals(0)),r?[]:[{path:n,property:t.multipleOf?"multipleOf":"divisibleBy",message:this.translate("error_multipleOf",[i])}]}},{key:"_validateDateTimeSubSchema",value:function(t,e,n){var i=this,r=this.jsoneditor.getEditor(n),o=r&&r.flatpickr?r.flatpickr.config.dateFormat:{date:'"YYYY-MM-DD"',time:'"HH:MM"',"datetime-local":'"YYYY-MM-DD HH:MM"'}[t.format];if("integer"===t.type)return function(t,e,n){return 1*e<1?[{path:n,property:"format",message:i.translate("error_invalid_epoch")}]:e!==Math.abs(parseInt(e))?[{path:n,property:"format",message:i.translate("error_".concat(t.format.replace(/-/g,"_")),[o])}]:[]}(t,e,n);if(r&&r.flatpickr){if(r)return function(t,e,n,r){if(""!==e){var o;if("single"!==r.flatpickr.config.mode){var a="range"===r.flatpickr.config.mode?r.flatpickr.l10n.rangeSeparator:", ";o=r.flatpickr.selectedDates.map((function(t){return r.flatpickr.formatDate(t,r.flatpickr.config.dateFormat)})).join(a)}try{if(o){if(o!==e)throw new Error("".concat(r.flatpickr.config.mode," mismatch"))}else if(r.flatpickr.formatDate(r.flatpickr.parseDate(e,r.flatpickr.config.dateFormat),r.flatpickr.config.dateFormat)!==e)throw new Error("mismatch")}catch(t){var s=void 0!==r.flatpickr.config.errorDateFormat?r.flatpickr.config.errorDateFormat:r.flatpickr.config.dateFormat;return[{path:n,property:"format",message:i.translate("error_".concat(r.format.replace(/-/g,"_")),[s])}]}}return[]}(0,e,n,r)}else if(!{date:/^(\d{4}\D\d{2}\D\d{2})?$/,time:/^(\d{2}:\d{2}(?::\d{2})?)?$/,"datetime-local":/^(\d{4}\D\d{2}\D\d{2}[ T]\d{2}:\d{2}(?::\d{2})?)?$/}[t.format].test(e))return[{path:n,property:"format",message:this.translate("error_".concat(t.format.replace(/-/g,"_")),[o])}];return[]}},{key:"_validateCustomValidator",value:function(t,e,n){var i=this,r=[];r.push.apply(r,w(c.call(this,t,e,n,this.translate)));var o=function(o){r.push.apply(r,w(o.call(i,t,e,n)))};return this.defaults.custom_validators.forEach(o),this.options.custom_validators&&this.options.custom_validators.forEach(o),r}},{key:"_removeDuplicateErrors",value:function(t){return t.reduce((function(t,e){var n=!0;return t||(t=[]),t.forEach((function(t){t.message===e.message&&t.path===e.path&&t.property===e.property&&(t.errorcount++,n=!1)})),n&&(e.errorcount=1,t.push(e)),t}),[])}},{key:"_checkType",value:function(t,e){var n={string:function(t){return"string"==typeof t},number:function(t){return"number"==typeof t},integer:function(t){return"number"==typeof t&&t===Math.floor(t)},boolean:function(t){return"boolean"==typeof t},array:function(t){return Array.isArray(t)},object:function(t){return null!==t&&!Array.isArray(t)&&"object"===x(t)},null:function(t){return null===t}};return"string"==typeof t?!n[t]||n[t](e):!this._validateSchema(t,e).length}}])&&C(e.prototype,n),t}();function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&(n=n.substr(0,n.indexOf("#"))),n}},{key:"_isUniformResourceName",value:function(t){return"urn:"===t.substr(0,4)}},{key:"_loadExternalRefs",value:function(t,e,n,i){var r=this,o=this._getExternalRefs(t,n),a=!1,s=0;Object.keys(o).forEach((function(n){if(!r.refs[n])if(r._isUniformResourceName(n)){r.refs[n]="loading",s++;var o,l=r.options.urn_resolver,c=n;if("function"!=typeof l)throw console.log('No "urn_resolver" callback defined to resolve "'.concat(c,'"')),new Error("Must set urn_resolver option to a callback to resolve ".concat(c));c.indexOf("#")>0&&(c=c.substr(0,c.indexOf("#")));try{o=l(c,(function(i){try{t=JSON.parse(i)}catch(t){throw console.log(t),new Error("Failed to parse external ref ".concat(c))}if("boolean"!=typeof t&&"object"!==O(t)||null===t||Array.isArray(t))throw new Error("External ref does not contain a valid schema - ".concat(c));r.refs[n]=t,r._getDefinitions(t,"".concat(c,"#/definitions/")),r._loadExternalRefs(t,(function(){s--,a&&!s&&e()}),n,"/")}))}catch(t){throw console.log(t),new Error("Failed to parse external ref ".concat(c))}if("boolean"!=typeof o)throw new Error("External ref does not contain a valid schema - ".concat(c));if(!0!==o)throw new Error("External ref did not resolve - ".concat(c))}else{if(!r.options.ajax)throw new Error("Must set ajax option to true to load external ref ".concat(n));r.refs[n]="loading",s++;var u=r._joinUrl(n,i),d=new XMLHttpRequest;d.overrideMimeType("application/json"),d.open("GET",u,!0),r.options.ajaxCredentials&&(d.withCredentials=r.options.ajaxCredentials),d.onreadystatechange=function(){if(4===d.readyState){if(200!==d.status)throw console.log(d),new Error("Failed to fetch ref via ajax - ".concat(n));var t;try{t=JSON.parse(d.responseText)}catch(t){throw console.log(t),new Error("Failed to parse external ref ".concat(u))}if("boolean"!=typeof t&&"object"!==O(t)||null===t||Array.isArray(t))throw new Error("External ref does not contain a valid schema - ".concat(u));r.refs[n]=t;var i=r._getFileBaseFromFileLocation(u);if(u!==n){var o=u.split("/");u=("/"===n.substr(0,1)?"/":"")+o.pop()}r._getDefinitions(t,"".concat(u,"#/definitions/")),r._loadExternalRefs(t,(function(){s--,a&&!s&&e()}),u,i)}},d.send()}})),a=!0,s||e()}},{key:"extendSchemas",value:function(t,e){var n=this;t=h({},t),e=h({},e);var i={},r=function(t,r){!function(t,e){return("required"===t||"defaultProperties"===t)&&"object"===O(e)&&Array.isArray(e)}(t,r)?"type"!==t||"string"!=typeof r&&!Array.isArray(r)?"object"!==O(r)||Array.isArray(r)||null===r?i[t]=r:i[t]=n.extendSchemas(r,e[t]):o(r):i[t]=r.concat(e[t]).reduce((function(t,e){return t.includes(e)||t.push(e),t}),[])},o=function(t){"string"==typeof t&&(t=[t]),"string"==typeof e.type&&(e.type=[e.type]),e.type&&e.type.length?i.type=t.filter((function(t){return e.type.includes(t)})):i.type=t,1===i.type.length&&"string"==typeof i.type[0]?i.type=i.type[0]:0===i.type.length&&delete i.type};return Object.entries(t).forEach((function(t){var n=E(t,2),o=n[0],a=n[1];void 0!==e[o]?r(o,a):i[o]=a})),Object.entries(e).forEach((function(e){var n=E(e,2),r=n[0],o=n[1];void 0===t[r]&&(i[r]=o)})),i}}])&&j(e.prototype,n),t}();function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n0):this.dependenciesFulfilled&&(!r||0===r.length)):this.dependenciesFulfilled=!1}}},{key:"setContainer",value:function(t){this.container=t,this.schema.id&&this.container.setAttribute("data-schemaid",this.schema.id),this.schema.type&&"string"==typeof this.schema.type&&this.container.setAttribute("data-schematype",this.schema.type),this.container.setAttribute("data-schemapath",this.path)}},{key:"setOptInCheckbox",value:function(t){var e=this;this.optInCheckbox=document.createElement("input"),this.optInCheckbox.setAttribute("type","checkbox"),this.optInCheckbox.setAttribute("style","margin: 0 10px 0 0;"),this.optInCheckbox.classList.add("json-editor-opt-in"),this.optInCheckbox.addEventListener("click",(function(){e.isActive()?e.deactivate():e.activate()})),(this.jsoneditor.options.show_opt_in||this.options.show_opt_in)&&this.parent&&"object"===this.parent.schema.type&&!this.isRequired()&&this.header&&(this.header.appendChild(this.optInCheckbox),this.header.insertBefore(this.optInCheckbox,this.header.firstChild))}},{key:"preBuild",value:function(){}},{key:"build",value:function(){}},{key:"postBuild",value:function(){this.setupWatchListeners(),this.addLinks(),this.setValue(this.getDefault(),!0),this.updateHeaderText(),this.register(),this.onWatchedFieldChange()}},{key:"setupWatchListeners",value:function(){var t=this;if(this.watched={},this.schema.vars&&(this.schema.watch=this.schema.vars),this.watched_values={},this.watch_listener=function(){t.refreshWatchedFieldValues()&&t.onWatchedFieldChange()},y(this.schema,"watch")){var e,n,i,r,o,a=this.container.getAttribute("data-schemapath");Object.keys(this.schema.watch).forEach((function(s){if(e=t.schema.watch[s],Array.isArray(e)){if(e.length<2)return;n=[e[0]].concat(e[1].split("."))}else n=e.split("."),t.theme.closest(t.container,'[data-schemaid="'.concat(n[0],'"]'))||n.unshift("#");if("#"===(i=n.shift())&&(i=t.jsoneditor.schema.id||t.jsoneditor.root.formname),!(r=t.theme.closest(t.container,'[data-schemaid="'.concat(i,'"]'))))throw new Error("Could not find ancestor node with id ".concat(i));o="".concat(r.getAttribute("data-schemapath"),".").concat(n.join(".")),a.startsWith(o)&&(t.watchLoop=!0),t.jsoneditor.watch(o,t.watch_listener),t.watched[s]=o}))}this.schema.headerTemplate&&(this.header_template=this.jsoneditor.compileTemplate(this.schema.headerTemplate,this.template_engine))}},{key:"addLinks",value:function(){if(!this.no_link_holder&&(this.link_holder=this.theme.getLinksHolder(),void 0!==this.description?this.description.parentNode.insertBefore(this.link_holder,this.description):this.container.appendChild(this.link_holder),this.schema.links))for(var t=0;t3&&void 0!==arguments[3]?arguments[3]:[],r="json-editor-btn-".concat(e);e=this.iconlib?this.iconlib.getIcon(e):null,t=this.translate(t,i),n=this.translate(n,i),!e&&n&&(t=n,n=null);var o=this.theme.getButton(t,e,n);return o.classList.add(r),o}},{key:"setButtonText",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return n=this.iconlib?this.iconlib.getIcon(n):null,e=this.translate(e,r),i=this.translate(i,r),!n&&i&&(e=i,i=null),this.theme.setButtonText(t,e,n,i)}},{key:"addLink",value:function(t){this.link_holder&&this.link_holder.appendChild(t)}},{key:"getLink",value:function(t){var e,n,i=(t.mediaType||"application/javascript").split("/")[0],r=this.jsoneditor.compileTemplate(t.href,this.template_engine),o=this.jsoneditor.compileTemplate(t.rel?t.rel:t.href,this.template_engine),a=null;if(t.download&&(a=t.download),a&&!0!==a&&(a=this.jsoneditor.compileTemplate(a,this.template_engine)),"image"===i){e=this.theme.getBlockLinkHolder(),(n=document.createElement("a")).setAttribute("target","_blank");var s=document.createElement("img");this.theme.createImageLink(e,n,s),this.link_watchers.push((function(t){var e=r(t),i=o(t);n.setAttribute("href",e),n.setAttribute("title",i||e),s.setAttribute("src",e)}))}else if(["audio","video"].includes(i)){e=this.theme.getBlockLinkHolder(),(n=this.theme.getBlockLink()).setAttribute("target","_blank");var l=document.createElement(i);l.setAttribute("controls","controls"),this.theme.createMediaLink(e,n,l),this.link_watchers.push((function(t){var e=r(t),i=o(t);n.setAttribute("href",e),n.textContent=i||e,l.setAttribute("src",e)}))}else n=e=this.theme.getBlockLink(),e.setAttribute("target","_blank"),e.textContent=t.rel,e.style.display="none",this.link_watchers.push((function(t){var n=r(t),i=o(t);n&&(e.style.display=""),e.setAttribute("href",n),e.textContent=i||n}));return a&&n&&(!0===a?n.setAttribute("download",""):this.link_watchers.push((function(t){n.setAttribute("download",a(t))}))),t.class&&n.classList.add(t.class),e}},{key:"refreshWatchedFieldValues",value:function(){var t=this;if(this.watched_values){var e={},n=!1;return this.watched&&Object.keys(this.watched).forEach((function(i){var r=t.jsoneditor.getEditor(t.watched[i]),o=r?r.getValue():null;t.watched_values[i]!==o&&(n=!0),e[i]=o})),e.self=this.getValue(),this.watched_values.self!==e.self&&(n=!0),this.watched_values=e,n}}},{key:"getWatchedFieldValues",value:function(){return this.watched_values}},{key:"updateHeaderText",value:function(){if(this.header){var t=this.getHeaderText();if(this.header.children.length){for(var e=0;e1&&(e[r]="".concat(t," ").concat(i[t]))})),e}},{key:"getValidId",value:function(t){return(t=void 0===t?"":t.toString()).replace(/\s+/g,"-")}},{key:"setInputAttributes",value:function(t){var e=this;if(this.schema.options&&this.schema.options.inputAttributes){var n=this.schema.options.inputAttributes,i=["name","type"].concat(t);Object.keys(n).forEach((function(t){i.includes(t.toLowerCase())||e.input.setAttribute(t,n[t])}))}}},{key:"expandCallbacks",value:function(t,e){var n=this,i=this.defaults.callbacks[t];return Object.entries(e).forEach((function(r){var o=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return L(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r,2),a=o[0],s=o[1];s===Object(s)?e[a]=n.expandCallbacks(t,s):"string"==typeof s&&"object"===R(i)&&"function"==typeof i[s]&&(e[a]=i[s].bind(null,n))})),e}},{key:"showValidationErrors",value:function(t){}}])&&I(e.prototype,n),t}();function N(t){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){for(var n=0;n100);)e++,n++,t.style.height="".concat(n,"px");else{for(e=0;t.offsetHeight>=t.scrollHeight+3&&!(e>100);)e++,n--,t.style.height="".concat(n,"px");t.style.height="".concat(n+1,"px")}}},this.input.addEventListener("keyup",(function(e){t.adjust_height(e.currentTarget)})),this.input.addEventListener("change",(function(e){t.adjust_height(e.currentTarget)})),this.adjust_height()),this.format&&this.input.setAttribute("data-schemaformat",this.format);var r=this.input;if("range"===this.format&&(r=this.theme.getRangeControl(this.input,this.theme.getRangeOutput(this.input,this.schema.default||Math.max(this.schema.minimum||0,0)))),this.control=this.theme.getFormControl(this.label,r,this.description,this.infoButton),this.container.appendChild(this.control),window.requestAnimationFrame((function(){t.input.parentNode&&t.afterInputReady(),t.adjust_height&&t.adjust_height(t.input)})),this.schema.template){var o=this.expandCallbacks("template",{template:this.schema.template});"function"==typeof o.template?this.template=o.template:this.template=this.jsoneditor.compileTemplate(this.schema.template,this.template_engine),this.refreshValue()}else this.refreshValue()}},{key:"setupCleave",value:function(t){var e=this.expandCallbacks("cleave",h({},this.defaults.options.cleave||{},this.options.cleave||{}));"object"===N(e)&&Object.keys(e).length>0&&(this.cleave_instance=new window.Cleave(t,e))}},{key:"setupImask",value:function(t){var e=this.expandCallbacks("imask",h({},this.defaults.options.imask||{},this.options.imask||{}));"object"===N(e)&&Object.keys(e).length>0&&(this.imask_instance=window.IMask(t,this.ajustIMaskOptions(e)))}},{key:"ajustIMaskOptions",value:function(t){var e=this;return Object.keys(t).forEach((function(n){if(t[n]===Object(t[n]))t[n]=e.ajustIMaskOptions(t[n]);else if("mask"===n)if("regex:"===t[n].substr(0,6)){var i=t[n].match(/^regex:\/(.*)\/([gimsuy]*)$/);if(null!==i)try{t[n]=new RegExp(i[1],i[2])}catch(t){}}else t[n]=e.getGlobalPropertyFromString(t[n])})),t}},{key:"getGlobalPropertyFromString",value:function(t){if(t.includes(".")){var e=t.split("."),n=e[0],i=e[1];if(void 0!==window[n]&&void 0!==window[n][i])return window[n][i]}else if(void 0!==window[t])return window[t];return t}},{key:"shouldBeUnset",value:function(){return!this.jsoneditor.options.use_default_values&&!this.is_dirty}},{key:"getValue",value:function(){var t=!(!this.input||!this.input.value);if(!this.shouldBeUnset()||t)return this.imask_instance&&this.dependenciesFulfilled&&this.options.imask.returnUnmasked?this.imask_instance.unmaskedValue:B(H(r.prototype),"getValue",this).call(this)}},{key:"enable",value:function(){this.always_disabled||(this.input.disabled=!1,B(H(r.prototype),"enable",this).call(this))}},{key:"disable",value:function(t){t&&(this.always_disabled=!0),this.input.disabled=!0,B(H(r.prototype),"disable",this).call(this)}},{key:"afterInputReady",value:function(){this.theme.afterInputReady(this.input),window.Cleave&&!this.cleave_instance?this.setupCleave(this.input):window.IMask&&!this.imask_instance&&this.setupImask(this.input)}},{key:"refreshValue",value:function(){this.value=this.input.value,"string"==typeof this.value||this.shouldBeUnset()||(this.value=""),this.serialized=this.value}},{key:"destroy",value:function(){this.cleave_instance&&this.cleave_instance.destroy(),this.imask_instance&&this.imask_instance.destroy(),this.template=null,this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),B(H(r.prototype),"destroy",this).call(this)}},{key:"sanitize",value:function(t){return t}},{key:"onWatchedFieldChange",value:function(){var t;this.template&&(t=this.getWatchedFieldValues(),this.setValue(this.template(t),!1,!0)),B(H(r.prototype),"onWatchedFieldChange",this).call(this)}},{key:"showValidationErrors",value:function(t){var e=this;if("always"===this.jsoneditor.options.show_errors);else if(!this.is_dirty&&this.previous_error_setting===this.jsoneditor.options.show_errors)return;this.previous_error_setting=this.jsoneditor.options.show_errors;var n=t.reduce((function(t,n){return n.path===e.path&&t.push(n.message),t}),[]);n.length?this.theme.addInputError(this.input,"".concat(n.join(". "),".")):this.theme.removeInputError(this.input)}}])&&F(e.prototype,n),r}(A);function $(t){return($="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t,e){for(var n=0;n=this.schema.items.length?!0===this.schema.additionalItems?{}:this.schema.additionalItems?h({},this.schema.additionalItems):void 0:h({},this.schema.items[t]):this.schema.items?h({},this.schema.items):{}}},{key:"getItemInfo",value:function(t){var e=this.getItemSchema(t);this.item_info=this.item_info||{};var n=JSON.stringify(e);return void 0!==this.item_info[n]||(e=this.jsoneditor.expandRefs(e),this.item_info[n]={title:this.translateProperty(e.title)||this.translate("default_array_item_title"),default:e.default,width:12,child_editors:e.properties||e.items}),this.item_info[n]}},{key:"getElementEditor",value:function(t){var e=this.getItemInfo(t),n=this.getItemSchema(t);(n=this.jsoneditor.expandRefs(n)).title="".concat(e.title," ").concat(t+1);var i,r=this.jsoneditor.getEditorClass(n);this.tabs_holder?(i="tabs-top"===this.schema.format?this.theme.getTopTabContent():this.theme.getTabContent()).id="".concat(this.path,".").concat(t):i=e.child_editors?this.theme.getChildEditorHolder():this.theme.getIndentedPanel(),this.row_holder.appendChild(i);var o=this.jsoneditor.createEditor(r,{jsoneditor:this.jsoneditor,schema:n,container:i,path:"".concat(this.path,".").concat(t),parent:this,required:!0});return o.preBuild(),o.build(),o.postBuild(),o.title_controls||(o.array_controls=this.theme.getButtonHolder(),i.appendChild(o.array_controls)),o}},{key:"checkParent",value:function(t){return t&&t.parentNode}},{key:"destroy",value:function(){this.empty(!0),this.checkParent(this.title)&&this.title.parentNode.removeChild(this.title),this.checkParent(this.description)&&this.description.parentNode.removeChild(this.description),this.checkParent(this.row_holder)&&this.row_holder.parentNode.removeChild(this.row_holder),this.checkParent(this.controls)&&this.controls.parentNode.removeChild(this.controls),this.checkParent(this.panel)&&this.panel.parentNode.removeChild(this.panel),this.rows=this.row_cache=this.title=this.description=this.row_holder=this.panel=this.controls=null,tt(it(r.prototype),"destroy",this).call(this)}},{key:"empty",value:function(t){var e=this;this.rows&&(this.rows.forEach((function(n,i){t&&(e.checkParent(n.tab)&&n.tab.parentNode.removeChild(n.tab),e.destroyRow(n,!0),e.row_cache[i]=null),e.rows[i]=null})),this.rows=[],t&&(this.row_cache=[]))}},{key:"destroyRow",value:function(t,e){var n=t.container;e?(t.destroy(),n.parentNode&&n.parentNode.removeChild(n),this.checkParent(t.tab)&&t.tab.parentNode.removeChild(t.tab)):(t.tab&&(t.tab.style.display="none"),n.style.display="none",t.unregister())}},{key:"getMax",value:function(){return Array.isArray(this.schema.items)&&!1===this.schema.additionalItems?Math.min(this.schema.items.length,this.schema.maxItems||1/0):this.schema.maxItems||1/0}},{key:"refreshTabs",value:function(t){var e=this;this.rows.forEach((function(n){n.tab&&(t?n.tab_text.textContent=n.getHeaderText():n.tab===e.active_tab?e.theme.markTabActive(n):e.theme.markTabInactive(n))}))}},{key:"ensureArraySize",value:function(t){if(Array.isArray(t)||(t=[t]),this.schema.minItems)for(;t.lengththis.getMax()&&(t=t.slice(0,this.getMax())),t}},{key:"setValue",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;e=this.ensureArraySize(e);var i=JSON.stringify(e);if(i!==this.serialized){e.forEach((function(e,i){if(t.rows[i])t.rows[i].setValue(e,n);else if(t.row_cache[i])t.rows[i]=t.row_cache[i],t.rows[i].setValue(e,n),t.rows[i].container.style.display="",t.rows[i].tab&&(t.rows[i].tab.style.display=""),t.rows[i].register(),t.jsoneditor.trigger("addRow",t.rows[i]);else{var r=t.addRow(e,n);t.jsoneditor.trigger("addRow",r)}}));for(var r=e.length;r=this.rows.length;this.rows.forEach((function(t,n){if(t.movedown_button){var r=n!==e.rows.length-1;e.setVisibility(t.movedown_button,r)}t.delete_button&&e.setVisibility(t.delete_button,!i),e.value[n]=t.getValue()})),!this.collapsed&&this.setupButtons(i)?this.controls.style.display="inline-block":this.controls.style.display="none"}this.serialized=JSON.stringify(this.value)}},{key:"addRow",value:function(t,e){var n=this,i=this.rows.length;this.rows[i]=this.getElementEditor(i),this.row_cache[i]=this.rows[i],this.tabs_holder&&(this.rows[i].tab_text=document.createElement("span"),this.rows[i].tab_text.textContent=this.rows[i].getHeaderText(),"tabs-top"===this.schema.format?(this.rows[i].tab=this.theme.getTopTab(this.rows[i].tab_text,this.getValidId(this.rows[i].path)),this.theme.addTopTab(this.tabs_holder,this.rows[i].tab)):(this.rows[i].tab=this.theme.getTab(this.rows[i].tab_text,this.getValidId(this.rows[i].path)),this.theme.addTab(this.tabs_holder,this.rows[i].tab)),this.rows[i].tab.addEventListener("click",(function(t){n.active_tab=n.rows[i].tab,n.refreshTabs(),t.preventDefault(),t.stopPropagation()})));var r=this.rows[i].title_controls||this.rows[i].array_controls;return this.hide_delete_buttons||(this.rows[i].delete_button=this._createDeleteButton(i,r)),this.show_copy_button&&(this.rows[i].copy_button=this._createCopyButton(i,r)),i&&!this.hide_move_buttons&&(this.rows[i].moveup_button=this._createMoveUpButton(i,r)),this.hide_move_buttons||(this.rows[i].movedown_button=this._createMoveDownButton(i,r)),void 0!==t&&this.rows[i].setValue(t,e),this.refreshTabs(),this.rows[i]}},{key:"_createDeleteButton",value:function(t,e){var n=this,i=this.getButton(this.getItemTitle(),"delete","button_delete_row_title",[this.getItemTitle()]);return i.classList.add("delete","json-editor-btntype-delete"),i.setAttribute("data-i",t),i.addEventListener("click",(function(t){if(t.preventDefault(),t.stopPropagation(),!n.askConfirmation())return!1;var e=1*t.currentTarget.getAttribute("data-i"),i=n.getValue().filter((function(t,n){return n!==e})),r=null,o=n.rows[e];n.setValue(i),n.rows[e]?r=n.rows[e].tab:n.rows[e-1]&&(r=n.rows[e-1].tab),r&&(n.active_tab=r,n.refreshTabs()),n.onChange(!0),n.jsoneditor.trigger("deleteRow",o)})),e&&e.appendChild(i),i}},{key:"_createCopyButton",value:function(t,e){var n=this,i=this.getButton(this.getItemTitle(),"copy","button_copy_row_title",[this.getItemTitle()]);return i.classList.add("copy","json-editor-btntype-copy"),i.setAttribute("data-i",t),i.addEventListener("click",(function(t){var e=n.getValue();t.preventDefault(),t.stopPropagation();var i=1*t.currentTarget.getAttribute("data-i");e.forEach((function(t,n){n===i&&e.push(t)})),n.setValue(e),n.refreshValue(!0),n.onChange(!0)})),e.appendChild(i),i}},{key:"_createMoveUpButton",value:function(t,e){var n=this,i=this.getButton("","tabs-top"===this.schema.format?"moveleft":"moveup","button_move_up_title");return i.classList.add("moveup","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation();var e=1*t.currentTarget.getAttribute("data-i");if(!(e<=0)){var i=n.getValue(),r=i[e-1];i[e-1]=i[e],i[e]=r,n.setValue(i),n.active_tab=n.rows[e-1].tab,n.refreshTabs(),n.onChange(!0),n.jsoneditor.trigger("moveRow",n.rows[e-1])}})),e&&e.appendChild(i),i}},{key:"_createMoveDownButton",value:function(t,e){var n=this,i=this.getButton("","tabs-top"===this.schema.format?"moveright":"movedown","button_move_down_title");return i.classList.add("movedown","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation();var e=1*t.currentTarget.getAttribute("data-i"),i=n.getValue();if(!(e>=i.length-1)){var r=i[e+1];i[e+1]=i[e],i[e]=r,n.setValue(i),n.active_tab=n.rows[e+1].tab,n.refreshTabs(),n.onChange(!0),n.jsoneditor.trigger("moveRow",n.rows[e+1])}})),e&&e.appendChild(i),i}},{key:"addControls",value:function(){this.collapsed=!1,this.toggle_button=this._createToggleButton(),this.options.collapsed&&f(this.toggle_button,"click"),this.schema.options&&void 0!==this.schema.options.disable_collapse?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none"),this.add_row_button=this._createAddRowButton(),this.delete_last_row_button=this._createDeleteLastRowButton(),this.remove_all_rows_button=this._createRemoveAllRowsButton(),this.tabs&&(this.add_row_button.classList.add("je-array-control-btn"),this.delete_last_row_button.classList.add("je-array-control-btn"),this.remove_all_rows_button.classList.add("je-array-control-btn"))}},{key:"_createToggleButton",value:function(){var t=this,e=this.getButton("","collapse","button_collapse");e.classList.add("json-editor-btntype-toggle"),this.title.insertBefore(e,this.title.childNodes[0]);var n=this.row_holder.style.display,i=this.controls.style.display;return e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.panel&&t.setVisibility(t.panel,t.collapsed),t.tabs_holder&&t.setVisibility(t.tabs_holder,t.collapsed),t.collapsed?(t.collapsed=!1,t.row_holder.style.display=n,t.controls.style.display=i,t.setButtonText(e.currentTarget,"","collapse","button_collapse")):(t.collapsed=!0,t.row_holder.style.display="none",t.controls.style.display="none",t.setButtonText(e.currentTarget,"","expand","button_expand"))})),e}},{key:"_createAddRowButton",value:function(){var t=this,e=this.getButton(this.getItemTitle(),"add","button_add_row_title",[this.getItemTitle()]);return e.classList.add("json-editor-btntype-add"),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var n,i=t.rows.length;t.row_cache[i]?(n=t.rows[i]=t.row_cache[i],t.rows[i].setValue(t.rows[i].getDefault(),!0),t.rows[i].container.style.display="",t.rows[i].tab&&(t.rows[i].tab.style.display=""),t.rows[i].register()):n=t.addRow(),t.active_tab=t.rows[i].tab,t.refreshTabs(),t.refreshValue(),t.onChange(!0),t.jsoneditor.trigger("addRow",n)})),this.controls.appendChild(e),e}},{key:"_createDeleteLastRowButton",value:function(){var t=this,e=this.getButton("button_delete_last","subtract","button_delete_last_title",[this.getItemTitle()]);return e.classList.add("json-editor-btntype-deletelast"),e.addEventListener("click",(function(e){if(e.preventDefault(),e.stopPropagation(),!t.askConfirmation())return!1;var n=t.getValue(),i=null,r=n.pop();t.setValue(n),t.rows[t.rows.length-1]&&(i=t.rows[t.rows.length-1].tab),i&&(t.active_tab=i,t.refreshTabs()),t.onChange(!0),t.jsoneditor.trigger("deleteRow",r)})),this.controls.appendChild(e),e}},{key:"_createRemoveAllRowsButton",value:function(){var t=this,e=this.getButton("button_delete_all","delete","button_delete_all_title");return e.classList.add("json-editor-btntype-deleteall"),e.addEventListener("click",(function(e){if(e.preventDefault(),e.stopPropagation(),!t.askConfirmation())return!1;t.empty(!0),t.setValue([]),t.onChange(!0),t.jsoneditor.trigger("deleteAllRows")})),this.controls.appendChild(e),e}},{key:"showValidationErrors",value:function(t){var e=this,n=[],i=[];t.forEach((function(t){t.path===e.path?n.push(t):i.push(t)})),this.error_holder&&(n.length?(this.error_holder.innerHTML="",this.error_holder.style.display="",n.forEach((function(t){e.error_holder.appendChild(e.theme.getErrorMessage(t.message))}))):this.error_holder.style.display="none"),this.rows.forEach((function(t){return t.showValidationErrors(i)}))}}])&&Q(e.prototype,n),r}(A);function ot(t){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function at(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function st(t,e){for(var n=0;n1&&t.schema.options&&t.schema.options.multiple&&!0===t.schema.options.multiple&&t.parent&&"object"===t.parent.schema.type&&t.parent.parent&&"array"===t.parent.parent.schema.type){t.arrayEditor=t.jsoneditor.getEditor(t.parent.parent.path),t.value=t.arrayEditor.getValue(),t.total=e.currentTarget.files.length,t.current_item_index=parseInt(t.parent.key),t.count=t.current_item_index;for(var n=0;nType: ".concat(t,", Size: ").concat(Math.floor((this.value.length-this.value.split(",")[0].length-1)/1.33333)," bytes"),"image"===t.substr(0,5)){this.preview.innerHTML+="
";var e=document.createElement("img");e.style.maxWidth="100%",e.style.maxHeight="100px",e.src=this.value,this.preview.appendChild(e)}}else this.preview.innerHTML="Invalid data URI"}}},{key:"enable",value:function(){this.always_disabled||(this.uploader&&(this.uploader.disabled=!1),Yt(Zt(r.prototype),"enable",this).call(this))}},{key:"disable",value:function(t){t&&(this.always_disabled=!0),this.uploader&&(this.uploader.disabled=!0),Yt(Zt(r.prototype),"disable",this).call(this)}},{key:"setValue",value:function(t){this.value!==t&&(this.schema.readOnly&&this.schema.enum&&!this.schema.enum.includes(t)?this.value=this.schema.enum[0]:this.value=t,this.input.value=this.value,this.refreshPreview(),this.onChange())}},{key:"destroy",value:function(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),Yt(Zt(r.prototype),"destroy",this).call(this)}}])&&Gt(e.prototype,n),r}(A);function Qt(t){return(Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function te(t,e){for(var n=0;n0?t.disable():t.enable()},n.validated&&this.jsoneditor.on("change",this.changeHandler)}},{key:"enable",value:function(){this.always_disabled||(this.input.disabled=!1,ee(re(r.prototype),"enable",this).call(this))}},{key:"disable",value:function(t){t&&(this.always_disabled=!0),this.input.disabled=!0,ee(re(r.prototype),"disable",this).call(this)}},{key:"getNumColumns",value:function(){return 2}},{key:"activate",value:function(){this.active=!1,this.enable()}},{key:"deactivate",value:function(){this.isRequired()||(this.active=!1,this.disable())}},{key:"destroy",value:function(){this.jsoneditor.off("change",this.changeHandler),this.changeHandler=null,ee(re(r.prototype),"destroy",this).call(this)}}])&&te(e.prototype,n),r}(A);function ae(t){return(ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function se(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function le(t,e){for(var n=0;n0&&!this.enum_values.includes(n)||e&&!this.isRequired()&&!i)&&(n=this.enum_values[0]),this.value!==n&&(e?this.is_dirty=!1:"change"===this.jsoneditor.options.show_errors&&(this.is_dirty=!0),this.input.value=this.enum_options[this.enum_values.indexOf(n)],this.value=n,this.onChange(),this.change())}},{key:"register",value:function(){ge(we(r.prototype),"register",this).call(this),this.input&&this.input.setAttribute("name",this.formname)}},{key:"unregister",value:function(){ge(we(r.prototype),"unregister",this).call(this),this.input&&this.input.removeAttribute("name")}},{key:"getNumColumns",value:function(){if(!this.enum_options)return 3;for(var t=this.getTitle().length,e=0;e *":"box-sizing:border-box"};var Fe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ae(t,e)}(r,t);var e,n,i=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=De(t);if(e){var r=De(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ne(this,n)}}(r);function r(){return Le(this,r),i.apply(this,arguments)}return e=r,(n=[{key:"build",value:function(){if(Ie(De(r.prototype),"build",this).call(this),this.input&&(this.schema.max&&"string"==typeof this.schema.max&&this.input.setAttribute("max",this.schema.max),this.schema.min&&"string"==typeof this.schema.max&&this.input.setAttribute("min",this.schema.min),window.flatpickr&&"object"===Pe(this.options.flatpickr))){this.options.flatpickr.enableTime="date"!==this.schema.format,this.options.flatpickr.noCalendar="time"===this.schema.format,"integer"===this.schema.type&&(this.options.flatpickr.mode="single"),this.input.setAttribute("data-input","");var t=this.input;if(!0===this.options.flatpickr.wrap){var e=[];if(!1!==this.options.flatpickr.showToggleButton){var n=this.getButton("","time"===this.schema.format?"time":"calendar","flatpickr_toggle_button");n.setAttribute("data-toggle",""),e.push(n)}if(!1!==this.options.flatpickr.showClearButton){var i=this.getButton("","clear","flatpickr_clear_button");i.setAttribute("data-clear",""),e.push(i)}var o=this.input.parentNode,a=this.input.nextSibling,s=this.theme.getInputGroup(this.input,e);void 0!==s?(this.options.flatpickr.inline=!1,o.insertBefore(s,a),t=s):this.options.flatpickr.wrap=!1}this.flatpickr=window.flatpickr(t,this.options.flatpickr),!0===this.options.flatpickr.inline&&!0===this.options.flatpickr.inlineHideInput&&this.input.setAttribute("type","hidden")}}},{key:"getValue",value:function(){if(this.dependenciesFulfilled){if("string"===this.schema.type)return this.value;if(""!==this.value&&void 0!==this.value){var t="time"===this.schema.format?"1970-01-01 ".concat(this.value):this.value;return parseInt(new Date(t).getTime()/1e3)}}}},{key:"setValue",value:function(t,e,n){if("string"===this.schema.type)Ie(De(r.prototype),"setValue",this).call(this,t,e,n),this.flatpickr&&this.flatpickr.setDate(t);else if(t>0){var i=new Date(1e3*t),o=i.getFullYear(),a=this.zeroPad(i.getMonth()+1),s=this.zeroPad(i.getDate()),l=this.zeroPad(i.getHours()),c=this.zeroPad(i.getMinutes()),u=this.zeroPad(i.getSeconds()),d=[o,a,s].join("-"),p=[l,c,u].join(":"),h="".concat(d,"T").concat(p);"date"===this.schema.format?h=d:"time"===this.schema.format&&(h=p),this.input.value=h,this.refreshValue(),this.flatpickr&&this.flatpickr.setDate(h)}}},{key:"destroy",value:function(){this.flatpickr&&this.flatpickr.destroy(),this.flatpickr=null,Ie(De(r.prototype),"destroy",this).call(this)}},{key:"zeroPad",value:function(t){return"0".concat(t).slice(-2)}}])&&Re(e.prototype,n),r}(z);function Be(t){return(Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ve(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);nnull";if("object"===We(t)){var n="";return function(t,e){Array.isArray(t)||"number"==typeof t.length&&t.length>0&&t.length-1 in t?Array.from(t).forEach((function(t,n){return e(n,t)})):Object.entries(t).forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ge(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ge(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),i=n[0],r=n[1];return e(i,r)}))}(t,(function(i,r){var o=e.getHTML(r);Array.isArray(t)||(o="
".concat(i,": ").concat(o,"
")),n+="
  • ".concat(o,"
  • ")})),n=Array.isArray(t)?"
      ".concat(n,"
    "):"
      ".concat(n,"
    ")}return"boolean"==typeof t?t?"true":"false":"string"==typeof t?t.replace(/&/g,"&").replace(//g,">"):t}},{key:"setValue",value:function(t){this.value!==t&&(this.value=t,this.refreshValue(),this.onChange())}},{key:"destroy",value:function(){this.display_area&&this.display_area.parentNode&&this.display_area.parentNode.removeChild(this.display_area),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.switcher&&this.switcher.parentNode&&this.switcher.parentNode.removeChild(this.switcher),Ke(Qe(r.prototype),"destroy",this).call(this)}}])&&Je(e.prototype,n),r}(A);function en(t){return(en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rn(t,e){for(var n=0;na.extra)&&((r=a).i=i)),e.validate(t).length||null!==o.i||(o.i=i,null!==a&&(o.match=a.match))}));var a=o.i;void 0!==this.anyOf&&this.anyOf&&o.matcht.length)&&(e=t.length);for(var n=0,i=new Array(e);no)&&(i=s);!1===i&&(a.push({width:0,minh:999999,maxh:0,editors:[]}),i=a.length-1),a[i].editors.push({key:t,width:r,height:o}),a[i].width+=r,a[i].minh=Math.min(a[i].minh,o),a[i].maxh=Math.max(a[i].maxh,o)}})),t=0;ta[t].editors[u].width)&&(u=e),a[t].editors[e].width*=12/a[t].width,a[t].editors[e].width=Math.floor(a[t].editors[e].width),d+=a[t].editors[e].width;d<12&&(a[t].editors[u].width+=12-d),a[t].width=12}if(this.layout===JSON.stringify(a))return!1;for(this.layout=JSON.stringify(a),i=document.createElement("div"),t=0;t0?m.firstChild.isObjOrArray&&(i.appendChild(p),m.insertBefore(i,m.firstChild),n.theme.insertBasicTopTab(e.tab,h),e.basicPane=i):(i.appendChild(p),m.appendChild(i),n.theme.addTopTab(h,e.tab),e.basicPane=i)),e.options.hidden?e.container.style.display="none":n.theme.setGridColumnSize(e.container,12),o.appendChild(e.container),e.rowPane=i}}));this.tabPanesContainer.firstChild;)this.tabPanesContainer.removeChild(this.tabPanesContainer.firstChild);var y=this.tabs_holder.parentNode;y.removeChild(y.firstChild),y.appendChild(h),this.tabPanesContainer=m,this.tabs_holder=h;var g=this.theme.getFirstTab(this.tabs_holder);return void(g&&f(g,"click"))}this.property_order.forEach((function(t){var e=n.editors[t];e.property_removed||(r=n.theme.getGridRow(),i.appendChild(r),e.options.hidden?e.container.style.display="none":n.theme.setGridColumnSize(e.container,12),r.appendChild(e.container))}))}for(;this.row_container.firstChild;)this.row_container.removeChild(this.row_container.firstChild);this.row_container.appendChild(i)}}},{key:"getPropertySchema",value:function(t){var e=this,n=this.schema.properties[t]||{};n=h({},n);var i=!!this.schema.properties[t];return this.schema.patternProperties&&Object.keys(this.schema.patternProperties).forEach((function(r){new RegExp(r).test(t)&&(n.allOf=n.allOf||[],n.allOf.push(e.schema.patternProperties[r]),i=!0)})),!i&&this.schema.additionalProperties&&"object"===fi(this.schema.additionalProperties)&&(n=h({},this.schema.additionalProperties)),n}},{key:"preBuild",value:function(){var t=this;if(yi(vi(r.prototype),"preBuild",this).call(this),this.editors={},this.cached_editors={},this.format=this.options.layout||this.options.object_layout||this.schema.format||this.jsoneditor.options.object_layout||"normal",this.schema.properties=this.schema.properties||{},this.minwidth=0,this.maxwidth=0,this.options.table_row)Object.entries(this.schema.properties).forEach((function(e){var n=pi(e,2),i=n[0],r=n[1],o=t.jsoneditor.getEditorClass(r);t.editors[i]=t.jsoneditor.createEditor(o,{jsoneditor:t.jsoneditor,schema:r,path:"".concat(t.path,".").concat(i),parent:t,compact:!0,required:!0},t.currentDepth+1),t.editors[i].preBuild();var a=t.editors[i].options.hidden?0:t.editors[i].options.grid_columns||t.editors[i].getNumColumns();t.minwidth+=a,t.maxwidth+=a})),this.no_link_holder=!0;else{if(this.options.table)throw new Error("Not supported yet");this.schema.defaultProperties||(this.jsoneditor.options.display_required_only||this.options.display_required_only?this.schema.defaultProperties=Object.keys(this.schema.properties).filter((function(e){return t.isRequiredObject({key:e,schema:t.schema.properties[e]})})):this.schema.defaultProperties=Object.keys(this.schema.properties)),this.maxwidth+=1,Array.isArray(this.schema.defaultProperties)&&this.schema.defaultProperties.forEach((function(e){t.addObjectProperty(e,!0),t.editors[e]&&(t.minwidth=Math.max(t.minwidth,t.editors[e].options.grid_columns||t.editors[e].getNumColumns()),t.maxwidth+=t.editors[e].options.grid_columns||t.editors[e].getNumColumns())}))}this.property_order=Object.keys(this.editors),this.property_order=this.property_order.sort((function(e,n){var i=t.editors[e].schema.propertyOrder,r=t.editors[n].schema.propertyOrder;return"number"!=typeof i&&(i=1e3),"number"!=typeof r&&(r=1e3),i-r}))}},{key:"addTab",value:function(t){var e=this,n=this.rows[t].schema&&("object"===this.rows[t].schema.type||"array"===this.rows[t].schema.type);this.tabs_holder&&(this.rows[t].tab_text=document.createElement("span"),this.rows[t].tab_text.textContent=n?this.rows[t].getHeaderText():void 0===this.schema.basicCategoryTitle?"Basic":this.schema.basicCategoryTitle,this.rows[t].tab=this.theme.getTopTab(this.rows[t].tab_text,this.getValidId(this.rows[t].tab_text.textContent)),this.rows[t].tab.addEventListener("click",(function(n){e.active_tab=e.rows[t].tab,e.refreshTabs(),n.preventDefault(),n.stopPropagation()})))}},{key:"addRow",value:function(t,e,n){var i=this.rows.length,r="object"===t.schema.type||"array"===t.schema.type;this.rows[i]=t,this.rows[i].rowPane=n,r?(this.addTab(i),this.theme.addTopTab(e,this.rows[i].tab)):void 0===this.basicTab?(this.addTab(i),this.basicTab=i,this.basicPane=n,this.theme.addTopTab(e,this.rows[i].tab)):(this.rows[i].tab=this.rows[this.basicTab].tab,this.rows[i].tab_text=this.rows[this.basicTab].tab_text,this.rows[i].rowPane=this.rows[this.basicTab].rowPane)}},{key:"refreshTabs",value:function(t){var e=this,n=void 0!==this.basicTab,i=!1;this.rows.forEach((function(r){r.tab&&r.rowPane&&r.rowPane.parentNode&&(n&&r.tab===e.rows[e.basicTab].tab&&i||(t?r.tab_text.textContent=r.getHeaderText():(n&&r.tab===e.rows[e.basicTab].tab&&(i=!0),r.tab===e.active_tab?e.theme.markTabActive(r):e.theme.markTabInactive(r))))}))}},{key:"build",value:function(){var t=this,e="categories"===this.format;if(this.rows=[],this.active_tab=null,this.options.table_row)this.editor_holder=this.container,Object.entries(this.editors).forEach((function(e){var n=pi(e,2),i=n[0],r=n[1],o=t.theme.getTableCell();t.editor_holder.appendChild(o),r.setContainer(o),r.build(),r.postBuild(),r.setOptInCheckbox(r.header),t.editors[i].options.hidden&&(o.style.display="none"),t.editors[i].options.input_width&&(o.style.width=t.editors[i].options.input_width)}));else{if(this.options.table)throw new Error("Not supported yet");this.header="",this.options.compact||(this.header=document.createElement("label"),this.header.textContent=this.getTitle()),this.title=this.theme.getHeader(this.header,this.getPathDepth()),this.title.classList.add("je-object__title"),this.controls=this.theme.getButtonHolder(),this.controls.classList.add("je-object__controls"),this.container.appendChild(this.title),this.container.appendChild(this.controls),this.container.classList.add("je-object__container"),this.editjson_holder=this.theme.getModal(),this.editjson_textarea=this.theme.getTextareaInput(),this.editjson_textarea.classList.add("je-edit-json--textarea"),this.editjson_save=this.getButton("button_save","save","button_save"),this.editjson_save.classList.add("json-editor-btntype-save"),this.editjson_save.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.saveJSON()})),this.editjson_copy=this.getButton("button_copy","copy","button_copy"),this.editjson_copy.classList.add("json-editor-btntype-copy"),this.editjson_copy.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.copyJSON()})),this.editjson_cancel=this.getButton("button_cancel","cancel","button_cancel"),this.editjson_cancel.classList.add("json-editor-btntype-cancel"),this.editjson_cancel.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.hideEditJSON()})),this.editjson_holder.appendChild(this.editjson_textarea),this.editjson_holder.appendChild(this.editjson_save),this.editjson_holder.appendChild(this.editjson_copy),this.editjson_holder.appendChild(this.editjson_cancel),this.addproperty_holder=this.theme.getModal(),this.addproperty_list=document.createElement("div"),this.addproperty_list.classList.add("property-selector"),this.addproperty_add=this.getButton("button_add","add","button_add"),this.addproperty_add.classList.add("json-editor-btntype-add"),this.addproperty_input=this.theme.getFormInputField("text"),this.addproperty_input.setAttribute("placeholder","Property name..."),this.addproperty_input.classList.add("property-selector-input"),this.addproperty_add.addEventListener("click",(function(e){if(e.preventDefault(),e.stopPropagation(),t.addproperty_input.value){if(t.editors[t.addproperty_input.value])return void window.alert("there is already a property with that name");t.addObjectProperty(t.addproperty_input.value),t.editors[t.addproperty_input.value]&&t.editors[t.addproperty_input.value].disable(),t.onChange(!0)}})),this.addproperty_input.addEventListener("input",(function(t){t.target.previousSibling.childNodes.forEach((function(e){e.innerText.includes(t.target.value)?e.style.display="":e.style.display="none"}))})),this.addproperty_holder.appendChild(this.addproperty_list),this.addproperty_holder.appendChild(this.addproperty_input),this.addproperty_holder.appendChild(this.addproperty_add);var n=document.createElement("div");n.style.clear="both",this.addproperty_holder.appendChild(n),document.addEventListener("click",this.onOutsideModalClick),this.schema.description&&(this.description=this.theme.getDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.description)),this.error_holder=document.createElement("div"),this.container.appendChild(this.error_holder),this.editor_holder=this.theme.getIndentedPanel(),this.container.appendChild(this.editor_holder),this.row_container=this.theme.getGridContainer(),e?(this.tabs_holder=this.theme.getTopTabHolder(this.getValidId(this.translateProperty(this.schema.title))),this.tabPanesContainer=this.theme.getTopTabContentHolder(this.tabs_holder),this.editor_holder.appendChild(this.tabs_holder)):(this.tabs_holder=this.theme.getTabHolder(this.getValidId(this.translateProperty(this.schema.title))),this.tabPanesContainer=this.theme.getTabContentHolder(this.tabs_holder),this.editor_holder.appendChild(this.row_container)),Object.values(this.editors).forEach((function(n){var i=t.theme.getTabContent(),r=t.theme.getGridColumn(),o=!(!n.schema||"object"!==n.schema.type&&"array"!==n.schema.type);if(i.isObjOrArray=o,e){if(o){var a=t.theme.getGridContainer();a.appendChild(r),i.appendChild(a),t.tabPanesContainer.appendChild(i),t.row_container=a}else void 0===t.row_container_basic&&(t.row_container_basic=t.theme.getGridContainer(),i.appendChild(t.row_container_basic),0===t.tabPanesContainer.childElementCount?t.tabPanesContainer.appendChild(i):t.tabPanesContainer.insertBefore(i,t.tabPanesContainer.childNodes[1])),t.row_container_basic.appendChild(r);t.addRow(n,t.tabs_holder,i),i.id=t.getValidId(n.schema.title)}else t.row_container.appendChild(r);n.setContainer(r),n.build(),n.postBuild(),n.setOptInCheckbox(n.header)})),this.rows[0]&&f(this.rows[0].tab,"click"),this.collapsed=!1,this.collapse_control=this.getButton("","collapse","button_collapse"),this.collapse_control.classList.add("json-editor-btntype-toggle"),this.title.insertBefore(this.collapse_control,this.title.childNodes[0]),this.collapse_control.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.collapsed?(t.editor_holder.style.display="",t.collapsed=!1,t.setButtonText(t.collapse_control,"","collapse","button_collapse")):(t.editor_holder.style.display="none",t.collapsed=!0,t.setButtonText(t.collapse_control,"","expand","button_expand"))})),this.options.collapsed&&f(this.collapse_control,"click"),this.schema.options&&void 0!==this.schema.options.disable_collapse?this.schema.options.disable_collapse&&(this.collapse_control.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.collapse_control.style.display="none"),this.editjson_control=this.getButton("JSON","edit","button_edit_json"),this.editjson_control.classList.add("json-editor-btntype-editjson"),this.editjson_control.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.toggleEditJSON()})),this.controls.appendChild(this.editjson_control),this.controls.insertBefore(this.editjson_holder,this.controls.childNodes[0]),this.schema.options&&void 0!==this.schema.options.disable_edit_json?this.schema.options.disable_edit_json&&(this.editjson_control.style.display="none"):this.jsoneditor.options.disable_edit_json&&(this.editjson_control.style.display="none"),this.addproperty_button=this.getButton("properties","edit_properties","button_object_properties"),this.addproperty_button.classList.add("json-editor-btntype-properties"),this.addproperty_button.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.toggleAddProperty()})),this.controls.appendChild(this.addproperty_button),this.controls.insertBefore(this.addproperty_holder,this.controls.childNodes[1]),this.refreshAddProperties(),this.deactivateNonRequiredProperties()}this.options.table_row?(this.editor_holder=this.container,this.property_order.forEach((function(e){t.editor_holder.appendChild(t.editors[e].container)}))):(this.layoutEditors(),this.layoutEditors())}},{key:"deactivateNonRequiredProperties",value:function(){var t=this;(this.jsoneditor.options.show_opt_in||this.options.show_opt_in)&&Object.entries(this.editors).forEach((function(e){var n=pi(e,2),i=n[0],r=n[1];t.isRequiredObject(r)||t.editors[i].deactivate()}))}},{key:"showEditJSON",value:function(){this.editjson_holder&&(this.hideAddProperty(),this.editjson_holder.style.left="".concat(this.editjson_control.offsetLeft,"px"),this.editjson_holder.style.top="".concat(this.editjson_control.offsetTop+this.editjson_control.offsetHeight,"px"),this.editjson_textarea.value=JSON.stringify(this.getValue(),null,2),this.disable(),this.editjson_holder.style.display="",this.editjson_control.disabled=!1,this.editing_json=!0)}},{key:"hideEditJSON",value:function(){this.editjson_holder&&this.editing_json&&(this.editjson_holder.style.display="none",this.enable(),this.editing_json=!1)}},{key:"copyJSON",value:function(){if(this.editjson_holder){var t=document.createElement("textarea");t.value=this.editjson_textarea.value,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}},{key:"saveJSON",value:function(){if(this.editjson_holder)try{var t=JSON.parse(this.editjson_textarea.value);this.setValue(t),this.hideEditJSON(),this.onChange(!0)}catch(t){throw window.alert("invalid JSON"),t}}},{key:"toggleEditJSON",value:function(){this.editing_json?this.hideEditJSON():this.showEditJSON()}},{key:"insertPropertyControlUsingPropertyOrder",value:function(t,e,n){var i;this.schema.properties[t]&&(i=this.schema.properties[t].propertyOrder),"number"!=typeof i&&(i=1e3),e.propertyOrder=i;for(var r=0;r=r?this.getSchemaOnMaxDepth(n):n,path:"".concat(this.path,".").concat(t),parent:this},this.currentDepth+1),this.editors[t].preBuild(),!e){var o=this.theme.getChildEditorHolder();this.editor_holder.appendChild(o),this.editors[t].setContainer(o),this.editors[t].build(),this.editors[t].postBuild(),this.editors[t].setOptInCheckbox(i.header),this.editors[t].activate()}this.cached_editors[t]=this.editors[t]}e||(this.refreshValue(),this.layoutEditors())}}},{key:"onOutsideModalClick",value:function(t){this.addproperty_holder&&!this.addproperty_holder.contains(t.path[0]||t.composedPath()[0])&&this.adding_property&&(t.preventDefault(),t.stopPropagation(),this.toggleAddProperty())}},{key:"onChildEditorChange",value:function(t){this.refreshValue(),yi(vi(r.prototype),"onChildEditorChange",this).call(this,t)}},{key:"canHaveAdditionalProperties",value:function(){return"boolean"==typeof this.schema.additionalProperties?this.schema.additionalProperties:!this.jsoneditor.options.no_additional_properties}},{key:"destroy",value:function(){Object.values(this.cached_editors).forEach((function(t){return t.destroy()})),this.editor_holder&&(this.editor_holder.innerHTML=""),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.error_holder&&this.error_holder.parentNode&&this.error_holder.parentNode.removeChild(this.error_holder),this.editors=null,this.cached_editors=null,this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),this.editor_holder=null,document.removeEventListener("click",this.onOutsideModalClick),yi(vi(r.prototype),"destroy",this).call(this)}},{key:"getValue",value:function(){if(this.dependenciesFulfilled){var t=yi(vi(r.prototype),"getValue",this).call(this);return t&&(this.jsoneditor.options.remove_empty_properties||this.options.remove_empty_properties)&&Object.keys(t).forEach((function(e){var n;(void 0===(n=t[e])||""===n||n===Object(n)&&0===Object.keys(n).length&&n.constructor===Object)&&delete t[e]})),t}}},{key:"refreshValue",value:function(){var t=this;this.value={},this.editors&&(Object.keys(this.editors).forEach((function(e){t.editors[e].isActive()&&(t.value[e]=t.editors[e].getValue())})),this.adding_property&&this.refreshAddProperties())}},{key:"refreshAddProperties",value:function(){var t=this;if(this.options.disable_properties||!1!==this.options.disable_properties&&this.jsoneditor.options.disable_properties)this.addproperty_button.style.display="none";else{var e,n=0,i=!1;Object.keys(this.editors).forEach((function(t){return n++})),e=this.canHaveAdditionalProperties()&&!(void 0!==this.schema.maxProperties&&n>=this.schema.maxProperties),this.addproperty_checkboxes&&(this.addproperty_list.innerHTML=""),this.addproperty_checkboxes={},Object.keys(this.cached_editors).forEach((function(r){t.addPropertyCheckbox(r),t.isRequiredObject(t.cached_editors[r])&&r in t.editors&&(t.addproperty_checkboxes[r].disabled=!0),void 0!==t.schema.minProperties&&n<=t.schema.minProperties?(t.addproperty_checkboxes[r].disabled=t.addproperty_checkboxes[r].checked,t.addproperty_checkboxes[r].checked||(i=!0)):r in t.editors?i=!0:e||y(t.schema.properties,r)?(t.addproperty_checkboxes[r].disabled=!1,i=!0):t.addproperty_checkboxes[r].disabled=!0})),this.canHaveAdditionalProperties()&&(i=!0),Object.keys(this.schema.properties).forEach((function(e){t.cached_editors[e]||(i=!0,t.addPropertyCheckbox(e))})),i?this.canHaveAdditionalProperties()?this.addproperty_add.disabled=!e:(this.addproperty_add.style.display="none",this.addproperty_input.style.display="none"):(this.hideAddProperty(),this.addproperty_button.style.display="none")}}},{key:"isRequiredObject",value:function(t){if(t)return"boolean"==typeof t.schema.required?t.schema.required:Array.isArray(this.schema.required)?this.schema.required.includes(t.key):!!this.jsoneditor.options.required_by_default}},{key:"setValue",value:function(t,e){var n=this;("object"!==fi(t=t||{})||Array.isArray(t))&&(t={}),Object.entries(this.cached_editors).forEach((function(i){var r=pi(i,2),o=r[0],a=r[1];void 0!==t[o]?(n.addObjectProperty(o),a.setValue(t[o],e),a.activate()):e||n.isRequiredObject(a)?a.setValue(a.getDefault(),e):n.jsoneditor.options.show_opt_in||n.options.show_opt_in?a.deactivate():n.removeObjectProperty(o)})),Object.entries(t).forEach((function(t){var i=pi(t,2),r=i[0],o=i[1];n.cached_editors[r]||(n.addObjectProperty(r),n.editors[r]&&n.editors[r].setValue(o,e,!!n.editors[r].template))})),this.refreshValue(),this.layoutEditors(),this.onChange()}},{key:"showValidationErrors",value:function(t){var e=this,n=[],i=[];t.forEach((function(t){t.path===e.path?n.push(t):i.push(t)})),this.error_holder&&(n.length?(this.error_holder.innerHTML="",this.error_holder.style.display="",n.forEach((function(t){t.errorcount&&t.errorcount>1&&(t.message+=" (".concat(t.errorcount," errors)")),e.error_holder.appendChild(e.theme.getErrorMessage(t.message))}))):this.error_holder.style.display="none"),this.options.table_row&&(n.length?this.theme.addTableRowError(this.container):this.theme.removeTableRowError(this.container)),Object.values(this.editors).forEach((function(t){t.showValidationErrors(i)}))}}])&&mi(e.prototype,n),r}(A);function _i(t){return(_i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ki(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xi(t,e){for(var n=0;n-1;r--){var o=this.formname+(r+1),a=this.theme.getFormInputField("radio");a.name="".concat(this.formname,"[starrating]"),a.value=this.enum_values[r],a.id=o,a.addEventListener("change",i,!1),this.radioGroup.push(a);var s=document.createElement("label");s.htmlFor=o,s.title=this.enum_values[r],this.options.displayValue&&s.classList.add("starrating-display-enabled"),this.ratingContainer.appendChild(a),this.ratingContainer.appendChild(s)}if(this.options.displayValue&&(this.displayRating=document.createElement("div"),this.displayRating.classList.add("starrating-display"),this.displayRating.innerText=this.enum_values[0],this.ratingContainer.appendChild(this.displayRating)),this.schema.readOnly||this.schema.readonly){this.disable(!0);for(var l=0;l input":"display:none",".starrating > label:before":"content:'%5C2606';margin:1px;font-size:18px;font-style:normal;font-weight:400;line-height:1;font-family:'Arial';display:inline-block",".starrating > label":"color:%23888;cursor:pointer;margin:8px%200%202px%200",".starrating > label.starrating-display-enabled":"margin:1px%200%200%200",".starrating > input:checked ~ label":"color:%23ffca08",".starrating:not(.readonly) > input:hover ~ label":"color:%23ffca08",".starrating > input:checked ~ label:before":"content:'%5C2605';text-shadow:0%200%201px%20rgba(0%2C20%2C20%2C1)",".starrating:not(.readonly) > input:hover ~ label:before":"content:'%5C2605';text-shadow:0%200%201px%20rgba(0%2C20%2C20%2C1)",".starrating .starrating-display":"position:relative;direction:rtl;text-align:center;font-size:10px;line-height:0px"};var jr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Er(t,e)}(r,t);var e,n,i=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Or(t);if(e){var r=Or(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Tr(this,n)}}(r);function r(){return xr(this,r),i.apply(this,arguments)}return e=r,(n=[{key:"build",value:function(){Sr(Or(r.prototype),"build",this).call(this),this.input.setAttribute("type","number"),this.input.getAttribute("step")||this.input.setAttribute("step","1");var t=this.theme.getStepperButtons(this.input);this.control.appendChild(t),this.stepperDown=this.control.querySelector(".stepper-down"),this.stepperUp=this.control.querySelector(".stepper-up")}},{key:"enable",value:function(){Sr(Or(r.prototype),"enable",this).call(this),this.stepperDown.removeAttribute("disabled"),this.stepperUp.removeAttribute("disabled")}},{key:"disable",value:function(){Sr(Or(r.prototype),"disable",this).call(this),this.stepperDown.setAttribute("disabled",!0),this.stepperUp.setAttribute("disabled",!0)}}])&&Cr(e.prototype,n),r}(Ln);function Pr(t){return(Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rr(t,e){for(var n=0;nthis.schema.maxItems&&(t=t.slice(0,this.schema.maxItems)),t}},{key:"setValue",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;e=this.ensureArraySize(e);var i=JSON.stringify(e);if(i!==this.serialized){var r=!1;e.forEach((function(e,n){t.rows[n]?t.rows[n].setValue(e):(t.addRow(e),r=!0)}));for(var o=e.length;o=this.rows.length,n=this.schema.maxItems&&this.schema.maxItems<=this.rows.length,i=[];this.rows.forEach((function(r,o){if(r.delete_button){var a=!e;t.setVisibility(r.delete_button,a),i.push(a)}if(r.copy_button){var s=!n;t.setVisibility(r.copy_button,s),i.push(s)}if(r.moveup_button){var l=0!==o;t.setVisibility(r.moveup_button,l),i.push(l)}if(r.movedown_button){var c=o!==t.rows.length-1;t.setVisibility(r.movedown_button,c),i.push(c)}}));var r=i.some((function(t){return t}));this.rows.forEach((function(e){return t.setVisibility(e.controls_cell,r)})),this.setVisibility(this.controls_header_cell,r),this.setVisibility(this.table,this.value.length);var o=!(n||this.hide_add_button);this.setVisibility(this.add_row_button,o);var a=!(!this.value.length||e||this.hide_delete_last_row_buttons);this.setVisibility(this.delete_last_row_button,a);var s=!(this.value.length<=1||e||this.hide_delete_all_rows_buttons);this.setVisibility(this.remove_all_rows_button,s);var l=o||a||s;this.setVisibility(this.controls,l)}},{key:"refreshValue",value:function(){var t=this;this.value=[],this.rows.forEach((function(e,n){t.value[n]=e.getValue()})),this.serialized=JSON.stringify(this.value)}},{key:"addRow",value:function(t){var e=this.rows.length;this.rows[e]=this.getElementEditor(e);var n=this.rows[e].table_controls;this.hide_delete_buttons||(this.rows[e].delete_button=this._createDeleteButton(e,n)),this.show_copy_button&&(this.rows[e].copy_button=this._createCopyButton(e,n)),this.hide_move_buttons||(this.rows[e].moveup_button=this._createMoveUpButton(e,n)),this.hide_move_buttons||(this.rows[e].movedown_button=this._createMoveDownButton(e,n)),void 0!==t&&this.rows[e].setValue(t)}},{key:"_createDeleteButton",value:function(t,e){var n=this,i=this.getButton("","delete","button_delete_row_title_short");return i.classList.add("delete","json-editor-btntype-delete"),i.setAttribute("data-i",t),i.addEventListener("click",(function(t){if(t.preventDefault(),t.stopPropagation(),!n.askConfirmation())return!1;var e=1*t.currentTarget.getAttribute("data-i"),i=n.getValue();i.splice(e,1),n.setValue(i),n.onChange(!0),n.jsoneditor.trigger("deleteRow",n.rows[e])})),e.appendChild(i),i}},{key:"_createCopyButton",value:function(t,e){var n=this,i=this.getButton("","copy","button_copy_row_title_short");return i.classList.add("copy","json-editor-btntype-copy"),i.setAttribute("data-i",t),i.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation();var e=1*t.currentTarget.getAttribute("data-i"),i=n.getValue();i.splice(e+1,0,i[e]),n.setValue(i),n.onChange(!0),n.jsoneditor.trigger("copyRow",n.rows[e+1])})),e.appendChild(i),i}},{key:"_createMoveUpButton",value:function(t,e){var n=this,i=this.getButton("","moveup","button_move_up_title");return i.classList.add("moveup","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation();var e=1*t.currentTarget.getAttribute("data-i"),i=n.getValue();i.splice(e-1,0,i.splice(e,1)[0]),n.setValue(i),n.onChange(!0),n.jsoneditor.trigger("moveRow",n.rows[e-1])})),e.appendChild(i),i}},{key:"_createMoveDownButton",value:function(t,e){var n=this,i=this.getButton("","movedown","button_move_down_title");return i.classList.add("movedown","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation();var e=1*t.currentTarget.getAttribute("data-i"),i=n.getValue();i.splice(e+1,0,i.splice(e,1)[0]),n.setValue(i),n.onChange(!0),n.jsoneditor.trigger("moveRow",n.rows[e+1])})),e.appendChild(i),i}},{key:"addControls",value:function(){var t=this;this.collapsed=!1,this.toggle_button=this._createToggleButton(),this.title_controls&&(this.title.insertBefore(this.toggle_button,this.title.childNodes[0]),this.toggle_button.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.setVisibility(t.panel,t.collapsed),t.collapsed?(t.collapsed=!1,t.setButtonText(e.currentTarget,"","collapse","button_collapse")):(t.collapsed=!0,t.setButtonText(e.currentTarget,"","expand","button_expand"))})),this.options.collapsed&&f(this.toggle_button,"click"),this.schema.options&&void 0!==this.schema.options.disable_collapse?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none")),this.add_row_button=this._createAddRowButton(),this.delete_last_row_button=this._createDeleteLastRowButton(),this.remove_all_rows_button=this._createRemoveAllRowsButton()}},{key:"_createToggleButton",value:function(){var t=this.getButton("","collapse","button_collapse");return t.classList.add("json-editor-btntype-toggle"),t}},{key:"_createAddRowButton",value:function(){var t=this,e=this.getButton(this.getItemTitle(),"add","button_add_row_title",[this.getItemTitle()]);return e.classList.add("json-editor-btntype-add"),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var n=t.addRow();t.refreshValue(),t.refreshRowButtons(),t.onChange(!0),t.jsoneditor.trigger("addRow",n)})),this.controls.appendChild(e),e}},{key:"_createDeleteLastRowButton",value:function(){var t=this,e=this.getButton("button_delete_last","subtract","button_delete_last_title",[this.getItemTitle()]);return e.classList.add("json-editor-btntype-deletelast"),e.addEventListener("click",(function(e){if(e.preventDefault(),e.stopPropagation(),!t.askConfirmation())return!1;var n=t.getValue(),i=n.pop();t.setValue(n),t.onChange(!0),t.jsoneditor.trigger("deleteRow",i)})),this.controls.appendChild(e),e}},{key:"_createRemoveAllRowsButton",value:function(){var t=this,e=this.getButton("button_delete_all","delete","button_delete_all_title");return e.classList.add("json-editor-btntype-deleteall"),e.addEventListener("click",(function(e){if(e.preventDefault(),e.stopPropagation(),!t.askConfirmation())return!1;t.setValue([]),t.onChange(!0),t.jsoneditor.trigger("deleteAllRows")})),this.controls.appendChild(e),e}}])&&Rr(e.prototype,n),r}(rt);function Br(t){return(Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vr(t,e){for(var n=0;nt.options.max_upload_size)t.theme.addInputError(t.uploader,"Filesize too large. Max size is ".concat(t.options.max_upload_size));else if(0===t.options.mime_type.length||t.isValidMimeType(n[0].type,t.options.mime_type)){t.fileDisplay&&(t.fileDisplay.value=n[0].name);var i=new window.FileReader;i.onload=function(e){t.preview_value=e.target.result,t.refreshPreview(n),t.onChange(!0),i=null},i.readAsDataURL(n[0])}else t.theme.addInputError(t.uploader,"Wrong file format. Allowed format(s): ".concat(t.options.mime_type.toString()))},this.uploader.addEventListener("change",this.uploadHandler),this.dragHandler=function(e){var n=e.dataTransfer.items||e.dataTransfer.files,i=n&&n.length&&(0===t.options.mime_type.length||t.isValidMimeType(n[0].type,t.options.mime_type)),r=e.currentTarget.classList&&e.currentTarget.classList.contains("upload-dropzone")&&i;switch((e.currentTarget===window?"w_":"e_")+e.type){case"w_drop":case"w_dragover":r||(e.dataTransfer.dropEffect="none");break;case"e_dragenter":r?(t.dropZone.classList.add("valid-dropzone"),e.dataTransfer.dropEffect="copy"):t.dropZone.classList.add("invalid-dropzone");break;case"e_dragover":r&&(e.dataTransfer.dropEffect="copy");break;case"e_dragleave":t.dropZone.classList.remove("valid-dropzone","invalid-dropzone");break;case"e_drop":t.dropZone.classList.remove("valid-dropzone","invalid-dropzone"),r&&t.uploadHandler(e)}r||e.preventDefault()},!0===this.options.enable_drag_drop&&(["dragover","drop"].forEach((function(e){window.addEventListener(e,t.dragHandler,!0)})),["dragenter","dragover","dragleave","drop"].forEach((function(e){t.dropZone.addEventListener(e,t.dragHandler,!0)})))}this.preview=document.createElement("div"),this.control=this.input.controlgroup=this.theme.getFormControl(this.label,this.uploader||this.input,this.description,this.infoButton),this.uploader&&(this.uploader.controlgroup=this.control);var e=this.uploader||this.input,n=document.createElement("div");this.dropZone&&!this.altDropZone&&!0===this.options.drop_zone_top&&n.appendChild(this.dropZone),this.fileUploadGroup&&n.appendChild(this.fileUploadGroup),this.dropZone&&!this.altDropZone&&!0!==this.options.drop_zone_top&&n.appendChild(this.dropZone),n.appendChild(this.preview),e.parentNode.insertBefore(n,e.nextSibling),this.container.appendChild(this.control),window.requestAnimationFrame((function(){t.afterInputReady()}))}},{key:"afterInputReady",value:function(){var t=this;if(this.value){var e=document.createElement("img");e.style.maxWidth="100%",e.style.maxHeight="100px",e.onload=function(n){t.preview.appendChild(e)},e.onerror=function(t){console.error("upload error",t,t.currentTarget)},e.src=this.container.querySelector("a").href}this.theme.afterInputReady(this.input)}},{key:"refreshPreview",value:function(t){var e=this;if(this.last_preview!==this.preview_value&&(this.last_preview=this.preview_value,this.preview.innerHTML="",this.preview_value)){var n=t[0],i=this.preview_value.match(/^data:([^;,]+)[;,]/);if(n.mimeType=i?i[1]:"unknown",n.size>0){var r=Math.floor(Math.log(n.size)/Math.log(1024));n.formattedSize="".concat(parseFloat((n.size/Math.pow(1024,r)).toFixed(2))," ").concat(["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r])}else n.formattedSize="0 Bytes";var o=this.getButton("button_upload","upload","button_upload");o.addEventListener("click",(function(t){t.preventDefault(),o.setAttribute("disabled","disabled"),e.theme.removeInputError(e.uploader),e.theme.getProgressBar&&(e.progressBar=e.theme.getProgressBar(),e.preview.appendChild(e.progressBar)),e.options.upload_handler(e.path,n,{success:function(t){e.setValue(t),e.parent?e.parent.onChildEditorChange(e):e.jsoneditor.onChange(),e.progressBar&&e.preview.removeChild(e.progressBar),o.removeAttribute("disabled")},failure:function(t){e.theme.addInputError(e.uploader,t),e.progressBar&&e.preview.removeChild(e.progressBar),o.removeAttribute("disabled")},updateProgress:function(t){e.progressBar&&(t?e.theme.updateProgressBar(e.progressBar,t):e.theme.updateProgressBarUnknown(e.progressBar))}})})),this.preview.appendChild(this.theme.getUploadPreview(n,o,this.preview_value)),this.options.auto_upload&&(o.dispatchEvent(new window.MouseEvent("click")),this.preview.removeChild(o))}}},{key:"enable",value:function(){this.always_disabled||(this.uploader&&(this.uploader.disabled=!1),Hr(qr(r.prototype),"enable",this).call(this))}},{key:"disable",value:function(t){t&&(this.always_disabled=!0),this.uploader&&(this.uploader.disabled=!0),Hr(qr(r.prototype),"disable",this).call(this)}},{key:"setValue",value:function(t){this.value!==t&&(this.value=t,this.input.value=this.value,this.onChange())}},{key:"destroy",value:function(){var t=this;!0===this.options.enable_drag_drop&&(["dragover","drop"].forEach((function(e){window.removeEventListener(e,t.dragHandler,!0)})),["dragenter","dragover","dragleave","drop"].forEach((function(e){t.dropZone.removeEventListener(e,t.dragHandler,!0)})),this.dropZone.removeEventListener("dblclick",this.clickHandler),this.dropZone&&this.dropZone.parentNode&&this.dropZone.parentNode.removeChild(this.dropZone)),this.uploader&&this.uploader.parentNode&&(this.uploader.removeEventListener("change",this.uploadHandler),this.uploader.parentNode.removeChild(this.uploader)),this.browseButton&&this.browseButton.parentNode&&(this.browseButton.removeEventListener("click",this.clickHandler),this.browseButton.parentNode.removeChild(this.browseButton)),this.fileDisplay&&this.fileDisplay.parentNode&&(this.fileDisplay.removeEventListener("dblclick",this.clickHandler),this.fileDisplay.parentNode.removeChild(this.fileDisplay)),this.fileUploadGroup&&this.fileUploadGroup.parentNode&&this.fileUploadGroup.parentNode.removeChild(this.fileUploadGroup),this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.header&&this.header.parentNode&&this.header.parentNode.removeChild(this.header),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),Hr(qr(r.prototype),"destroy",this).call(this)}},{key:"isValidMimeType",value:function(t,e){return e.reduce((function(e,n){return e||new RegExp(n.replace(/\*/g,".*"),"gi").test(t)}),!1)}}])&&Vr(e.prototype,n),r}(A),uuid:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jr(t,e)}(r,t);var e,n,i=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Zr(t);if(e){var r=Zr(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Kr(this,n)}}(r);function r(){return Wr(this,r),i.apply(this,arguments)}return e=r,(n=[{key:"preBuild",value:function(){Yr(Zr(r.prototype),"preBuild",this).call(this),this.schema.default=this.uuid=this.getUuid(),this.schema.options||(this.schema.options={}),this.schema.options.cleave||(this.schema.options.cleave={delimiters:["-"],blocks:[8,4,4,4,12]})}},{key:"build",value:function(){Yr(Zr(r.prototype),"build",this).call(this),this.disable(!0),this.input.setAttribute("readonly","true")}},{key:"sanitize",value:function(t){return this.testUuid(t)||(t=this.uuid),t}},{key:"setValue",value:function(t,e,n){this.testUuid(t)||(t=this.uuid),this.uuid=t,Yr(Zr(r.prototype),"setValue",this).call(this,t,e,n)}},{key:"getUuid",value:function(){var t=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))}},{key:"testUuid",value:function(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}}])&&Gr(e.prototype,n),r}(z),colorpicker:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&no(t,e)}(r,t);var e,n,i=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=ro(t);if(e){var r=ro(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return io(this,n)}}(r);function r(){return Qr(this,r),i.apply(this,arguments)}return e=r,(n=[{key:"postBuild",value:function(){window.Picker&&(this.input.type="text"),this.input.style.padding="3px"}},{key:"setValue",value:function(t,e,n){var i=eo(ro(r.prototype),"setValue",this).call(this,t,e,n);return this.picker_instance&&this.picker_instance.domElement&&i&&i.changed&&this.picker_instance.setColor(i.value,!0),i}},{key:"getNumColumns",value:function(){return 2}},{key:"afterInputReady",value:function(){eo(ro(r.prototype),"afterInputReady",this).call(this),this.createPicker(!0)}},{key:"disable",value:function(){if(eo(ro(r.prototype),"disable",this).call(this),this.picker_instance&&this.picker_instance.domElement){this.picker_instance.domElement.style.pointerEvents="none";for(var t=this.picker_instance.domElement.querySelectorAll("button"),e=0;e1?n=function(e){for(r=e,t=0;tt.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:uo;lo(this,t),this.mapping=n,this.icon_prefix=e}var e,n;return e=t,(n=[{key:"getIconClass",value:function(t){return this.mapping[t]?this.icon_prefix+this.mapping[t]:null}},{key:"getIcon",value:function(t){var e,n=this.getIconClass(t);if(!n)return null;var i=document.createElement("i");return(e=i.classList).add.apply(e,function(t){return function(t){if(Array.isArray(t))return so(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return so(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?so(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n.split(" "))),i}}])&&co(e.prototype,n),t}();function ho(t){return(ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fo(t,e){return(fo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mo(t,e){return!e||"object"!==ho(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function yo(t){return(yo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var go={collapse:"chevron-down",expand:"chevron-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"floppy-remove",save:"floppy-saved",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"remove-circle",time:"time",calendar:"calendar",edit_properties:"list"};function bo(t){return(bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vo(t,e){return(vo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wo(t,e){return!e||"object"!==bo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _o(t){return(_o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ko={collapse:"chevron-down",expand:"chevron-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban-circle",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"remove-circle",time:"time",calendar:"calendar",edit_properties:"list"};function xo(t){return(xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Co(t,e){return(Co=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function So(t,e){return!e||"object"!==xo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Eo(t){return(Eo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var To={collapse:"caret-square-o-down",expand:"caret-square-o-right",delete:"times",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"files-o",clear:"times-circle-o",time:"clock-o",calendar:"calendar",edit_properties:"list"};function Oo(t){return(Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jo(t,e){return(jo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Po(t,e){return!e||"object"!==Oo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Lo(t){return(Lo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ro={collapse:"caret-down",expand:"caret-right",delete:"trash",edit:"pen",add:"plus",subtract:"minus",cancel:"ban",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"times-circle",time:"clock",calendar:"calendar",edit_properties:"list"};function Io(t){return(Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ao(t,e){return(Ao=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function No(t,e){return!e||"object"!==Io(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Do(t){return(Do=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fo={collapse:"triangle-1-s",expand:"triangle-1-e",delete:"trash",edit:"pencil",add:"plusthick",subtract:"minusthick",cancel:"closethick",save:"disk",moveup:"arrowthick-1-n",moveright:"arrowthick-1-e",movedown:"arrowthick-1-s",moveleft:"arrowthick-1-w",copy:"copy",clear:"circle-close",time:"time",calendar:"calendar",edit_properties:"note"};function Bo(t){return(Bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mo(t,e){return(Mo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vo(t,e){return!e||"object"!==Bo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ho(t){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zo={collapse:"collapse-down",expand:"expand-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban",save:"file",moveup:"arrow-thick-top",moveright:"arrow-thick-right",movedown:"arrow-thick-bottom",moveleft:"arrow-thick-left",copy:"clipboard",clear:"circle-x",time:"clock",calendar:"calendar",edit_properties:"list"};function $o(t){return($o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qo(t,e){return(qo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Uo(t,e){return!e||"object"!==$o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Wo(t){return(Wo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Go={collapse:"arrow-down",expand:"arrow-right",delete:"delete",edit:"edit",add:"plus",subtract:"minus",cancel:"cross",save:"check",moveup:"upward",moveright:"forward",movedown:"downward",moveleft:"back",copy:"copy",clear:"close",time:"time",calendar:"bookmark",edit_properties:"menu"},Yo={bootstrap3:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fo(t,e)}(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=yo(t);if(e){var r=yo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return mo(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"glyphicon glyphicon-",go)}return n}(po),fontawesome3:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vo(t,e)}(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=_o(t);if(e){var r=_o(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return wo(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"icon-",ko)}return n}(po),fontawesome4:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Co(t,e)}(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Eo(t);if(e){var r=Eo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return So(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"fa fa-",To)}return n}(po),fontawesome5:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jo(t,e)}(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Lo(t);if(e){var r=Lo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Po(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"fas fa-",Ro)}return n}(po),jqueryui:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ao(t,e)}(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Do(t);if(e){var r=Do(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return No(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"ui-icon ui-icon-",Fo)}return n}(po),openiconic:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mo(t,e)}(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ho(t);if(e){var r=Ho(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Vo(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"oi oi-",zo)}return n}(po),spectre:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qo(t,e)}(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Wo(t);if(e){var r=Wo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"icon icon-",Go)}return n}(po)};function Jo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ko(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{disable_theme_rules:!1};Jo(this,t),this.jsoneditor=e,Object.keys(n).forEach((function(t){void 0!==e.options[t]&&(n[t]=e.options[t])})),this.options=n}var e,n;return e=t,(n=[{key:"getContainer",value:function(){return document.createElement("div")}},{key:"getFloatRightLinkHolder",value:function(){var t=document.createElement("div");return t.classList.add("je-float-right-linkholder"),t}},{key:"getModal",value:function(){var t=document.createElement("div");return t.style.display="none",t.classList.add("je-modal"),t}},{key:"getGridContainer",value:function(){return document.createElement("div")}},{key:"getGridRow",value:function(){var t=document.createElement("div");return t.classList.add("row"),t}},{key:"getGridColumn",value:function(){return document.createElement("div")}},{key:"setGridColumnSize",value:function(t,e){}},{key:"getLink",value:function(t){var e=document.createElement("a");return e.setAttribute("href","#"),e.appendChild(document.createTextNode(t)),e}},{key:"disableHeader",value:function(t){t.style.color="#ccc"}},{key:"disableLabel",value:function(t){t.style.color="#ccc"}},{key:"enableHeader",value:function(t){t.style.color=""}},{key:"enableLabel",value:function(t){t.style.color=""}},{key:"getInfoButton",value:function(t){var e=document.createElement("span");e.innerText="ⓘ",e.classList.add("je-infobutton-icon");var n=document.createElement("span");return n.classList.add("je-infobutton-tooltip"),n.innerText=t,e.onmouseover=function(){n.style.visibility="visible"},e.onmouseleave=function(){n.style.visibility="hidden"},e.appendChild(n),e}},{key:"getFormInputLabel",value:function(t,e){var n=document.createElement("label");return n.appendChild(document.createTextNode(t)),e&&n.classList.add("required"),n}},{key:"getHeader",value:function(t,e){var n=document.createElement("h3");return"string"==typeof t?n.textContent=t:n.appendChild(t),n.classList.add("je-header"),n}},{key:"getCheckbox",value:function(){var t=this.getFormInputField("checkbox");return t.classList.add("je-checkbox"),t}},{key:"getCheckboxLabel",value:function(t,e){var n=document.createElement("label");return n.appendChild(document.createTextNode(" ".concat(t))),e&&n.classList.add("required"),n}},{key:"getMultiCheckboxHolder",value:function(t,e,n,i){var r=document.createElement("div");return r.classList.add("control-group"),e&&(e.style.display="block",r.appendChild(e),i&&e.appendChild(i)),Object.values(t).forEach((function(t){t.style.display="inline-block",t.style.marginRight="20px",r.appendChild(t)})),n&&r.appendChild(n),r}},{key:"getFormCheckboxControl",value:function(t,e,n){var i=document.createElement("div");return i.appendChild(t),e.style.width="auto",t.insertBefore(e,t.firstChild),n&&i.classList.add("je-checkbox-control--compact"),i}},{key:"getFormRadio",value:function(t){var e=this.getFormInputField("radio");return Object.keys(t).forEach((function(n){return e.setAttribute(n,t[n])})),e.classList.add("je-radio"),e}},{key:"getFormRadioLabel",value:function(t,e){var n=document.createElement("label");return n.appendChild(document.createTextNode(" ".concat(t))),e&&n.classList.add("required"),n}},{key:"getFormRadioControl",value:function(t,e,n){var i=document.createElement("div");return i.appendChild(t),e.style.width="auto",t.insertBefore(e,t.firstChild),n&&i.classList.add("je-radio-control--compact"),i}},{key:"getSelectInput",value:function(t,e){var n=document.createElement("select");return t&&this.setSelectOptions(n,t),n}},{key:"getSwitcher",value:function(t){var e=this.getSelectInput(t,!1);return e.classList.add("je-switcher"),e}},{key:"getSwitcherOptions",value:function(t){return t.getElementsByTagName("option")}},{key:"setSwitcherOptions",value:function(t,e,n){this.setSelectOptions(t,e,n)}},{key:"setSelectOptions",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t.innerHTML="";for(var i=0;iNumber(o)&&t.stepDown():t.stepDown():r(t,o),f(t,"change")})),i.addEventListener("click",(function(){t.getAttribute("initialized")?a?Number(t.value)
    "),n}},{key:"getTopTabHolder",value:function(t){var e=void 0===t?"":t,n=document.createElement("div");return n.innerHTML="
    "),n}},{key:"applyStyles",value:function(t,e){Object.keys(e).forEach((function(n){return t.style[n]=e[n]}))}},{key:"closest",value:function(t,e){for(;t&&t!==document;){if(!t[Zo])return!1;if(t[Zo](e))return t;t=t.parentNode}return!1}},{key:"insertBasicTopTab",value:function(t,e){e.firstChild.insertBefore(t,e.firstChild.firstChild)}},{key:"getTab",value:function(t,e){var n=document.createElement("div");return n.appendChild(t),n.id=e,n.classList.add("je-tab"),n}},{key:"getTopTab",value:function(t,e){var n=document.createElement("div");return n.appendChild(t),n.id=e,n.classList.add("je-tab--top"),n}},{key:"getTabContentHolder",value:function(t){return t.children[1]}},{key:"getTopTabContentHolder",value:function(t){return t.children[1]}},{key:"getTabContent",value:function(){return this.getIndentedPanel()}},{key:"getTopTabContent",value:function(){return this.getTopIndentedPanel()}},{key:"markTabActive",value:function(t){this.applyStyles(t.tab,{opacity:1,background:"white"}),void 0!==t.rowPane?t.rowPane.style.display="":t.container.style.display=""}},{key:"markTabInactive",value:function(t){this.applyStyles(t.tab,{opacity:.5,background:""}),void 0!==t.rowPane?t.rowPane.style.display="none":t.container.style.display="none"}},{key:"addTab",value:function(t,e){t.children[0].appendChild(e)}},{key:"addTopTab",value:function(t,e){t.children[0].appendChild(e)}},{key:"getBlockLink",value:function(){var t=document.createElement("a");return t.classList.add("je-block-link"),t}},{key:"getBlockLinkHolder",value:function(){return document.createElement("div")}},{key:"getLinksHolder",value:function(){return document.createElement("div")}},{key:"createMediaLink",value:function(t,e,n){t.appendChild(e),n.classList.add("je-media"),t.appendChild(n)}},{key:"createImageLink",value:function(t,e,n){t.appendChild(e),e.appendChild(n)}},{key:"getFirstTab",value:function(t){return t.firstChild.firstChild}},{key:"getInputGroup",value:function(t,e){}},{key:"cleanText",value:function(t){var e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText}},{key:"getDropZone",value:function(t){var e=document.createElement("div");return e.setAttribute("data-text",t),e.classList.add("je-dropzone"),e}},{key:"getUploadPreview",value:function(t,e,n){var i=document.createElement("div");if(i.classList.add("je-upload-preview"),"image"===t.mimeType.substr(0,5)){var r=document.createElement("img");r.src=n,i.appendChild(r)}var o=document.createElement("div");o.innerHTML+="Name: ".concat(t.name,"
    Type: ").concat(t.type,"
    Size: ").concat(t.formattedSize),i.appendChild(o),i.appendChild(e);var a=document.createElement("div");return a.style.clear="left",i.appendChild(a),i}},{key:"getProgressBar",value:function(){var t=document.createElement("progress");return t.setAttribute("max",100),t.setAttribute("value",0),t}},{key:"updateProgressBar",value:function(t,e){t&&t.setAttribute("value",e)}},{key:"updateProgressBarUnknown",value:function(t){t&&t.removeAttribute("value")}}])&&Ko(e.prototype,n),t}();function Qo(t){return(Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ta(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ea(t,e){for(var n=0;n
    "),n}},{key:"getTopTabHolder",value:function(t){var e=void 0===t?"":t,n=document.createElement("div");return n.innerHTML="
    "),n}},{key:"getTab",value:function(t,e){var n=document.createElement("li");n.setAttribute("role","presentation");var i=document.createElement("a");return i.setAttribute("href","#".concat(e)),i.appendChild(t),i.setAttribute("aria-controls",e),i.setAttribute("role","tab"),i.setAttribute("data-toggle","tab"),n.appendChild(i),n}},{key:"getTopTab",value:function(t,e){var n=document.createElement("li");n.setAttribute("role","presentation");var i=document.createElement("a");return i.setAttribute("href","#".concat(e)),i.appendChild(t),i.setAttribute("aria-controls",e),i.setAttribute("role","tab"),i.setAttribute("data-toggle","tab"),n.appendChild(i),n}},{key:"getTabContent",value:function(){var t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}},{key:"getTopTabContent",value:function(){var t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}},{key:"markTabActive",value:function(t){t.tab.classList.add("active"),void 0!==t.rowPane?t.rowPane.classList.add("active"):t.container.classList.add("active")}},{key:"markTabInactive",value:function(t){t.tab.classList.remove("active"),void 0!==t.rowPane?t.rowPane.classList.remove("active"):t.container.classList.remove("active")}},{key:"getProgressBar",value:function(){var t=document.createElement("div");t.classList.add("progress");var e=document.createElement("div");return e.classList.add("progress-bar"),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuenow",0),e.setAttribute("aria-valuemin",0),e.setAttribute("aria-valuenax",100),e.innerHTML="".concat(0,"%"),t.appendChild(e),t}},{key:"updateProgressBar",value:function(t,e){if(t){var n=t.firstChild,i="".concat(e,"%");n.setAttribute("aria-valuenow",e),n.style.width=i,n.innerHTML=i}}},{key:"updateProgressBarUnknown",value:function(t){if(t){var e=t.firstChild;t.classList.add("progress","progress-striped","active"),e.removeAttribute("aria-valuenow"),e.style.width="100%",e.innerHTML=""}}},{key:"getInputGroup",value:function(t,e){if(t){var n=document.createElement("div");n.classList.add("input-group"),n.appendChild(t);var i=document.createElement("div");i.classList.add("input-group-btn"),n.appendChild(i);for(var r=0;rNumber(s)&&t.stepDown():t.stepDown():a(t,s),f(t,"change")})),o.addEventListener("click",(function(){t.getAttribute("initialized")?l?Number(t.value)
    "),e.classList.add("row"),e}},{key:"addTab",value:function(t,e){t.children[0].children[0].appendChild(e)}},{key:"getTabContentHolder",value:function(t){return t.children[1].children[0]}},{key:"getTopTabHolder",value:function(t){var e=void 0===t?"":t,n=document.createElement("div");return n.classList.add("card"),n.innerHTML="
    "),n}},{key:"getTab",value:function(t,e){var n=document.createElement("li");n.classList.add("nav-item");var i=document.createElement("a");return i.classList.add("nav-link"),i.setAttribute("href","#".concat(e)),i.setAttribute("data-toggle","tab"),i.appendChild(t),n.appendChild(i),n}},{key:"getTopTab",value:function(t,e){var n=document.createElement("li");n.classList.add("nav-item");var i=document.createElement("a");return i.classList.add("nav-link"),i.setAttribute("href","#".concat(e)),i.setAttribute("data-toggle","tab"),i.appendChild(t),n.appendChild(i),n}},{key:"getTabContent",value:function(){var t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}},{key:"getTopTabContent",value:function(){var t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}},{key:"markTabActive",value:function(t){t.tab.firstChild.classList.add("active"),void 0!==t.rowPane?t.rowPane.classList.add("active"):t.container.classList.add("active")}},{key:"markTabInactive",value:function(t){t.tab.firstChild.classList.remove("active"),void 0!==t.rowPane?t.rowPane.classList.remove("active"):t.container.classList.remove("active")}},{key:"insertBasicTopTab",value:function(t,e){e.children[0].children[0].insertBefore(t,e.children[0].children[0].firstChild)}},{key:"addTopTab",value:function(t,e){t.children[0].children[0].appendChild(e)}},{key:"getTopTabContentHolder",value:function(t){return t.children[1].children[0]}},{key:"getFirstTab",value:function(t){return t.firstChild.firstChild.firstChild}},{key:"getProgressBar",value:function(){var t=document.createElement("div");t.classList.add("progress");var e=document.createElement("div");return e.classList.add("progress-bar"),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuenow",0),e.setAttribute("aria-valuemin",0),e.setAttribute("aria-valuenax",100),e.innerHTML="".concat(0,"%"),t.appendChild(e),t}},{key:"updateProgressBar",value:function(t,e){if(t){var n=t.firstChild,i="".concat(e,"%");n.setAttribute("aria-valuenow",e),n.style.width=i,n.innerHTML=i}}},{key:"updateProgressBarUnknown",value:function(t){if(t){var e=t.firstChild;t.classList.add("progress","progress-striped","active"),e.removeAttribute("aria-valuenow"),e.style.width="100%",e.innerHTML=""}}},{key:"getBlockLink",value:function(){var t=document.createElement("a");return t.classList.add("mb-3","d-inline-block"),t}},{key:"getLinksHolder",value:function(){return document.createElement("div")}},{key:"getInputGroup",value:function(t,e){if(t){var n=document.createElement("div");n.classList.add("input-group"),n.appendChild(t);var i=document.createElement("div");i.classList.add("input-group-append"),n.appendChild(i);for(var r=0;r .form-group":"margin-bottom:0",".json-editor-btn-upload":"margin-top:1rem",".je-noindent .card":"padding:0;border:0",".je-tooltip:hover::before":"display:block;position:absolute;font-size:0.8em;color:%23fff;border-radius:0.2em;content:attr(title);background-color:%23000;margin-top:-2.5em;padding:0.3em",".je-tooltip:hover::after":"display:block;position:absolute;font-size:0.8em;color:%23fff",".select2-container--default .select2-selection--single":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__arrow":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__rendered":"line-height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".selectize-control.form-control":"padding:0",".selectize-dropdown.form-control":"padding:0;height:auto",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"};var Ra=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ja(t,e)}(r,t);var e,n,i=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=La(t);if(e){var r=La(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Pa(this,n)}}(r);function r(){return Ea(this,r),i.apply(this,arguments)}return e=r,(n=[{key:"getTable",value:function(){var t=Oa(La(r.prototype),"getTable",this).call(this);return t.setAttribute("cellpadding",5),t.setAttribute("cellspacing",0),t}},{key:"getTableHeaderCell",value:function(t){var e=Oa(La(r.prototype),"getTableHeaderCell",this).call(this,t);return e.classList.add("ui-state-active"),e.style.fontWeight="bold",e}},{key:"getTableCell",value:function(){var t=Oa(La(r.prototype),"getTableCell",this).call(this);return t.classList.add("ui-widget-content"),t}},{key:"getHeaderButtonHolder",value:function(){var t=this.getButtonHolder();return t.style.marginLeft="10px",t.style.fontSize=".6em",t.style.display="inline-block",t}},{key:"getFormInputDescription",value:function(t){var e=this.getDescription(t);return e.style.marginLeft="10px",e.style.display="inline-block",e}},{key:"getFormControl",value:function(t,e,n,i){var o=Oa(La(r.prototype),"getFormControl",this).call(this,t,e,n,i);return"checkbox"===e.type?(o.style.lineHeight="25px",o.style.padding="3px 0"):o.style.padding="4px 0 8px 0",o}},{key:"getDescription",value:function(t){var e=document.createElement("span");return e.style.fontSize=".8em",e.style.fontStyle="italic",window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}},{key:"getButtonHolder",value:function(){var t=document.createElement("div");return t.classList.add("ui-buttonset"),t.style.fontSize=".7em",t}},{key:"getFormInputLabel",value:function(t,e){var n=document.createElement("label");return n.style.fontWeight="bold",n.style.display="block",n.textContent=t,e&&n.classList.add("required"),n}},{key:"getButton",value:function(t,e,n){var i=document.createElement("button");i.classList.add("ui-button","ui-widget","ui-state-default","ui-corner-all"),e&&!t?(i.classList.add("ui-button-icon-only"),e.classList.add("ui-button-icon-primary","ui-icon-primary"),i.appendChild(e)):e?(i.classList.add("ui-button-text-icon-primary"),e.classList.add("ui-button-icon-primary","ui-icon-primary"),i.appendChild(e)):i.classList.add("ui-button-text-only");var r=document.createElement("span");return r.classList.add("ui-button-text"),r.textContent=t||n||".",i.appendChild(r),i.setAttribute("title",n),i}},{key:"setButtonText",value:function(t,e,n,i){t.innerHTML="",t.classList.add("ui-button","ui-widget","ui-state-default","ui-corner-all"),n&&!e?(t.classList.add("ui-button-icon-only"),n.classList.add("ui-button-icon-primary","ui-icon-primary"),t.appendChild(n)):n?(t.classList.add("ui-button-text-icon-primary"),n.classList.add("ui-button-icon-primary","ui-icon-primary"),t.appendChild(n)):t.classList.add("ui-button-text-only");var r=document.createElement("span");r.classList.add("ui-button-text"),r.textContent=e||i||".",t.appendChild(r),t.setAttribute("title",i)}},{key:"getIndentedPanel",value:function(){var t=document.createElement("div");return t.classList.add("ui-widget-content","ui-corner-all"),t.style.padding="1em 1.4em",t.style.marginBottom="20px",t}},{key:"afterInputReady",value:function(t){if(!t.controls&&(t.controls=this.closest(t,".form-control"),this.queuedInputErrorText)){var e=this.queuedInputErrorText;delete this.queuedInputErrorText,this.addInputError(t,e)}}},{key:"addInputError",value:function(t,e){t.controls?(t.errmsg?t.errmsg.style.display="":(t.errmsg=document.createElement("div"),t.errmsg.classList.add("ui-state-error"),t.controls.appendChild(t.errmsg)),t.errmsg.textContent=e):this.queuedInputErrorText=e}},{key:"removeInputError",value:function(t){t.controls||delete this.queuedInputErrorText,t.errmsg&&(t.errmsg.style.display="none")}},{key:"markTabActive",value:function(t){t.tab.classList.remove("ui-widget-header"),t.tab.classList.add("ui-state-active"),void 0!==t.rowPane?t.rowPane.style.display="":t.container.style.display=""}},{key:"markTabInactive",value:function(t){t.tab.classList.add("ui-widget-header"),t.tab.classList.remove("ui-state-active"),void 0!==t.rowPane?t.rowPane.style.display="none":t.container.style.display="none"}}])&&Ta(e.prototype,n),r}(Xo);function Ia(t){return(Ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Aa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Na(t,e){for(var n=0;n'),n}},{key:"getTopTabHolder",value:function(t){var e=void 0===t?"":t,n=document.createElement("div");return n.innerHTML='
      '),n}},{key:"getTab",value:function(t,e){var n=document.createElement("a");return n.classList.add("btn","btn-secondary","btn-block"),n.setAttribute("href","#".concat(e)),n.appendChild(t),n}},{key:"getTopTab",value:function(t,e){var n=document.createElement("li");n.id=e,n.classList.add("tab-item");var i=document.createElement("a");return i.setAttribute("href","#".concat(e)),i.appendChild(t),n.appendChild(i),n}},{key:"markTabActive",value:function(t){t.tab.classList.add("active"),void 0!==t.rowPane?t.rowPane.style.display="":t.container.style.display=""}},{key:"markTabInactive",value:function(t){t.tab.classList.remove("active"),void 0!==t.rowPane?t.rowPane.style.display="none":t.container.style.display="none"}},{key:"afterInputReady",value:function(t){if("select"===t.localName)if(t.classList.contains("selectized")){var e=t.nextSibling;e&&(e.classList.remove("form-select"),Array.from(e.querySelectorAll(".form-select")).forEach((function(t){t.classList.remove("form-select")})))}else if(t.classList.contains("select2-hidden-accessible")){var n=t.nextSibling;n&&n.querySelector(".select2-selection--single")&&n.classList.add("form-select")}t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}},{key:"addInputError",value:function(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("form-input-hint"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.classList.remove("d-hide"),t.errmsg.textContent=e)}},{key:"removeInputError",value:function(t){t.errmsg&&(t.errmsg.classList.add("d-hide"),t.controlgroup.classList.remove("has-error"))}}])&&Ha(e.prototype,n),r}(Xo);function Ya(t){return(Ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ja(t,e){for(var n=0;n label + .btn-group":"margin-left:1rem",".text-right > button":"margin-right:0%20!important",".text-left > button":"margin-left:0%20!important",".property-selector":"font-size:0.7rem;font-weight:normal;max-height:260px%20!important;width:395px%20!important",".property-selector .form-checkbox":"margin:0",textarea:"width:100%25;min-height:2rem;resize:vertical",table:"border-collapse:collapse",".table td":"padding:0.4rem%200.4rem",".mr-5":"margin-right:1rem%20!important","div[data-schematype]:not([data-schematype='object'])":"transition:0.5s","div[data-schematype]:not([data-schematype='object']):hover":"background-color:%23eee",".je-table-border td":"border:0.05rem%20solid%20%23dadee4%20!important",".btn-info":"font-size:0.5rem;font-weight:bold;height:0.8rem;padding:0.15rem%200;line-height:0.8;margin:0.3rem%200%200.3rem%200.1rem",".je-label + select":"min-width:5rem",".je-label":"font-weight:600",".btn-action.btn-info":"width:0.8rem",".je-border":"border:0.05rem%20solid%20%23dadee4",".je-panel":"padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".je-panel-top":"padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".required:after":"content:%22%20*%22;color:red;font:inherit",".je-align-bottom":"margin-top:auto",".je-desc":"font-size:smaller;margin:0.2rem%200",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem;border:3px%20solid%20white;box-shadow:0px%200px%208px%20rgba(0%2C%200%2C%200%2C%200.3);box-sizing:border-box",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red",".columns .container.je-noindent":"padding-left:0;padding-right:0",".selectize-control.multi .item":"background:var(--primary-color)%20!important",".select2-container--default .select2-selection--single .select2-selection__arrow":"display:none",".select2-container--default .select2-selection--single":"border:none",".select2-container .select2-selection--single .select2-selection__rendered":"padding:0",".select2-container .select2-search--inline .select2-search__field":"margin-top:0",".select2-container--default.select2-container--focus .select2-selection--multiple":"border:0.05rem%20solid%20var(--gray-color)",".select2-container--default .select2-selection--multiple .select2-selection__choice":"margin:0.4rem%200.2rem%200.2rem%200;padding:2px%205px;background-color:var(--primary-color);color:var(--light-color)",".select2-container--default .select2-search--inline .select2-search__field":"line-height:normal",".choices":"margin-bottom:auto",".choices__list--multiple .choices__item":"border:none;background-color:var(--primary-color);color:var(--light-color)",".choices[data-type*='select-multiple'] .choices__button":"border-left:0.05rem%20solid%20%232826a6",".choices__inner":"font-size:inherit;min-height:20px;padding:4px%207.5px%204px%203.75px",".choices[data-type*='select-one'] .choices__inner":"padding-bottom:4px",".choices__list--dropdown .choices__item":"font-size:inherit"};var ts={disable_theme_rules:!1,label_bold:!1,object_panel_default:!0,object_indent:!0,object_border:!1,table_border:!1,table_hdiv:!1,table_zebrastyle:!1,input_size:"small",enable_compact:!1},es=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Za(t,e)}(r,t);var e,n,i=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Qa(t);if(e){var r=Qa(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xa(this,n)}}(r);function r(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this,t,ts)}return e=r,(n=[{key:"getGridContainer",value:function(){var t=document.createElement("div");return t.classList.add("flex","flex-col","w-full"),this.options.object_indent||t.classList.add("je-noindent"),t}},{key:"getGridRow",value:function(){var t=document.createElement("div");return t.classList.add("flex","flex-wrap","w-full"),t}},{key:"getGridColumn",value:function(){var t=document.createElement("div");return t.classList.add("flex","flex-col"),t}},{key:"setGridColumnSize",value:function(t,e,n){e>0&&e<12?t.classList.add("w-".concat(e,"/12"),"px-1"):t.classList.add("w-full","px-1"),n&&(t.style.marginLeft="".concat(100/12*n,"%"))}},{key:"getIndentedPanel",value:function(){var t=document.createElement("div");return this.options.object_panel_default?t.classList.add("w-full","p-1"):t.classList.add("relative","flex","flex-col","rounded","break-words","border","bg-white","border-0","border-blue-400","p-1","shadow-md"),this.options.object_border&&t.classList.add("je-border"),t}},{key:"getTopIndentedPanel",value:function(){var t=document.createElement("div");return this.options.object_panel_default?t.classList.add("w-full","m-2"):t.classList.add("relative","flex","flex-col","rounded","break-words","border","bg-white","border-0","border-blue-400","p-1","shadow-md"),this.options.object_border&&t.classList.add("je-border"),t}},{key:"getTitle",value:function(){return this.translateProperty(this.schema.title)}},{key:"getSelectInput",value:function(t,e){var n=Ka(Qa(r.prototype),"getSelectInput",this).call(this,t);return e?n.classList.add("form-multiselect","block","py-0","h-auto","w-full","px-1","text-sm","text-black","leading-normal","bg-white","border","border-grey","rounded"):n.classList.add("form-select","block","py-0","h-6","w-full","px-1","text-sm","text-black","leading-normal","bg-white","border","border-grey","rounded"),this.options.enable_compact&&n.classList.add("compact"),n}},{key:"afterInputReady",value:function(t){t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}},{key:"getTextareaInput",value:function(){var t=Ka(Qa(r.prototype),"getTextareaInput",this).call(this);return t.classList.add("block","w-full","px-1","text-sm","leading-normal","bg-white","text-black","border","border-grey","rounded"),this.options.enable_compact&&t.classList.add("compact"),t.style.height=0,t}},{key:"getRangeInput",value:function(t,e,n){var i=this.getFormInputField("range");return i.classList.add("slider"),this.options.enable_compact&&i.classList.add("compact"),i.setAttribute("oninput",'this.setAttribute("value", this.value)'),i.setAttribute("min",t),i.setAttribute("max",e),i.setAttribute("step",n),i}},{key:"getRangeControl",value:function(t,e){var n=Ka(Qa(r.prototype),"getRangeControl",this).call(this,t,e);return n.classList.add("text-center","text-black"),n}},{key:"getCheckbox",value:function(){var t=this.getFormInputField("checkbox");return t.classList.add("form-checkbox","text-red-600"),t}},{key:"getCheckboxLabel",value:function(t,e){var n=Ka(Qa(r.prototype),"getCheckboxLabel",this).call(this,t,e);return n.classList.add("inline-flex","items-center"),n}},{key:"getFormCheckboxControl",value:function(t,e,n){return t.insertBefore(e,t.firstChild),n&&t.classList.add("inline-flex flex-row"),t}},{key:"getMultiCheckboxHolder",value:function(t,e,n,i){var o=Ka(Qa(r.prototype),"getMultiCheckboxHolder",this).call(this,t,e,n,i);return o.classList.add("inline-flex","flex-col"),o}},{key:"getFormRadio",value:function(t){var e=this.getFormInputField("radio");for(var n in e.classList.add("form-radio","text-red-600"),t)e.setAttribute(n,t[n]);return e}},{key:"getFormRadioLabel",value:function(t,e){var n=Ka(Qa(r.prototype),"getFormRadioLabel",this).call(this,t,e);return n.classList.add("inline-flex","items-center","mr-2"),n}},{key:"getFormRadioControl",value:function(t,e,n){return t.insertBefore(e,t.firstChild),n&&t.classList.add("form-radio"),t}},{key:"getRadioHolder",value:function(t,e,n,i,o){var a=Ka(Qa(r.prototype),"getRadioHolder",this).call(this,e,n,i,o);return"h"===t.options.layout?a.classList.add("inline-flex","flex-row"):a.classList.add("inline-flex","flex-col"),a}},{key:"getFormInputLabel",value:function(t,e){var n=Ka(Qa(r.prototype),"getFormInputLabel",this).call(this,t,e);return this.options.label_bold?n.classList.add("font-bold"):n.classList.add("required"),n}},{key:"getFormInputField",value:function(t){var e=Ka(Qa(r.prototype),"getFormInputField",this).call(this,t);return["checkbox","radio"].includes(t)||e.classList.add("block","w-full","px-1","text-black","text-sm","leading-normal","bg-white","border","border-grey","rounded"),this.options.enable_compact&&e.classList.add("compact"),e}},{key:"getFormInputDescription",value:function(t){var e=document.createElement("p");return e.classList.add("block","mt-1","text-xs"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}},{key:"getFormControl",value:function(t,e,n,i){var r=document.createElement("div");return r.classList.add("form-group","mb-1","w-full"),t&&(t.classList.add("text-xs"),"checkbox"===e.type&&(e.classList.add("form-checkbox","text-xs","text-red-600","mr-1"),t.classList.add("items-center","flex"),t=this.getFormCheckboxControl(t,e,!1,i)),"radio"===e.type&&(e.classList.add("form-radio","text-red-600","mr-1"),t.classList.add("items-center","flex"),t=this.getFormRadioControl(t,e,!1,i)),r.appendChild(t),!["checkbox","radio"].includes(e.type)&&i&&r.appendChild(i)),["checkbox","radio"].includes(e.type)||("small"===this.options.input_size?e.classList.add("text-xs"):"normal"===this.options.input_size?e.classList.add("text-base"):"large"===this.options.input_size&&e.classList.add("text-xl"),r.appendChild(e)),n&&r.appendChild(n),r}},{key:"getHeaderButtonHolder",value:function(){var t=this.getButtonHolder();return t.classList.add("text-sm"),t}},{key:"getButtonHolder",value:function(){var t=document.createElement("div");return t.classList.add("flex","relative","inline-flex","align-middle"),t}},{key:"getButton",value:function(t,e,n){var i=Ka(Qa(r.prototype),"getButton",this).call(this,t,e,n);return i.classList.add("inline-block","align-middle","text-center","text-sm","bg-blue-700","text-white","py-1","pr-1","m-2","shadow","select-none","whitespace-no-wrap","rounded"),i}},{key:"getInfoButton",value:function(t){var e=document.createElement("a");e.classList.add("tooltips","float-right"),e.innerHTML="ⓘ";var n=document.createElement("span");return n.innerHTML=t,e.appendChild(n),e}},{key:"getTable",value:function(){var t=Ka(Qa(r.prototype),"getTable",this).call(this);return this.options.table_border?t.classList.add("je-table-border"):t.classList.add("table","border","p-0"),t}},{key:"getTableRow",value:function(){var t=Ka(Qa(r.prototype),"getTableRow",this).call(this);return this.options.table_border&&t.classList.add("je-table-border"),this.options.table_zebrastyle&&t.classList.add("je-table-zebra"),t}},{key:"getTableHeaderCell",value:function(t){var e=Ka(Qa(r.prototype),"getTableHeaderCell",this).call(this,t);return this.options.table_border?e.classList.add("je-table-border"):this.options.table_hdiv?e.classList.add("je-table-hdiv"):e.classList.add("text-xs","border","p-0","m-0"),e}},{key:"getTableCell",value:function(){var t=Ka(Qa(r.prototype),"getTableCell",this).call(this);return this.options.table_border?t.classList.add("je-table-border"):this.options.table_hdiv?t.classList.add("je-table-hdiv"):t.classList.add("border-0","p-0","m-0"),t}},{key:"addInputError",value:function(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.classList.add("bg-red-600"),t.errmsg?t.errmsg.style.display="":(t.errmsg=document.createElement("p"),t.errmsg.classList.add("block","mt-1","text-xs","text-red"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.textContent=e)}},{key:"removeInputError",value:function(t){t.errmsg&&(t.errmsg.style.display="none",t.classList.remove("bg-red-600"),t.controlgroup.classList.remove("has-error"))}},{key:"getTabHolder",value:function(t){var e=document.createElement("div"),n=void 0===t?"":t;return e.innerHTML="
        "),e.classList.add("flex"),e}},{key:"addTab",value:function(t,e){t.children[0].children[0].appendChild(e)}},{key:"getTopTabHolder",value:function(t){var e=void 0===t?"":t,n=document.createElement("div");return n.innerHTML="
        "),n}},{key:"getTab",value:function(t,e){var n=document.createElement("li");n.classList.add("nav-item","flex-col","text-center","text-white","bg-blue-500","shadow-md","border","p-2","mb-2","mr-2","hover:bg-blue-400","rounded");var i=document.createElement("a");return i.classList.add("nav-link","text-center"),i.setAttribute("href","#".concat(e)),i.setAttribute("data-toggle","tab"),i.appendChild(t),n.appendChild(i),n}},{key:"getTopTab",value:function(t,e){var n=document.createElement("li");n.classList.add("nav-item","flex","border-l","border-t","border-r");var i=document.createElement("a");return i.classList.add("nav-link","-mb-px","flex-row","text-center","bg-white","p-2","hover:bg-blue-400","rounded-t"),i.setAttribute("href","#".concat(e)),i.setAttribute("data-toggle","tab"),i.appendChild(t),n.appendChild(i),n}},{key:"getTabContent",value:function(){var t=document.createElement("div");return t.setAttribute("role","tabpanel"),t}},{key:"getTopTabContent",value:function(){var t=document.createElement("div");return t.setAttribute("role","tabpanel"),t}},{key:"markTabActive",value:function(t){t.tab.firstChild.classList.add("block"),!0===t.tab.firstChild.classList.contains("border-b")?(t.tab.firstChild.classList.add("border-b-0"),t.tab.firstChild.classList.remove("border-b")):t.tab.firstChild.classList.add("border-b-0"),!0===t.container.classList.contains("hidden")?(t.container.classList.remove("hidden"),t.container.classList.add("block")):t.container.classList.add("block")}},{key:"markTabInactive",value:function(t){!0===t.tab.firstChild.classList.contains("border-b-0")?(t.tab.firstChild.classList.add("border-b"),t.tab.firstChild.classList.remove("border-b-0")):t.tab.firstChild.classList.add("border-b"),!0===t.container.classList.contains("block")&&(t.container.classList.remove("block"),t.container.classList.add("hidden"))}},{key:"getProgressBar",value:function(){var t=document.createElement("div");t.classList.add("progress");var e=document.createElement("div");return e.classList.add("bg-blue","leading-none","py-1","text-xs","text-center","text-white"),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuenow",0),e.setAttribute("aria-valuemin",0),e.setAttribute("aria-valuenax",100),e.innerHTML="".concat(0,"%"),t.appendChild(e),t}},{key:"updateProgressBar",value:function(t,e){if(t){var n=t.firstChild,i="".concat(e,"%");n.setAttribute("aria-valuenow",e),n.style.width=i,n.innerHTML=i}}},{key:"updateProgressBarUnknown",value:function(t){if(t){var e=t.firstChild;t.classList.add("progress","bg-blue","leading-none","py-1","text-xs","text-center","text-white","block"),e.removeAttribute("aria-valuenow"),e.classList.add("w-full"),e.innerHTML=""}}},{key:"getInputGroup",value:function(t,e){if(t){var n=document.createElement("div");n.classList.add("relative","items-stretch","w-full"),n.appendChild(t);var i=document.createElement("div");i.classList.add("-mr-1"),n.appendChild(i);for(var r=0;rt.length)&&(e=t.length);for(var n=0,i=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{};if(os(this,t),!(e instanceof Element))throw new Error("element should be an instance of Element");this.element=e,this.options=h({},t.defaults.options,i),this.ready=!1,this.copyClipboard=null,this.schema=this.options.schema,this.template=this.options.template,this.translate=this.options.translate||t.defaults.translate,this.translateProperty=this.options.translateProperty||t.defaults.translateProperty,this.uuid=0,this.__data={};var r=this.options.theme||t.defaults.theme,o=t.defaults.themes[r];if(!o)throw new Error("Unknown theme ".concat(r));this.element.setAttribute("data-theme",r),this.theme=new o(this);var a=h(is,this.getEditorsRules()),s=function(t,e,i){return i?n.addNewStyleRulesToShadowRoot(t,e,i):n.addNewStyleRules(t,e)};if(!this.theme.options.disable_theme_rules){var l=m(this.element);s("default",a,l),void 0!==o.rules&&s(r,o.rules,l)}var c=t.defaults.iconlibs[this.options.iconlib||t.defaults.iconlib];c&&(this.iconlib=new c),this.root_container=this.theme.getContainer(),this.element.appendChild(this.root_container);var u=document.location.origin+document.location.pathname.toString(),d=new P(this.options),p=document.location.toString();this.expandSchema=function(t,e){return d.expandSchema(t,e)},this.expandRefs=function(t,e){return d.expandRefs(t,e)},this.refs=d.refs,d.load(this.schema,(function(e){var i=n.options.custom_validators?{custom_validators:n.options.custom_validators}:{};n.validator=new S(n,null,i,t.defaults);var r=n.getEditorClass(e);n.root=n.createEditor(r,{jsoneditor:n,schema:e,required:!0,container:n.root_container}),n.root.preBuild(),n.root.build(),n.root.postBuild(),y(n.options,"startval")&&n.root.setValue(n.options.startval),n.validation_results=n.validator.validate(n.root.getValue()),n.root.showValidationErrors(n.validation_results),n.ready=!0,window.requestAnimationFrame((function(){n.ready&&(n.validation_results=n.validator.validate(n.root.getValue()),n.root.showValidationErrors(n.validation_results),n.trigger("ready"),n.trigger("change"))}))}),u,p)}var e,n;return e=t,(n=[{key:"getValue",value:function(){if(!this.ready)throw new Error("JSON Editor not ready yet. Listen for 'ready' event before getting the value");return this.root.getValue()}},{key:"setValue",value:function(t){if(!this.ready)throw new Error("JSON Editor not ready yet. Listen for 'ready' event before setting the value");return this.root.setValue(t),this}},{key:"validate",value:function(t){if(!this.ready)throw new Error("JSON Editor not ready yet. Listen for 'ready' event before validating");return 1===arguments.length?this.validator.validate(t):this.validation_results}},{key:"destroy",value:function(){this.destroyed||this.ready&&(this.schema=null,this.options=null,this.root.destroy(),this.root=null,this.root_container=null,this.validator=null,this.validation_results=null,this.theme=null,this.iconlib=null,this.template=null,this.__data=null,this.ready=!1,this.element.innerHTML="",this.element.removeAttribute("data-theme"),this.destroyed=!0)}},{key:"on",value:function(t,e){return this.callbacks=this.callbacks||{},this.callbacks[t]=this.callbacks[t]||[],this.callbacks[t].push(e),this}},{key:"off",value:function(t,e){if(t&&e){this.callbacks=this.callbacks||{},this.callbacks[t]=this.callbacks[t]||[];for(var n=[],i=0;i2&&void 0!==arguments[2]?arguments[2]:1;return new e(n=h({},e.options||{},n),t.defaults,i)}},{key:"onChange",value:function(){var t=this;if(this.ready&&!this.firing_change)return this.firing_change=!0,window.requestAnimationFrame((function(){t.firing_change=!1,t.ready&&(t.validation_results=t.validator.validate(t.root.getValue()),"never"!==t.options.show_errors?t.root.showValidationErrors(t.validation_results):t.root.showValidationErrors([]),t.trigger("change"))})),this}},{key:"compileTemplate",value:function(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.defaults.template;if("string"==typeof i){if(!t.defaults.templates[i])throw new Error("Unknown template engine ".concat(i));if(!(n=t.defaults.templates[i]()))throw new Error("Template engine ".concat(i," missing required library."))}else n=i;if(!n)throw new Error("No template engine set");if(!n.compile)throw new Error("Invalid template engine set");return n.compile(e)}},{key:"_data",value:function(t,e,n){if(3!==arguments.length)return t.hasAttribute("data-jsoneditor-".concat(e))?this.__data[t.getAttribute("data-jsoneditor-".concat(e))]:null;var i;t.hasAttribute("data-jsoneditor-".concat(e))?i=t.getAttribute("data-jsoneditor-".concat(e)):(i=this.uuid++,t.setAttribute("data-jsoneditor-".concat(e),i)),this.__data[i]=n}},{key:"registerEditor",value:function(t){return this.editors=this.editors||{},this.editors[t.path]=t,this}},{key:"unregisterEditor",value:function(t){return this.editors=this.editors||{},this.editors[t.path]=null,this}},{key:"getEditor",value:function(t){if(this.editors)return this.editors[t]}},{key:"watch",value:function(t,e){return this.watchlist=this.watchlist||{},this.watchlist[t]=this.watchlist[t]||[],this.watchlist[t].push(e),this}},{key:"unwatch",value:function(t,e){if(!this.watchlist||!this.watchlist[t])return this;if(!e)return this.watchlist[t]=null,this;for(var n=[],i=0;i0;)i.deleteRule(0);Object.keys(e).forEach((function(n){var o="default"===t?n:"".concat(r,'[data-theme="').concat(t,'"] ').concat(n);i.insertRule?i.insertRule(o+" {"+decodeURIComponent(e[n])+"}",0):i.addRule&&i.addRule(o,decodeURIComponent(e[n]),0)}))}},{key:"addNewStyleRulesToShadowRoot",value:function(t,e,n){var i=this.element.nodeName.toLowerCase(),r="";Object.keys(e).forEach((function(n){var o="default"===t?n:"".concat(i,'[data-theme="').concat(t,'"] ').concat(n);r+=o+" {"+decodeURIComponent(e[n])+"}\n"}));var o=new CSSStyleSheet;o.replaceSync(r),n.adoptedStyleSheets=[].concat(function(t){return function(t){if(Array.isArray(t))return rs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return rs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rs(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n.adoptedStyleSheets),[o])}}])&&as(e.prototype,n),t}();ss.defaults=l,ss.AbstractEditor=A,ss.AbstractTheme=Xo,ss.AbstractIconLib=po,Object.assign(ss.defaults.themes,ns),Object.assign(ss.defaults.editors,oo),Object.assign(ss.defaults.templates,ao),Object.assign(ss.defaults.iconlibs,Yo)}])},1:function(t,e){},10:function(t,e){},"1mrn":function(t,e,n){},2:function(t,e){},"2Qx2":function(t,e,n){"use strict";(function(t,i){n.d(e,"a",(function(){return c}));var r=n("W2Rx"),o=n("oj90");const a=n("33yf"),s=n("OeYU"),l=n("Iab2"),c={appInstanceStates:t.observable([]),restoreFromLocalStorage:t.observable(!0),isDocumentDirty:t.observable(!1),editingPath:t.observable(null),editingName:t.observable("NewFile"),editingType:t.observable("json"),editingFolder:t.observable(null),documentHeader:t.observable(null),lastStorageHost:t.observable("LOCAL"),lastEditedUnix:t.observable(new Date),lastSavedUnix:t.observable(null),inkCompiler:null,editingFileFolder:function(t=""){const e=c.editingPath()?c.editingPath():"";return t.length>0?a.join(a.dirname(e),t):a.dirname(e)},startNewFile:function(t="NewFile",e="json"){c.editingPath(null),c.editingName(t),c.editingType(e),c.editingFolder(null),c.documentHeader(null),app.workspace.selectedNodes=[],app.editing(null),e===o.FILETYPE.INK&&app.settings.documentType("ink"),app.nodes([app.newNode(!0).title("ink"===app.settings.documentType()?c.InkGlobalScopeNodeName:"Start").body("ink"===app.settings.documentType()?"":"Empty text")]),app.tags([]),app.updateNodeLinks(),app.workspace.warpToNodeByIdx(0),c.lastStorageHost("LOCAL"),c.isDocumentDirty(!0),app.refreshWindowTitle(),c.saveAppStateToLocalStorage(),app.ui.dispatchEvent("newYarnFileStarted")},askForFileName:function(){Swal.fire({title:"Enter a New File Name",input:"text",inputPlaceholder:"NewFile",showCancelButton:!0}).then(t=>{(t.value||""===t.value)&&c.startNewFile(t.value||"NewFile")})},setNewFile:function(){Swal.fire({title:"Create a New File?",text:`Any unsaved progress to ${c.editingName()}.${c.editingType()} will be lost!\n Path: ${c.editingPath()}\n Storage: ${c.lastStorageHost()}\n `,icon:"warning",showCancelButton:!0,confirmButtonText:"New file",cancelButtonText:"No, cancel!"}).then(t=>{t.value&&c.askForFileName()})},loadDocumentStateTabFromIndex:function(t){console.log("ATTEMPT TO LOAD STATE",t),app.settings.selectedFileTab(t),c.loadAppStateFromLocalStorage()},getCurrentAppState:function(){return{editingPath:c.editingPath(),editingName:c.editingName(),documentType:app.settings.documentType(),editingType:c.editingType(),editingFolder:c.editingFolder(),editingTitle:app.editing()?app.editing().title():null,nodes:c.getNodesAsObjects(),documentHeader:c.documentHeader(),tags:app.tags(),editorSelection:app.editor?app.editor.selection.getRange():null,transform:app.workspace.transform,scale:app.workspace.scale,lastStorageHost:c.lastStorageHost(),lastEditedUnix:c.lastEditedUnix()||"",lastSavedUnix:c.lastSavedUnix(),pluginStorage:app.plugins.pluginStorage}},deleteDocumentStateTab:function(t){Swal.fire({title:"Are you sure?",text:`Are you sure you want to close this file? Any unsaved changes to ${c.editingName()}.${c.editingType()} will be lost!\n Path: ${c.editingPath()||""}\n Storage: ${c.lastStorageHost()}\n `,icon:"warning",showCancelButton:!0,confirmButtonText:"Yes close",cancelButtonText:"Cancel",reverseButtons:!0}).then(e=>{if(e.value){console.log("DELETE TAB",c.appInstanceStates(),t);const e=c.appInstanceStates().filter((e,n)=>n!==t).map(t=>({...t}));c.appInstanceStates([...e]),c.saveAppStateToLocalStorage(!1),setTimeout(()=>{const e=t>c.appInstanceStates().length-1?c.appInstanceStates().length-1:t;c.loadDocumentStateTabFromIndex(e)},500),console.log(c.appInstanceStates(),"resulting mutation",e)}})},addDocumentState:function({editingName:t,editingType:e,yarnData:n,checked:i}){c.appInstanceStates([...c.appInstanceStates(),{...c.getCurrentAppState()}]),console.log("DOCUMENT TAB ADDED",c.appInstanceStates()),c.saveAppStateToLocalStorage(),c.loadDocumentStateTabFromIndex(c.appInstanceStates().length-1),i?(c.editingName(t),c.editingType(e)):c.startNewFile(t,e),console.log({editingName:t,yarnData:n,editingType:e,checked:i})},addDocumentStateTab:function(){c.promptFileNameAndFormat(c.addDocumentState,null,"📜 Name of new file"," Copy of "+c.editingName())},saveAppStateToLocalStorage:function(t=!0){if(!c.restoreFromLocalStorage())return;const e=app.settings.storage;c.isDocumentDirty(!0),c.lastEditedUnix(new Date),app.refreshWindowTitle(),console.log("Update storage",c.appInstanceStates(),t);const n=[...c.appInstanceStates()];t&&(n[app.settings.selectedFileTab()]=c.getCurrentAppState()),c.appInstanceStates(n),e.setItem("appStates",JSON.stringify(c.appInstanceStates())),app.ui.dispatchEvent("yarnSavedStateToLocalStorage")},loadAppStateFromLocalStorage:function(){if(!c.restoreFromLocalStorage())return;const t=app.settings.storage;t.getItem("appState")&&t.clear();const e=JSON.parse(t.getItem("appStates")),n=e[app.settings.selectedFileTab()];if(c.appInstanceStates(e),console.log("APP state",e,n),n){const{editingPath:t,lastStorageHost:e,editingName:i,editingType:r,documentType:o,editingFolder:a,editingTitle:s,editorSelection:l,nodes:u,documentHeader:d,tags:p,transform:h,scale:f,pluginStorage:m,lastEditedUnix:y,lastSavedUnix:g}=n;c.editingPath(t),c.editingName(i),c.editingType(r),app.settings.documentType(o),c.editingFolder(a),c.lastStorageHost(e),c.lastEditedUnix(y),c.lastSavedUnix(g),app.nodes([]),c.getNodesFromObjects(u).forEach(t=>app.nodes.push(t)),app.tags(p),app.updateNodeLinks(),app.workspace.setTranslation(h.x,h.y),app.workspace.setZoom(4*f),s&&(app.editNode(app.nodes().find(t=>t.title()===s)),l&&app.editor.selection.setRange(l)),app.plugins.pluginStorage=m,c.documentHeader(d),c.isDocumentDirty(!0),app.refreshWindowTitle(),app.ui.dispatchEvent("yarnLoadedStateFromLocalStorage")}},readFile:function(t,e,n){c.getFileData(t,e).then(e=>{c.editingPath(t.path),c.editingType(e.type),c.loadData(e.data,e.type,n)})},setNewFileStats:function(t,e,n="LOCAL"){console.log("Updated save data",t,e),c.editingName(t.replace(/^.*[\\\/]/,"")),c.isDocumentDirty(!1),c.editingPath(e),c.lastStorageHost(n),app.refreshWindowTitle()},openFile:function(t,e){const n=c.editingPath()?"Any unsaved progress to "+c.editingName()+" will be lost.":"Any unsaved progress will be lost.";Swal.fire({title:"Are you sure you want to open another file?",text:n,icon:"warning",showConfirmButton:!0,showCancelButton:!0}).then(n=>{!0===n.value&&(c.readFile(t,e,!0),c.setNewFileStats(e,t.path),app.refreshWindowTitle())})},openFileFromFilePath:function(t){const e=app.path.basename(t);i.ajax({url:t,async:!1,success:n=>{const i=c.getFileType(e);i===o.FILETYPE.UNKNOWN?Swal.fire({title:"Unknown filetype!",icon:"error"}):(c.loadData(n,i,!0),c.setNewFileStats(e,t),c.editingType(i))}})},getFileData:function(t,e){return new Promise((n,i)=>{const r=new FileReader;r.onload=function(a){const s=c.getFileType(e);s===o.FILETYPE.UNKNOWN?(Swal.fire({title:"Unknown filetype!",icon:"error"}),i()):n({file:t,type:s,data:r.result,name:t.name})},r.readAsText(t)})},openFiles:async function(t,e){const n=document.getElementById("open-file").files;for(const t of Object.values(n)){const e=await c.getFileData(t,t.name);console.log("FILEDATA",e);const n=e.name,i=e.type;c.addDocumentState({editingName:n,editingType:i,yarnData:e.data}),c.loadData(e.data,i,!0)}},openFolder:function(t,e){editingFolder=e,Swal.fire({text:"openFolder not yet implemented e: "+t+" foldername: "+e,icon:"error"})},appendFile:function(t,e){c.readFile(t,e,!1)},getFileType:function(t){const e=t.toLowerCase();return e.endsWith(".json")?o.FILETYPE.JSON:e.endsWith(".yarn.txt")?o.FILETYPE.YARN:e.endsWith(".ink")?o.FILETYPE.INK:e.endsWith(".yarn")?o.FILETYPE.YARN:e.endsWith(".xml")?o.FILETYPE.XML:e.endsWith(".txt")?o.FILETYPE.TWEE:e.endsWith(".tw2")||e.endsWith(".twee")?o.FILETYPE.TWEE2:o.FILETYPE.UNKNOWN},dispatchEventDataLoaded:function(){var t=new CustomEvent("yarnLoadedData");t.document=document,t.data=c,t.app=app,window.dispatchEvent(t),window.parent.dispatchEvent(t)},restoreSettingsFromDocumentHeader:function(){if(null!==c.documentHeader()){const t=c.documentHeader();console.log("Apply settings from file header:",t),"markupLanguage"in t&&app.settings.markupLanguage(t.markupLanguage),"language"in t&&app.settings.language(t.language),"filetypeVersion"in t&&app.settings.filetypeVersion(t.filetypeVersion),app.settings.apply()}},loadData:function(t,e,n){const i=[],r=t=>{for(let e=0;e{try{s.title=a[t].split("//yarn-editor-metadata:")[0].replace(/===/g,"").trim();const{x:e,y:n,colorID:i}=JSON.parse(a[t].split("//yarn-editor-metadata:")[1]);s.position={x:parseInt(e),y:parseInt(n)},s.colorID=i}catch(t){console.warn("node metadata failed parse: ",t)}};for(let t=0;t-1)null==s&&(s={}),s.title=a[t].substr(7,a[t].length-7);else if(a[t].indexOf("position:")>-1){null==s&&(s={});var u=a[t].substr(9,a[t].length-9).split(",");s.position={x:Number(u[0].trim()),y:Number(u[1].trim())}}else a[t].indexOf("colorID:")>-1?(null==s&&(s={}),s.colorID=Number(a[t].substr(9,a[t].length-9).trim())):a[t].indexOf("tags:")>-1?(null==s&&(s={}),s.tags=a[t].substr(6,a[t].length-6)):"---"===a[t].trim()&&(l=!0,s.body="");null!=s&&i.push(s),app.setDocumentType("yarn")}else if(e===o.FILETYPE.TWEE||e===o.FILETYPE.TWEE2){a=t.split("\n"),s=null;for(var d=0,p=0;p0&&g>0&&(f=a[p].substr(y+1,g-y-1));var b=a[p].indexOf("<"),v=a[p].indexOf(">");if(b>0&&v>0){var w=a[p].substr(b+1,v-b-1).split(",");m.x=parseInt(w[0]),m.y=parseInt(w[1])}var _=0;y>0?_=y:b>0&&(_=b),h=(h=_?a[p].substr(3,_-3):a[p].substr(3)).trim(),s.title=h,s.tags=f,s.body="",s.position=m}else null!=s&&(s.body.length>0&&(a[p]+="\n"),s.body+=a[p]);null!=s&&i.push(s),app.setDocumentType("yarn")}else if(e===o.FILETYPE.XML){app.setDocumentType("yarn");var k=(new DOMParser).parseFromString(t,"text/xml");if(void 0!==(t=o.Utils.xmlToObject(k)))for(let e=0;e{n&&app.nodes.removeAll(),c.getNodesFromObjects(i).forEach(t=>app.nodes.push(t))}),c.editingType(e),c.restoreSettingsFromDocumentHeader(),app.updateNodeLinks(),app.workspace.warpToNodeByIdx(0),c.isDocumentDirty(!1),c.addGlobalScopeToInkDoc(),c.dispatchEventDataLoaded()},addGlobalScopeToInkDoc:function(){"ink"!==app.settings.documentType()||app.nodes().find(t=>t.title().trim()===c.InkGlobalScopeNodeName)||app.newNode(!0).title(c.InkGlobalScopeNodeName).x(-400)},getNodeFromObject:function(t){return new r.a({title:t.title,body:t.body,tags:t.tags,colorID:t.colorID,x:parseInt(t.position.x),y:parseInt(t.position.y)})},getNodeAsObject:function(t){return{title:t.title(),tags:t.tags(),body:t.body(),position:{x:t.x(),y:t.y()},colorID:t.colorID()}},getNodesFromObjects:function(t){const e=[];return t?(t.forEach(t=>{e.push(c.getNodeFromObject(t))}),e):[]},getNodesAsObjects:function(){const t=[],e=app.nodes();for(var n=0;nt.title.trim()===c.InkGlobalScopeNodeName);if(t){if(n){const e=t.body.split(/\r\n|\r|\n/).filter(t=>t.trim().startsWith("INCLUDE "));r+=t.body.split(/\r\n|\r|\n/).filter(t=>!t.trim().startsWith("INCLUDE ")).join("\n");for(const t of e){const e=t.trim().split("INCLUDE ");if(e.length>1){const t=c.appInstanceStates().find(t=>t.editingType===o.FILETYPE.INK&&t.editingName===e[1]);if(t){r+=await c.getSaveData(o.FILETYPE.INK,null,n,t.nodes)+"\n"}}}}else r+=t.body;if(e&&r.split(/\r\n|\r|\n/).length>e)return t}for(let t=0;t0&&"\n"===a[a.length-1]||(r+="\n"),e&&r.split(/\r\n|\r|\n/).length>e)return n}}else if(t===o.FILETYPE.INKJSON){const t=await c.getSaveData("ink",null,!0),e=new Promise((e,n)=>{app.ui.toastMixin.fire({title:"Ink file is compiling",icon:"info",timer:4e3,text:"Please wait..."}),c.inkCompiler.init(i=>{i.errors.length>0?(Swal.fire({title:"Failed to parse ink file",html:`
        ${i.errors.join("
        ")}
        `,icon:"error"}).then(()=>c.goToErrorInkNode(t,i.errors[0])),n()):(console.log("Warnings",i.warnings),app.ui.toastMixin.fire({animation:!0,title:i.warnings.length>0?"Ink file compiled with some warnings":"Ink file compiled successfully",icon:i.warnings.length>0?"warning":"success",text:i.warnings.join("\n")}),console.log({responseStory:i.story}),e(JSON.stringify(i.story,null,"\t")))}).then(()=>c.inkCompiler.submit(t))});r=await e}else if(t===o.FILETYPE.YARN)for(let t=0;t0&&"\n"===a[a.length-1]||(r+="\n"),r+="===\n"}else if(t===o.FILETYPE.RENPY)for(let t=0;t0&&"\n"===e[e.length-1]||(r+="\n");let n=!1,o=!1,a="";const s=i[t].tags.includes("renpy");e.split("\n").forEach(t=>{const e=t.trim(),i=o?"\t\t":"\t";if(s)a+=`${i}${t}\n`;else if(e.startsWith("[[")){const t=e.replace(/[\[\[]|[\]\]]]/g,"").split("|");t.length>1?(n||(a+=i+"menu:\n",n=!0),a+=`${i}\t"${t[0].trim()}":\n${i}\t\tjump ${t[1].trim()}\n`):a+=`${i}jump ${t[0].trim()}\n`}else if(e.startsWith("<\>|if/g,"").split(/==|!=|>||==|!=|<)/);a+=t.length>1&&n?`\tif ${t[0].trim()} ${n[0]} ${t[1].trim()}:\n`:`\t# ${e}\n`,o=!0}else if(e.startsWith("<\>|elseif/g,"").split(/==|!=|>||==|!=|<)/);a+=t.length>1&&n?`\telif ${t[0].trim()} ${n[0]} ${t[1].trim()}:\n`:`\t# ${e}\n`,o=!0}else if(e.startsWith("<\$]|set /g,"").split("=");console.log({set:t}),a+=t.length>1?`${i}$ ${t[0].trim()} = ${t[1].trim()}\n`:`${i}#$ ${t[0].trim()} = 0:\n`}else e.startsWith("<<")?a+=`${i}${e.replace(/[\<\>]/g,"")}\n`:e.startsWith("//")?a+=`${i}#${e.substring(2)}\n`:e.length>0&&(e.endsWith('"')?a+=`${i}${e}\n`:a+=`${i}"${e}"\n`);n=!1}),r+=a+"\n"}else if(t===o.FILETYPE.TWEE)for(let t=0;t0&&(s=" ["+i[t].tags+"]"),r+=":: "+i[t].title+s+"\n",r+=i[t].body+"\n\n"}else if(t===o.FILETYPE.TWEE2)for(let t=0;t0&&(s=" ["+i[t].tags+"]");var l=" <"+i[t].position.x+","+i[t].position.y+">";r+=":: "+i[t].title+s+l+"\n",r+=i[t].body+"\n\n"}else if(t===o.FILETYPE.XML){r+="\n";for(let t=0;t\n",r+="\t\t"+i[t].title+"\n",r+="\t\t"+i[t].tags+"\n",r+="\t\t"+i[t].body+"\n",r+='\t\t\n',r+="\t\t"+i[t].colorID+"\n",r+="\t\n";r+="\n"}return c.isDocumentDirty(!1),app.refreshWindowTitle(),r},saveTo:function(t,e,n=null){app.fs&&app.fs.writeFile(t,e,{encoding:"utf-8"},(function(e){c.editingPath(t),n&&n(),e?Swal.fire({title:"Error Saving Data to "+t+": "+e,icon:"error"}):(app.ui.notification.fire({title:"Saved!",icon:"success"}),app.ui.dispatchEvent("yarnSavedData"),c.setNewFileStats(t,t,"LOCAL"))}))},openFileDialog:function(t,e){t.bind("change",(function(n){e(n.currentTarget.files[0],t.val());var i="";null!=t.attr("nwsaveas")&&(i='nwsaveas="'+t.attr("nwsaveas")+'"'),null!=t.attr("accept")&&(i='accept="'+t.attr("accept")+'"'),t.parent().append('"),t.unbind("change"),t.remove()})),t.trigger("click")},saveFileDialog:function(t,e,n){const i=(c.editingName()||"").replace(/\.[^/.]+$/,"")+"."+e;if(app.electron)app.electron.remote.dialog.showSaveDialog({title:"Saving "+i,filters:[{name:e+" file",extensions:[e]}],defaultPath:i}).then(t=>{c.saveTo(t.filePath,n)}).catch(t=>{console.error(t)});else{var r=new Blob([n],{type:"text/plain;charset=utf-8"});l(r,i)}},insertImageFileName:function(){c.openFileDialog(i("#open-image"),(function(t,e){app.insertTextAtCursor(t.path?t.path:t.name)}))},tryOpenFile:function(){c.openFileDialog(i("#open-file"),c.openFiles)},promptFileNameAndFormat:function(t,e=null,n="💾 Save file - enter file name",i=""){const r=c.editingName().replace(/\.[^/.]+$/,"")+"(new)."+c.editingType();Swal.fire({title:n,html:` \n \n ${e&&e.map(t=>`\n ${i?`

        ${i}`:""}\n `,onOpen:()=>{"NewFile"!==c.editingName()&&(document.getElementById("swal-input1").value=r)},showCancelButton:!0,preConfirm:()=>({name:document.getElementById("swal-input1").value,checked:!!i&&document.getElementById("swal-checkbox-checked").checked})}).then(({value:e})=>{if(e){const{name:n,checked:i}=e,r=n.split(".").pop(),a=Object.values(o.FILETYPE).includes(r)?r:c.editingType(),s=(n||"").replace(/\.[^/.]+$/,"")+"."+a;c.getSaveData(a).then(e=>{t({editingName:s,editingType:a,yarnData:e,checked:i})})}})},tryShareFilePwa:function(t){c.promptFileNameAndFormat(({editingName:t,yarnData:e})=>{const n=[new Blob([e],{type:"text/plain"})],i=new File(n,t,{});navigator.canShare&&navigator.canShare({files:[i]})?navigator.share({title:t,text:e,file:[i]}).then(()=>console.log("Successful share")).catch(t=>console.log("Error sharing",t)):Swal.fire({title:"Web Share API is not supported in your browser.\nTry using it on your smartphone or tablet...",icon:"error"})})},trySaveGist:function(t){t&&t.file&&t.file.length>0?t.get(t.file).then(e=>{const n=Object.keys(e.body.files);console.log(n),c.promptFileNameAndFormat(({editingName:e,yarnData:n})=>{c.editingName(e),t.edit(t.file,{files:{[e]:{content:n}}}),Swal.fire("Saved!","The Yarn has been saved to gist "+t.file,"success"),c.lastStorageHost("GIST"),c.isDocumentDirty(!1),app.refreshWindowTitle()},n)}):(Swal.fire("Not configured","Your github settings are not configured","warning"),app.ui.openSettingsDialog())},openGist:function(t,e){const n=c.getFileType(e);c.loadData(t,n,!0),c.isDocumentDirty(!1),c.lastStorageHost("GIST"),c.editingPath(null),c.editingName(e),app.refreshWindowTitle()},tryOpenGist:function(t){t&&t.file&&t.file.length>0?t.get(t.file).then(t=>{const e=t.body.files,n={};Object.keys(e).forEach(t=>{n[t]=t}),Swal.fire({title:"🐙 Open file from a gist",input:"select",inputOptions:n,inputAttributes:{autocomplete:"off"},inputPlaceholder:"Select a file from the gist",showCancelButton:!0}).then(({value:t})=>{if(t){const n=e[t].content;c.openGist(n,t)}})}):(Swal.fire("Not configured","Your github settings are not configured","warning"),app.ui.openSettingsDialog())},tryOpenFolder:function(){c.openFileDialog(i("#open-folder"),c.openFolder)},tryAppend:function(){c.openFileDialog(i("#open-file"),c.appendFile)},save:function(){app.editingVisualStudioCodeFile()||(c.editingPath()?c.trySaveCurrent():c.trySave(o.FILETYPE.JSON))},trySave:function(t){c.getSaveData(t).then(e=>c.saveFileDialog(i("#save-file"),t,e))},trySaveCurrent:function(){if(c.isDocumentDirty())if("GIST"===c.lastStorageHost()){const t=app.gists;t.get(t.file).then(e=>{c.getSaveData(c.editingType()).then(e=>{c.getSaveData(c.editingType()),t.edit(t.file,{files:{[c.editingName()]:{content:e}}}),c.lastStorageHost("GIST"),c.isDocumentDirty(!1),app.refreshWindowTitle(),app.ui.toastMixin.fire({title:"Saved",text:`Saved ${c.editingName()} to Gist`})})})}else c.editingPath()?c.editingPath().length>0&&c.editingType().length>0&&c.getSaveData(c.editingType()).then(t=>{c.saveTo(c.editingPath(),t)}):app.gists&&app.gists.options.token?c.trySaveGist(app.gists):c.trySave(o.FILETYPE.JSON)},doesFileExist:function(t){return!1},triggerPasteClipboard:function(){if(app.electron){const t=app.electron.clipboard.readText();app.clipboard=t,document.execCommand("paste")}else navigator.clipboard&&navigator.clipboard.readText().then(t=>{app.clipboard=t}).catch(t=>{app.clipboard=app.editor.getSelectedText(),console.log("No clipboard access",t,"using local instead")}),setTimeout(()=>app.insertTextAtCursor(app.clipboard),100)},triggerCopyClipboard:function(){if(app.electron)app.electron.clipboard.writeText(app.editor.getSelectedText()),app.clipboard=app.editor.getSelectedText();else{const t=app.editor.getSelectedText();app.clipboard=t,navigator.clipboard&&t.length>0&&navigator.clipboard.writeText(t).then(()=>{app.clipboard=t})}},InkCompiler:function(){this.errors=[],this.warnings=[],this.errorHandler=(t,e)=>{let n=t.match(/^(ERROR|RUNTIME ERROR): ('([^']+)' )?line (\d+): (.*)/);let i=t.match(/^(WARNING|RUNTIME WARNING|TODO): ('([^']+)' )?line (\d+): (.*)/);n?this.errors.push(t):i&&this.warnings.push(t)},this.compilerOptions=new s.CompilerOptions(null,[],!1,this.errorHandler),this.ready=!1,this.worker=null,this.onComplete=()=>{},this.init=(t=(()=>{}))=>(this.onComplete=t,new Promise((t,e)=>{t()})),this.submit=t=>{this.errors=[],this.warnings=[];const e=new s.Compiler(t,this.compilerOptions).Compile().ToJson(),n={story:JSON.parse(e),warnings:this.warnings,errors:this.errors};this.onComplete(n)},this.getInkErrorGotoNode=async(t,e)=>{const n=e.substr(e.lastIndexOf(":")+1,e.length).trim();try{const t=Number(e.match(/line ([0-9]+):/)[1]);return{ln:t,node:(await c.getSaveData(o.FILETYPE.INK,t)).title,find:n}}catch(t){return console.error(t),null}}},InkGlobalScopeNodeName:"INK_GLOBAL_SCOPE",goToErrorInkNode:(t,e)=>{c.inkCompiler.getInkErrorGotoNode(t,e).then(t=>{if(t){const{node:e,ln:n,find:i}=t;app.openNodeByTitle(e,i)}})}}}).call(this,n("Z1dp"),n("EVdn"))},3:function(t,e){},"3ozf":function(t,e,n){},4:function(t,e){},5:function(t,e){},"5aMW":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var i=n("tUqF"),r=n("qVgP");const{JSONEditor:o}=n("0PmM");var a=function({app:e,createButton:a,addSettingsItem:s,getPluginStore:l,onYarnEditorOpen:c,onYarnInPreviewMode:u,onYarnSavedNode:d,onYarnSetDocumentType:p,onKeyUp:h,onKeyDown:f,onLoad:m,setPluginStore:y}){const g=this;this.name="Runner",this.onOpenDialog=async()=>{let t=null;const{value:e}=await Swal.fire({title:"Playtest starting variables",html:'
        ',focusConfirm:!1,customClass:"swal-wide",onOpen:()=>{n("1mrn"),t=new o(document.getElementById("jsoneditor"),{schema:{type:"array",format:"table",title:"Playtest values",uniqueItems:!0,items:{type:"object",title:"Variable",format:"grid",properties:{key:{type:"string",default:"myVar"},value:{type:"string",default:"true"}}}}});const e=l(g.name);t.setValue("object"!=typeof e.variables?[{key:"er",value:"erd"}]:e.variables),y(g.name,"runnerVariablesOpen",!0)},preConfirm:()=>(y(g.name,"runnerVariablesOpen",!1),t.getValue())});e&&y(g.name,"variables",e)},m(()=>{s({title:"Playtesting Style",valueKey:"playtestStyle",defaultValue:"chat",optionsKey:"availablePlaytestStyles",options:[{id:"npc",name:"Npc bubble"},{id:"chat",name:"Chat messages"}],setterKey:"setPlaytestStyle",settingsColumn:"A"}),a(g.name,{name:"Playtest variables",attachTo:"fileMenuDropdown",onClick:"onOpenDialog()",iconName:"cog"}),l(g.name).runnerVariablesOpen&&g.onOpenDialog()});const b=()=>{if("yarn"===e.settings.documentType())this.previewStory=new i.a,this.gotoLastPlayNode=function(){e.editing()&&e.editing().title()!==g.previewStory.node.title&&e.openNodeByTitle(g.previewStory.node.title),e.editor.focus()},this.advanceStoryPlayMode=function(t=5){g.previewStory.finished?(g.togglePlayMode(!1),g.gotoLastPlayNode()):(g.previewStory.changeTextScrollSpeed(t),-1!=g.previewStory.vnSelectedChoice&&5===t&&g.previewStory.vnSelectChoice())},this.togglePlayMode=function(n=!1){const i=t(".editor")[0],r=document.getElementById("storyPlayButton"),o=document.getElementById("editor-play");if(t("#editor-play").addClass("inYarnMode"),t("#commandDebugLabel").addClass("inYarnMode"),e.isEditorInPlayMode(n),n){i.style.display="none",t(".bbcode-toolbar").addClass("hidden"),o.style.display="flex",t(r).addClass("disabled"),g.previewStory.emiter.on("finished",(function(){g.togglePlayMode(!1),g.gotoLastPlayNode()})),g.previewStory.emiter.on("startedNode",(function(t){e.isEditorSplit&&e.workspace.warpToNode(e.getFirstFoundNode(t.title.toLowerCase().trim()))}));const n=l(g.name);console.log("variables",n),e.data.getSaveData("json").then(t=>{g.previewStory.initYarn(JSON.parse(t),e.editing().title().trim(),"NVrichTextLabel",!1,"commandDebugLabel",e.settings.playtestStyle(),n.variables||[])})}else e.editor.session.setScrollTop(o.scrollTop),o.style.display="none",i.style.display="flex",t(r).removeClass("disabled"),t(".bbcode-toolbar").removeClass("hidden"),t(".toggle-toolbar").removeClass("hidden"),t(".editor-counter").removeClass("hidden"),g.previewStory.terminate()},u(()=>g.togglePlayMode(!1)),d(()=>g.togglePlayMode(!1)),c(()=>{a(g.name,{iconName:"play",title:"Preview",attachTo:"bbcodeToolbar",onClick:"togglePlayMode(true)",className:"bbcode-button bbcode-button-right",id:"storyPlayButton"});const t=document.createElement("div");t.innerHTML=`\n
        \n

        \n
        \n
        \n `,document.getElementById("editorContainer").appendChild(t),f(t=>{if(e.editing()&&!g.previewStory.finished)switch(t.keyCode){case e.input.keys.Z:g.previewStory.changeTextScrollSpeed(10),-1!=g.previewStory.vnSelectedChoice&&g.previewStory.vnSelectChoice();break;case e.input.keys.Up:-1!=g.previewStory.vnSelectedChoice&&g.previewStory.vnUpdateChoice(-1);break;case e.input.keys.Down:-1!=g.previewStory.vnSelectedChoice&&g.previewStory.vnUpdateChoice(1)}}),h(t=>{t.keyCode===e.input.keys.Z&&(g.previewStory.changeTextScrollSpeed(200),-1!=g.previewStory.vnSelectedChoice&&g.previewStory.vnSelectChoice())})});else{this.previewStory=new r.a,this.prevSession={story:null,prevSavePoints:[],childNodes:[],recompile:!1};const n=new e.data.InkCompiler;this.togglePlayMode=function(i=!1){const r=t(".editor")[0],o=document.getElementById("storyPlayButton"),a=document.getElementById("editor-play");if(e.isEditorInPlayMode(i),t("#editor-play").addClass("inInkMode"),t("#commandDebugLabel").addClass("inInkMode"),i){a.style.display="flex",t("#editor").addClass("editor-take-half"),g.previewStory.emiter.on("finished",(function(){g.togglePlayMode(!1),g.gotoLastPlayNode()})),g.previewStory.emiter.on("startedNode",(function(t){e.isEditorSplit&&e.workspace.warpToNode(e.getFirstFoundNode(t.title.toLowerCase().trim()))}));const i=l(g.name);console.log("VARIABLES::::",i),e.data.getSaveData("ink",null,!0).then(t=>{g.previewStory.initInk(n,()=>{g.prevSession={...g.prevSession,recompile:!0},g.togglePlayMode(!0)},g.prevSession,t,e.editing().title().trim(),"NVrichTextLabel",!1,"commandDebugLabel",e.settings.playtestStyle(),i.variables||[])})}else e.editor.session.setScrollTop(a.scrollTop),a.style.display="none",r.style.display="flex",t("#editor").removeClass("editor-take-half"),t(o).removeClass("disabled"),g.prevSession={prevSavePoints:g.previewStory.prevSavePoints,story:g.previewStory.story,childNodes:g.previewStory.textAreaEl?[...g.previewStory.textAreaEl.childNodes]:[],recompile:!1},g.previewStory.terminate();e.editor.resize()},u(()=>g.togglePlayMode(!1)),d(()=>g.togglePlayMode(!1)),this.advanceStoryPlayMode=function(t=5){},c(()=>{a(g.name,{iconName:"play",title:"Preview",attachTo:"bbcodeToolbar",onClick:"togglePlayMode(!app.isEditorInPlayMode())",className:"bbcode-button bbcode-button-right",id:"storyPlayButton"});const t=document.createElement("div");t.innerHTML=`\n
        \n

        \n
        \n
        \n `,document.getElementById("editorContainer").appendChild(t)})}};b(),p(b),e.togglePlayMode=this.togglePlayMode}}).call(this,n("EVdn"))},"5dEm":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));var i=n("oj90");const r=function(e){const n=this,r={toast:!0,position:"bottom",icon:"error",title:"Alignment requires two or more nodes be selected.",showConfirmButton:!1,timer:3500,timerProgressBar:!0};this.canvas=t(".arrows")[0],this.context=n.canvas.getContext("2d"),this.gridCanvas=t("#grid-canvas")[0],this.gridContext=n.gridCanvas.getContext("2d"),this.gridEnabled=!0,this.updateArrowsThrottle=50,this.updateArrowsInterval=void 0,this.deferredArrowsDrawInterval=void 0,this.nextArrowsUpdate=Number.NEGATIVE_INFINITY,this.isDrawingArrows=!1,this.selectedNodes=[],this.scale=1,this.offset={x:0,y:0},this.transform={x:0,y:0},this.isMarqueeEnabled=!1,this.marqueeSelection=[],this.marqueeRect={x1:0,y1:0,x2:0,y2:0},this.marqueeOffset=[0,0],this.zoomSpeed=.005,this.zoomLimitMin=.05,this.zoomLimitMax=1,this.setThrottle=function(t,e){const r=e?e.target.value:t;n.updateArrowsThrottle=i.Utils.clamp(r,16,250)},this.setTranslation=function(t,e,i=0){n.transform.x=t,n.transform.y=e,n.translate(i)},this.shiftTranslation=function(t,e,i=0){n.setTranslation(n.transform.x+t,n.transform.y+e,i)},this.translate=function(e){e&&n.startUpdatingArrows(),t(".nodes-holder").finish().transition({transform:"matrix("+n.scale+",0,0,"+n.scale+","+n.transform.x+","+n.transform.y+")"},e||0,"easeInQuad",(function(){e&&n.stopUpdatingArrows(),n.updateArrows(),n.updateGrid()}))},this.toWorkspaceCoordinates=(t,i)=>e.settings.snapGridEnabled()?{x:n.stepify((t-n.transform.x)/n.scale,e.settings.gridSize()),y:n.stepify((i-n.transform.y)/n.scale,e.settings.gridSize())}:{x:(t-n.transform.x)/n.scale,y:(i-n.transform.y)/n.scale},this.onPanLeft=function(){n.shiftTranslation(n.getPanAmount(),0,100)},this.onPanRight=function(){n.shiftTranslation(-n.getPanAmount(),0,100)},this.onPanUp=function(){n.shiftTranslation(0,n.getPanAmount(),100)},this.onPanDown=function(){n.shiftTranslation(0,-n.getPanAmount(),100)},this.getPanAmount=function(){return e.input.isShiftDown?100*n.scale:500*n.scale},this.setZoom=function(t){n.scale=t/4,n.translate(200)},this.onZoom=function(t,e,r){const o=n.scale,a=r*n.zoomSpeed*n.scale;n.scale=i.Utils.clamp(n.scale+a,n.zoomLimitMin,n.zoomLimitMax);const s=t-n.transform.x,l=e-n.transform.y,c=s-s*(n.scale/o),u=l-l*(n.scale/o);n.shiftTranslation(c,u)},this.onDragStart=function(t){n.offset.x=t.x,n.offset.y=t.y},this.onDragUpdate=function(t){n.isMarqueeEnabled&&e.workspace.onMarqueeEnd(),e.workspace.shiftNodes(t)},this.onDragEnd=function(){e.data.saveAppStateToLocalStorage()},this.onMarqueeStart=function(t){n.isMarqueeEnabled=!0,n.offset.x=t.x,n.offset.y=t.y,n.marqueeSelection=[],n.marqueeOffset[0]=0,n.marqueeOffset[1]=0,n.marqueeRect={x1:0,y1:0,x2:0,y2:0}},this.onMarqueeUpdate=function(t){n.isMarqueeEnabled&&(n.updateMarqueeRect(t),n.selectNodesInsideMarquee())},this.updateMarqueeRect=function(e){e.x>n.offset.x&&e.yn.offset.x&&e.y>n.offset.y?(n.marqueeRect.x1=n.offset.x,n.marqueeRect.y1=n.offset.y,n.marqueeRect.x2=e.x,n.marqueeRect.y2=e.y):e.x{const e=n.marqueeSelection.indexOf(t),r=e>=0,a=t.x(),s=t.y(),l={left:a,right:a+t.width,top:s,bottom:s+t.height},c=i.Utils.rectanglesOverlap(o,l);c&&!r&&(n.selectNodes(t),n.marqueeSelection.push(t)),!c&&r&&(n.deselectNodes(t),n.marqueeSelection.splice(e,1))})},this.onMarqueeEnd=function(){n.isMarqueeEnabled&&(0==n.marqueeSelection.length&&n.deselectAll(),n.isMarqueeEnabled=!1,n.marqueeSelection=[],n.marqueeRect={x1:0,y1:0,x2:0,y2:0},t("#marquee").css({display:"none",x:0,y:0,width:0,height:0}))},this.shiftNodes=function(t){const e={x:t.x-n.offset.x,y:t.y-n.offset.y};n.shiftTranslation(e.x,e.y),n.offset=t},this.updateGrid=function(){const i=t(".nodes-holder").offset(),r=e.settings.gridSize();if(n.gridContext.clearRect(0,0,n.gridCanvas.width,n.gridCanvas.height),e.settings.snapGridEnabled()){const s=t(window).width(),l=t(window).height(),c=i.left%(r*n.scale),u=i.top%(r*n.scale);n.gridContext.beginPath(),n.gridContext.lineWidth=.5;for(var o=c;o=315?(p=!0,f=(n.x()+n.width)*a+o.left,m=(n.y()+n.halfHeight)*a+o.top,y=t.x()*a+o.left-l,g=(t.y()+t.halfHeight)*a+o.top,d.push({x1:y+l,y1:g,x2:y-l,y2:g-c,x3:y-l,y3:g+c})):h>45&&h<135?(p=!1,f=(n.x()+n.halfWidth)*a+o.left,m=n.y()*a+o.top,y=(t.x()+t.halfWidth)*a+o.left,g=(t.y()+n.height)*a+o.top+c,d.push({x1:y,y1:g-c,x2:y-l,y2:g+c,x3:y+l,y3:g+c})):h>=135&&h<=225?(p=!0,f=n.x()*a+o.left,m=(n.y()+n.halfHeight)*a+o.top,y=(t.x()+t.width)*a+o.left+l,g=(t.y()+t.halfHeight)*a+o.top,d.push({x1:y-l,y1:g,x2:y+l,y2:g-c,x3:y+l,y3:g+c})):h>225&&h<315&&(p=!1,f=(n.x()+n.halfWidth)*a+o.left,m=(n.y()+n.height)*a+o.top,y=(t.x()+t.halfWidth)*a+o.left,g=t.y()*a+o.top-c,d.push({x1:y,y1:g+c,x2:y-l,y2:g-c,x3:y+l,y3:g-c})),u.push({x1:f,y1:m,x2:y,y2:g,drawHorizontal:p})}n.context.beginPath();for(let t of u)n.context.moveTo(t.x1,t.y1),"straight"===e.settings.lineStyle()?n.context.lineTo(t.x2,t.y2):!0===t.drawHorizontal?n.context.bezierCurveTo(t.x2,t.y1,t.x1,t.y2,t.x2,t.y2):n.context.bezierCurveTo(t.x1,t.y2,t.x2,t.y1,t.x2,t.y2);n.context.stroke(),n.context.beginPath();for(let t of d)n.context.moveTo(t.x1,t.y1),n.context.lineTo(t.x2,t.y2),n.context.lineTo(t.x3,t.y3);n.context.fill(),n.isDrawingArrows=!1},this.bringToFront=function(e){const n=t(e),r=i.Utils.getHighestZ(n.parent());n.css("z-index",r+1)},this.selectAll=function(){n.selectNodes(e.nodes())},this.deselectAll=function(){n.deselectNodes(e.nodes())},this.selectNodes=function(t){const i=Array.isArray(t)?t:[t];for(let t of i)if(t.active()&&!n.selectedNodes.includes(t)&&e.canEditNodeMeta(t.title())){if(e.input.isScreenTouched&&e.input.isDragging)return;n.selectedNodes.push(t),t.setSelected(!0)}},this.deselectNodes=function(t){const e=Array.isArray(t)?t:[t];for(let t of e){const e=n.selectedNodes.indexOf(t);t.active()&&e>=0&&(n.selectedNodes.splice(e,1),t.setSelected(!1))}},this.getSelectedNodes=function(){return 1===n.selectedNodes.length?[n.selectedNodes[0]]:Array.apply(this,n.selectedNodes)},this.warpToNodeByIdx=function(t){n.warpToNode(e.nodes()[t]),e.focusedNodeIdx=t},this.warpToSelectedNodeByIdx=function(t){n.warpToNode(n.getSelectedNodes()[t]),e.focusedNodeIdx=t},this.warpToNode=function(e){if(e){var i=t(e.element);n.warpToXY(e.x()||e.createX,e.y()||e.createY),i.clearQueue(),i.transition({outlineColor:"pink",outlineWidth:2,outlineOffset:0},500),setTimeout(()=>{i.transition({outlineColor:"transparent",outlineWidth:1,outlineOffset:50},300)},700)}},this.warpToXY=function(i,r){const o=-i*n.scale,a=-r*n.scale,s=t(window).width()/2,l=t(window).height()/2,c=100*n.scale/2,u=100*n.scale/2;n.setTranslation(o+s-c+e.getSplitEditorXOffset(),a+l-u,100)},this.alignV=function(){if(e.input.isCtrlDown)return void n.reduceAlignV();const t=e.nodes().filter(t=>t.selected).sort((t,e)=>t.y()>e.y()?1:t.y(){t.moveTo(i.x(),t.y())})},this.reduceAlignV=function(){const t=e.settings.gridSize(),i=e.nodes().filter(t=>t.selected).sort((t,e)=>t.y()>e.y()?1:t.y(){const i=e.settings.snapGridEnabled()?o.y()+t.height*(n+1)+a*(n+1):o.y()+210*(n+1);t.moveTo(o.x(),i)})},this.alignH=function(){if(e.input.isCtrlDown)return void n.reduceAlignH();const t=e.nodes().filter(t=>t.selected).sort((t,e)=>t.x()>e.x()?1:t.x(){t.moveTo(t.x(),i.y())})},this.reduceAlignH=function(){const t=e.settings.gridSize(),i=e.nodes().filter(t=>t.selected).sort((t,e)=>t.x()>e.x()?1:t.x(){const i=e.settings.snapGridEnabled()?o.x()+t.width*(n+1)+a*(n+1):o.x()+210*(n+1);t.moveTo(i,o.y())})},this.arrangeSpiral=function(){const t=n.getSelectedNodes();t.length<2?Swal.fire(r):(t.forEach((t,i)=>{t.moveTo(e.settings.snapGridEnabled()?n.stepify(Math.cos(.5*i)*(600+30*i),e.settings.gridSize()):Math.cos(.5*i)*(600+30*i),e.settings.snapGridEnabled()?n.stepify(Math.sin(.5*i)*(600+30*i),e.settings.gridSize()):Math.cos(.5*i)*(600+30*i))}),n.warpToXY(0,0))},this.sortAlphabetical=function(){const i=n.getSelectedNodes().sort((t,e)=>t.title().localeCompare(e.title()));if(i.length<2)return void Swal.fire(r);let o=Math.round(i.length/2),a=0,s=0;const l=t(i[0].element).width()+30,c=t(i[0].element).height()+30,u=e.settings.gridSize();e.settings.snapGridEnabled()&&i[0].moveTo(n.stepify(i[0].x(),u),n.stepify(i[0],u)),i.forEach((t,n)=>{n%o?a+=1:(s+=1,a=0),1===n&&(s=0);const r=i[0].x()+i[0].width,d=u-r%u+u,p=i[0].y()+i[0].height,h=u-p%u+u;t.moveTo(e.settings.snapGridEnabled()?i[0].x()+a*t.width+a*d:i[0].x()+a*l,e.settings.snapGridEnabled()?i[0].y()+s*t.height+s*h:i[0].y()+s*c)}),n.warpToNode(i[0])},this.stepify=function(t,e){return Math.round(t/e)*e}}}).call(this,n("EVdn"))},6:function(t,e){},7:function(t,e){},8:function(t,e){},9:function(t,e){},INAQ:function(t,e,n){"use strict";(function(t,i){n.d(e,"a",(function(){return o}));var r=n("oj90");const o=function(e){const n=this,o=Object.freeze({Left:0,Middle:1,Right:2}),a=Object.freeze({Enter:13,Escape:27,Space:32,Left:37,Up:38,Right:39,Down:40,Delete:46,A:65,C:67,D:68,O:79,S:83,V:86,W:87,X:88,Y:89,Z:90});this.keys=a,this.mouse={x:0,y:0},this.isDragging=!1,this.isScreenTouched=!1,this.isMiddleButtonDown=!1,this.isLeftButtonDown=!1,this.isShiftDown=!1,this.isCtrlDown=!1,this.isHoverOverWorkspace=!1,this.trackMouseEvents=function(){t(document).on("pointerdown",t=>{if(n.isDragging="nodes"===t.target.className||"body"===t.target.className&&(n.isMiddleButtonDown||0===e.workspace.selectedNodes.length),n.mouse.x=t.pageX,n.mouse.y=t.pageY,n.isMiddleButtonDown=t.button===o.Middle,this.isLeftButtonDown=t.button===o.Left,e.inWorkspace()){if(n.isDragging)switch(t.button){case o.Left:"nodes"===t.target.className&&e.workspace.onMarqueeStart({x:t.pageX,y:t.pageY});break;case o.Middle:e.workspace.onDragStart({x:t.pageX,y:t.pageY})}}else e.inEditor()&&t.button===o.Right&&(e.guessPopUpHelper(),t.preventDefault())}),window.addEventListener("touchstart",()=>{n.isScreenTouched=!0}),t(document).on("pointermove",t=>{n.mouse.x=t.pageX,n.mouse.y=t.pageY}),t(document).on("mousemove touchmove",t=>{if(n.isDragging){e.focusedNodeIdx=-1;const i=n.isScreenTouched&&t.changedTouches?t.changedTouches[0].pageX:t.pageX,r=n.isScreenTouched&&t.changedTouches?t.changedTouches[0].pageY:t.pageY;e.inWorkspace()&&(t.altKey||n.isMiddleButtonDown||n.isScreenTouched?e.workspace.onDragUpdate({x:i,y:r}):e.workspace.onMarqueeUpdate({x:i,y:r}))}}),t(document).on("pointerup touchend",t=>{n.isScreenTouched=!1,n.isDragging=!1,t.button===o.Left&&(n.isLeftButtonDown=!1),t.button===o.Middle&&(n.isMiddleButtonDown=!1),e.inWorkspace()&&(e.workspace.onDragEnd(),e.workspace.onMarqueeEnd())}),t(".nodes").mousewheel(t=>{t.altKey||(e.inWorkspace()||n.isHoverOverWorkspace)&&(e.workspace.onZoom(t.pageX,t.pageY,t.deltaY),t.preventDefault())}),t(".nodes").hover(()=>{n.isHoverOverWorkspace=!0},()=>{n.isHoverOverWorkspace=!1}),t(".nodes").on("pointerdown",()=>{e.isEditorSplit&&(e.focusEditor(!1),e.makeNewNodesFromLinks(),e.propagateUpdateFromNode(e.editing()),e.mustUpdateTags=!0,e.updateTagsRepository(),e.workspace.updateArrows())}),t(document).contextmenu(n=>{if(!e.inWorkspace())return;const i=t(n.target).hasClass("nodes")||t(n.target).parents(".nodes").length;if(n.button===o.Right&&i){const{x:t,y:i}=e.workspace.toWorkspaceCoordinates(n.pageX,n.pageY);e.newNodeAt(t,i)}return!i})},this.trackKeyboardEvents=function(){t(document).on("keyup keydown",t=>{n.isShiftDown=t.shiftKey,n.isCtrlDown=t.ctrlKey}),t(document).on("keyup",(function(t){if(t.keyCode===a.Space){if(e.inWorkspace()&&t.altKey||e.inEditor()&&!t.altKey)return;e.workspace.scale=1;const n=e.workspace.getSelectedNodes(),i=n.length>0,r=i>0?n:e.nodes();++e.focusedNodeIdx,(e.focusedNodeIdx<0||e.focusedNodeIdx>=r.length)&&(e.focusedNodeIdx=0),e.inWorkspace()?i?e.workspace.warpToSelectedNodeByIdx(e.focusedNodeIdx):e.workspace.warpToNodeByIdx(e.focusedNodeIdx):e.inEditor()&&e.editNode(e.nodes()[e.focusedNodeIdx])}})),t(document).on("keydown",t=>{if(e.inWorkspace()){if((t.metaKey||t.ctrlKey)&&t.shiftKey)switch(t.keyCode){case a.S:e.data.trySave(r.FILETYPE.JSON);break;case a.A:e.data.tryAppend()}if((t.metaKey||t.ctrlKey)&&t.altKey)switch(t.keyCode){case a.S:e.data.trySaveCurrent()}else if(t.metaKey||t.ctrlKey)switch(t.keyCode){case a.C:e.nodeClipboard=e.cloneNodeArray(e.workspace.getSelectedNodes());break;case a.D:e.workspace.deselectAll();break;case a.O:e.data.tryOpenFile();break;case a.S:e.data.trySaveCurrent();break;case a.X:const t=e.workspace.getSelectedNodes();e.nodeClipboard=e.cloneNodeArray(t),e.deleteNodes(t);break;case a.Y:e.historyDirection("redo");break;case a.Z:e.historyDirection("undo")}else t.keyCode===a.Delete||"Delete"===t.key?e.confirmDeleteNodes(e.workspace.getSelectedNodes()):e.$searchField.is(":focus")||t.ctrlKey||t.metaKey||(t.keyCode===a.A||t.keyCode===a.Left?e.workspace.onPanLeft():t.keyCode===a.D||t.keyCode===a.Right?e.workspace.onPanRight():t.keyCode===a.W||t.keyCode===a.Up?e.workspace.onPanUp():t.keyCode!==a.S&&t.keyCode!==a.Down||e.workspace.onPanDown())}}),t(document).on("keyup",t=>{if(e.inWorkspace())if(t.metaKey||t.ctrlKey)switch(t.keyCode){case a.A:e.workspace.selectAll();break;case a.V:e.pasteNodes()}else if(t.keyCode===a.Enter||"Enter"===t.key){const t=e.nodes()[e.focusedNodeIdx];t?e.editNode(t):e.editNode(e.nodes()[0])}}),t(document).on("keydown",(function(t){if(e.inEditor())if(t.metaKey||t.ctrlKey)switch(t.keyCode){case a.C:n.clipboard=e.editor.getSelectedText();break;case a.X:document.execCommand("copy"),e.clipboard=e.editor.getSelectedText(),e.insertTextAtCursor("");break;case a.S:e.data.trySaveCurrent()}else switch(t.keyCode){case a.Escape:e.saveNode(),e.closeEditor()}})),t(document).on("keyup",(function(t){if(e.inEditor()&&(t.metaKey||t.ctrlKey)&&t.altKey)switch(t.keyCode){case a.Enter:e.saveNode(),e.closeEditor()}})),t(document).on("keydown",(function(t){if(e.ui.settingsDialogVisible())switch(t.keyCode){case a.Escape:e.ui.closeSettingsDialog()}})),t(document).on("keyup keydown pointerdown pointerup",(function(t){e.inEditor()&&e.updateEditorStats()}))},this.initKnockoutBindings=function(){i.bindingHandlers.preventBubble={init:function(t,e){var n=i.utils.unwrapObservable(e());i.utils.registerEventHandler(t,n,(function(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}))}},i.bindingHandlers.mousedown={init:function(e,n,r,o,a){var s=i.unwrap(n());t(e).mousedown((function(){s()}))}}};n.initKnockoutBindings(),n.trackMouseEvents(),n.trackKeyboardEvents()}}).call(this,n("EVdn"),n("Z1dp"))},P0sH:function(t,e,n){"use strict";(function(t,i){n.d(e,"a",(function(){return h}));var r=n("owJe"),o=n("W2Rx"),a=n("5dEm"),s=n("INAQ"),l=n("pYPP"),c=n("fkuv"),u=n("2Qx2"),d=n("oj90"),p=n("l8+o"),h=function(e,h){const f=this;this.utils=d.Utils,this.setTheme=function(e,n){let i=n?n.target.value:e;setTimeout(f.initGrid,50),setTimeout(f.workspace.updateArrows,50),t("#theme-stylesheet").attr("href",d.Utils.getPublicPath(`themes/${i}.css`))},this.setLanguage=function(t,e){const n=e?e.target.value:t;Object(r.load_dictionary)(f.settings.language().split("-")[0]);const i=new CustomEvent("yarnSetLanguage");i.language=n,window.dispatchEvent(i),window.parent.dispatchEvent(i)},this.setDocumentType=function(t,e){const n=e?e.target.value:t;f.settings.documentType(n),console.log("Set doc type",t,app.data.inkCompiler),"ink"===n?(null===app.data.inkCompiler&&(app.data.inkCompiler=new app.data.InkCompiler),u.a.addGlobalScopeToInkDoc(),app.setMarkupLanguage("html")):app.data.inkCompiler=null,app.updateNodeLinks();const i=new CustomEvent("yarnSetDocumentType");i.language=n,window.dispatchEvent(i),window.parent.dispatchEvent(i)},this.setMarkupLanguage=function(t,e){const n=e?e.target.value:t;app.settings.markupLanguage(n),f.richTextFormatter=new p.a(f),f.mustRefreshNodes.notifySubscribers()},this.setFiletypeVersion=function(t,e){const n=e?e.target.value:t;f.filetypeVersion=n},this.setGistCredentials=function(t,e){const{token:i,file:r}=t,o=new(n("XZLo"))({token:i});f.gists=o,f.gists.file=r},this.input=new s.a(f),this.settings=new l.a(f),this.workspace=new a.a(f),this.ui=new c.a(f),this.richTextFormatter=new p.a(f),this.data=u.a,this.name=i.observable(e),this.version=i.observable(h),this.editing=i.observable(null),this.nodes=i.observableArray([]),this.tags=i.observableArray([]),this.mustRefreshNodes=i.observable(),this.mustUpdateTags=!0,this.nodeHistory=[],this.nodeFuture=[],this.editingHistory=[],this.editingSaveHistoryTimeout=null,this.focusedNodeIdx=-1,this.isElectron=!1,this.editor=null,this.nodeVisitHistory=[],this.plugins={pluginStorage:{}},this.clipboard="",this.nodeClipboard=[],this.speachInstance=null,this.editingPath=i.observable(null),this.$searchField=t(".search-field"),this.isEditorInPreviewMode=!1,this.isEditorInPlayMode=i.observable(!1),this.isEditorSplit=!1,this.isEditorFocused=!1,this.editorResizeHandleOptions={handleSelector:"#editor-resize-handle",resizeHeight:!1,resizeWidthFrom:"right",onDragStart:function(){f.isSplitEditorInFocus=!0,t("#node-editor").removeClass("split-editor-out-of-focus")},onDragEnd:function(){f.editor.resize(),f.settings.editorSplitSize(t("#editor-form").width())}},this.inEditor=()=>(f.editing()||f.isEditorSplit&&f.isEditorFocused)&&!f.ui.isDialogOpen(),this.inWorkspace=()=>(!f.editing()||f.isEditorSplit&&!1===f.isEditorFocused)&&!f.ui.isDialogOpen(),this.run=function(){var e="Unknown OS";-1!=navigator.platform.indexOf("Win")&&(e="Windows"),-1!=navigator.platform.indexOf("Mac")&&(e="MacOS"),-1!=navigator.platform.indexOf("X11")&&(e="UNIX"),-1!=navigator.platform.indexOf("Linux")&&(e="Linux"),-1!=navigator.platform.indexOf("Linux")&&(e="Linux"),f.isElectron=navigator.userAgent.toLowerCase().includes("electron");var n=navigator.userAgent||navigator.vendor||window.opera;let r;/android|iPad|iPhone|iPod/.test(n.toLowerCase())&&!window.MSStream&&(e="mobile"),"Windows"==e&&(f.workspace.zoomSpeed=.1),window.addEventListener("beforeunload",t=>(this.data.saveAppStateToLocalStorage(),null)),window.addEventListener("DOMContentLoaded",t=>{if(f.electron){const t=f.electron.remote.process.argv.length>1?f.electron.remote.process.argv[1]:null;if(t&&app.fs.existsSync(t))return void this.data.openFileFromFilePath(t)}this.data.loadAppStateFromLocalStorage();const e=new URL(window.location),n=e.searchParams.get("text")||e.searchParams.get("url");null!==n&&f.insertTextAtCursor(n+"\n",!0)});const o=t("#addPwa")[0];o.style.display="none",window.addEventListener("beforeinstallprompt",t=>{t.preventDefault(),r=t,o.style.display="block",o.addEventListener("click",t=>{o.style.display="none",r.prompt(),r.userChoice.then(t=>{"accepted"===t.outcome?(console.log("User accepted the A2HS prompt"),o.style.display="none"):console.log("User dismissed the A2HS prompt"),r=null})})}),t("#app").show(),i.applyBindings(f,t("#app")[0]),f.editingVisualStudioCodeFile()||f.newNode().title("Start"),f.settings.apply(),t(".search-title input").click(f.updateSearch),t(".search-body input").click(f.updateSearch),t(".search-tags input").click(f.updateSearch),f.$searchField.on("input",f.updateSearch),f.$searchField.on("keyup",(function(t){27==t.keyCode?f.clearSearch():f.searchWarp()})),"mobile"===e&&f.workspace.setZoom(3),t(window).on("resize",(function(){f.ui.isScreenNarrow()&&f.editing()&&f.isEditorSplit&&f.toggleEditorView(),f.workspace.updateArrows(),f.initGrid()})),setTimeout(f.initGrid,50),this.guessPopUpHelper=function(){/color=#([a-zA-Z0-9]{3,6})$/.test(f.getTagBeforeCursor())&&f.insertColorCode()},this.insertEmoji=function(){this.emPicker.toggle(),f.togglePreviewMode(!0),t("#emojiPicker-container").css({left:f.input.mouse.x-200,top:f.input.mouse.y-125}),t("#emojiPicker-container").show()},this.insertColorCode=function(){t("#colorPicker-container").is(":visible")||(t("#colorPicker").spectrum("set",f.editor.getSelectedText()),t("#colorPicker").spectrum("toggle"),t("#colorPicker-container").css({left:f.input.mouse.x-70,top:f.input.mouse.y-50}),t("#colorPicker-container").show(),f.togglePreviewMode(!0),setTimeout(()=>{const e=t("#colorPicker").spectrum("get");f.applyPickerColorEditor(e)},100))},this.applyPickerColorEditor=function(t){const e=JSON.parse(JSON.stringify(f.editor.selection.getRange()));f.editor.selection.setRange(e);const n=t.toHexString().replace("#","");f.editor.session.replace(e,n),f.editor.selection.setRange({start:f.editor.getCursorPosition(),end:{row:f.editor.getCursorPosition().row,column:f.editor.getCursorPosition().column-n.length}}),f.togglePreviewMode(!0)},document.addEventListener("contextmenu",(function(t){f.editing()&&t.preventDefault()}),!1),document.ondragover=document.ondrop=t=>{t.preventDefault()},document.body.ondrop=t=>{t.preventDefault();for(var e=0;e{const e=t.data;switch(e.type){case"UpdateNode":f.nodes().forEach(t=>{t.title().trim()===e.payload.originalNodeTitle.trim()&&(t.title(e.payload.title),t.tags(e.payload.tags),t.body(e.payload.body),f.setYarnDocumentIsDirty())})}});var a=new CustomEvent("yarnReady");a.document=document,a.data=u.a,a.app=this,window.dispatchEvent(a),window.parent.dispatchEvent(a);const s=new URLSearchParams(window.location.href.split("?")[1]),l=s.get("gist"),c=s.get("fileName");l&&c&&fetch("https://api.github.com/gists/"+l).then(t=>t.json()).then(t=>{const e=t.files[c].content;u.a.openGist(e,c)})},this.limitNodesUpdate=function(t){f.nodes.extend({rateLimit:{method:"notifyWhenChangesStop",timeout:250}}),t(),f.nodes.limit(t=>()=>t())},this.getNodesConnectedTo=function(t){var e=[],n=f.nodes();for(var i in n)if(n[i]!=t&&n[i].isConnectedTo(t,!0)){var r=!1;for(var o in e)if(e[o]==n[i]){r=!0;break}r||e.push(n[i])}return e},this.matchConnectedColorID=function(t){var e=f.getNodesConnectedTo(t);for(var n in e)e[n].colorID(t.colorID())},this.quit=function(){f.isElectron},this.canEditNodeMeta=function(t){return"ink"!==app.settings.documentType()||t.trim()!==u.a.InkGlobalScopeNodeName},this.sanitiseNodeTitle=function(){"ink"===app.settings.documentType()&&(app.editing().title().startsWith("function ")||app.editing().title(app.editing().title().replace(/[ ]/g,"_")))},this.validateTitle=function(){var e=document.getElementById("editorTitle").value,n=t("#editorTitle");f.getOtherNodeTitles().includes(e)||f.titleExistsTwice(e)?(n.attr("class","title title-error"),n.attr("title","Another node has the same title")):"yarn"!==app.settings.documentType()||RegExp("^[a-z0-9]+$","i").test(e)?(n.removeAttr("title"),n.removeClass("title-error")):(n.attr("class","title title-error"),n.attr("title","Only upper or lower case letters and numbers are allowed in a node title."))},this.refreshWindowTitle=function(){let t="";"LOCAL"===u.a.lastStorageHost()?t="Yarn - "+(u.a.editingPath()||u.a.editingName())+" "+(u.a.isDocumentDirty()?"*":""):"GIST"===u.a.lastStorageHost()&&(t="Gist - "+(u.a.editingPath()||u.a.editingName())+" "+(u.a.isDocumentDirty()?"*":"")),f.electron?f.electron.remote.getCurrentWindow().setTitle(t):document.title=t},this.usingVisualStudioCodeExtension=function(){return!!window.vsCodeApi},this.editingVisualStudioCodeFile=function(){return!0===window.editingVsCodeFile},this.setYarnDocumentIsDirty=function(){f.usingVisualStudioCodeExtension()&&f.editingVisualStudioCodeFile()&&u.a.getSaveData(u.a.editingType()).then(t=>{window.vsCodeApi.postMessage({type:"DocumentEdit",payload:t})})},this.recordNodeAction=function(t,e){if(f.nodeFuture.length>0){for(var n=0;n=0&&f.nodes.splice(e,1),f.updateNodeLinks()}var n=null;if(n="undo"==t?f.nodeHistory.pop():f.nodeFuture.pop()){var i=n.action,r=n.node;"undo"==t?("created"==i?(n.lastX=r.x(),n.lastY=r.y(),e(r)):"removed"==i&&f.recreateNode(r,n.lastX,n.lastY),f.nodeFuture.push(n),f.setYarnDocumentIsDirty()):("created"==i?f.recreateNode(r,n.lastX,n.lastY):"removed"==i&&e(r),f.nodeHistory.push(n),f.setYarnDocumentIsDirty())}},this.recreateNode=function(t,e,n){f.nodes.push(t),t.moveTo(e,n),f.updateNodeLinks()},this.setSelectedColors=function(t){var e=f.workspace.getSelectedNodes();for(var n in e.splice(e.indexOf(t),1),e)e[n].colorID(t.colorID())},this.pasteNodes=function(){f.nodeClipboard.length&&(f.workspace.deselectAll(),f.nodeClipboard.forEach((function(t){var e=new o.a({title:f.getUniqueTitle(t.title()),body:t.body(),tags:t.tags(),colorID:t.colorID(),x:t.createX,y:t.createY});f.nodes.push(e),f.workspace.selectNodes(e),f.recordNodeAction("created",e)})),f.updateNodeLinks())},this.confirmDeleteNodes=function(t){const e=Array.isArray(t)?void 0:t,n=Array.isArray(t)?[...t]:e&&e.selected?[...f.workspace.getSelectedNodes()]:[t];n.length&&Swal.fire({title:"Are you sure?",text:`${n.length} ${1===n.length?"node":"nodes"} will be deleted.`,icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, delete!",cancelButtonText:"No, cancel!",reverseButtons:!0}).then(t=>{t.value&&f.deleteNodes(n)})},this.deleteNodes=function(t){const e=Array.isArray(t)?t:[t],n=[];for(let t=e.length-1;t>=0;--t)n.push(e[t].remove());Promise.all(n).then(()=>{f.limitNodesUpdate(()=>{for(let t=e.length-1;t>=0;--t)f.inEditor()&&f.editing()===e[t]&&f.closeEditor(),f.deleteNode(e[t]);f.updateNodeLinks(),f.workspace.deselectNodes(e),f.workspace.updateArrows()})})},this.deleteNode=function(t){const e=f.nodes.indexOf(t);e>=0&&(f.recordNodeAction("removed",t),f.nodes.splice(e,1)),f.setYarnDocumentIsDirty()},this.cloneNodeArray=function(t){return t.map((function(t){return new o.a({title:t.title(),body:t.body(),tags:t.tags(),colorID:t.colorID(),x:t.x()+10,y:t.y()+10})}))},this.newNode=function(t=!0){var e=new o.a;return f.nodes.push(e),t&&f.updateNodeLinks(),f.recordNodeAction("created",e),e},this.newNodeAt=function(t,e){var n=new o.a({x:t-100,y:e-100});return f.nodes.push(n),f.updateNodeLinks(),f.recordNodeAction("created",n),n},this.searchTextInEditor=function(t=!0){t?f.editor.execCommand("find"):f.editor.searchBox&&f.editor.searchBox.hide()},this.showRandomQuote=function(){t.ajax({url:"https://api.forismatic.com/api/1.0/?",dataType:"jsonp",data:"method=getQuote&format=jsonp&lang=en&jsonp=?",success:function(t){Swal.fire({text:t.quoteText+"\n\n-"+t.quoteAuthor})}})},this.editNode=function(e,n=!0){if(!n&&!e.active())return;if(f.settings.alwaysOpenNodesInVisualStudioCodeEditor())return void f.editNodeInVisualStudioCodeEditor(e);f.editing()&&f.editing()!==e&&f.saveNode(!1),f.isEditorInPlayMode()&&f.togglePlayMode(!1),f.isEditorInPreviewMode&&f.togglePreviewMode(!1),e.oldTitle=e.title(),f.editing(e),f.mustUpdateTags=!0,t("#node-editor-background").css({opacity:0}).transition({opacity:1},250),t("#node-editor").css({y:"-100",opacity:0}).transition({y:"0",opacity:1},250),f.editor=ace.edit("editor"),f.editor.setOptions({scrollPastEnd:.5}),f.editor.focus(),f.editor.navigateFileEnd(),t("#colorPicker").spectrum({flat:!0,showButtons:!1,showInput:!0,showPalette:!0,preferredFormat:"hex",palette:[["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"]],move:function(t){f.applyPickerColorEditor(t)},clickoutFiresChange:!0});const i=ace.require("ace/ext/language_tools"),o=d.Utils.createAutocompleter("ink"===app.settings.documentType()?["divert.target"]:["string.llink","string.rlink"],app.getOtherNodeTitles().map(t=>{const n=f.getNodeByTitle(t);return{word:t,title:t,about:`${n.tags().length>0?`tags: ${n.tags()}
        `:""}Preview:
        ${n.clippedBody()}`,titleStyle:e.titleStyles[n.colorID()]}}),"Node Link");i.setCompleters([o,i.keyWordCompleter,i.textCompleter,i.snippetCompleter]);let a=void 0;f.editor.getSession().on("change",(function(t){const e=f.settings.autoCloseTags();if("insert"===t.action&&e){if(f.richTextFormatter.justInsertedAutoComplete)return void(f.richTextFormatter.justInsertedAutoComplete=!1);a&&clearTimeout(a),a=setTimeout(()=>{a=void 0,f.richTextFormatter.completableTags.forEach(t=>{if(f.getTagBeforeCursor()===t.Start){f.richTextFormatter.justInsertedAutoComplete=!0;let e=t.Completion,n=t.Offset;f.settings.autoCloseBrackets()&&t.BehaviorCompletion&&(e=t.BehaviorCompletion,n+=1),t.Completion&&f.insertTextAtCursor(e),t.Offset&&f.moveEditCursor(n),t.Func&&t.Func()}})},200)}})),this.emPicker=new EmojiPicker(document.getElementById("emojiPickerDom"),t=>{f.insertTextAtCursor(t.char),this.emPicker.toggle(),f.togglePreviewMode(!1)}),Object(r.enable_spellcheck)(),f.toggleInvertColors(),f.toggleShowCounter(),f.toggleSpellCheck(),f.validateTitle(),f.updateEditorStats(),f.updateEditorOptions(),f.$searchField.val().length>0&&t(".search-body input").is(":checked")&&f.editor.findAll(f.$searchField.val()),f.settings.editorSplit()&&(f.splitEditor(),f.workspace.warpToNodeByIdx(e.index()-1)),"right"===f.settings.editorSplitDirection()?(t("#editor-form").addClass("split-editor-right"),t("#editor-resize-handle").addClass("float-right")):(t("#editor-form").removeClass("split-editor-right"),t("#editor-resize-handle").removeClass("float-right")),t(".node-editor").on("pointerdown","> *",(function(t){f.isEditorSplit&&(f.focusEditor(!0),t.stopPropagation())})),t(".app-info").hide(),f.editor.resize(),null!=e.undoManager&&f.editor.session.setUndoManager(e.undoManager);var s=new CustomEvent("yarnEditorOpen");s.document=document,s.data=u.a,s.app=app,window.dispatchEvent(s),window.parent.dispatchEvent(s)},this.splitEditor=function(){f.isEditorSplit=!0,f.focusEditor(!0),f.settings.editorSplit(!0),f.editorResizeHandleOptions.resizeWidthFrom="right"===f.settings.editorSplitDirection()?"left":"right",t("#editor-form").width(f.settings.editorSplitSize()).addClass("split-editor").toggleClass("split-editor-right","right"===f.settings.editorSplitDirection()).resizable(f.editorResizeHandleOptions),t("#node-editor-background").addClass("hidden"),t("#node-editor").css({"z-index":10002}),t("#editor-resize-handle").removeClass("hidden").toggleClass("float-right","right"===f.settings.editorSplitDirection()),t("#split-editor-button").addClass("hidden"),t("#snap-editor-button").removeClass("hidden"),t("#exit-editor").removeClass("hidden"),t("#full-size-editor-button").removeClass("hidden"),t("#split-button-separator").removeClass("hidden"),f.ui.checkAndMoveAppButtons()},this.toggleEditorView=function(){f.settings.editorSplit(!f.settings.editorSplit()),f.reopenEditor()},this.reopenEditor=function(){f.saveNode();let t=f.editing();f.closeEditor(),setTimeout(()=>{f.editNode(t)},250)},this.editorSnapToggle=function(){f.settings.editorSplitDirection("right"===f.settings.editorSplitDirection()?"left":"right"),f.reopenEditor()},this.focusEditor=function(e){!0===e?(t("#node-editor").removeClass("split-editor-unfocused"),f.isEditorFocused=!0):(t("#node-editor").addClass("split-editor-unfocused"),f.isEditorFocused=!1)},this.getSplitEditorXOffset=function(){let e=0;return f.inEditor()&&f.settings.editorSplit()&&(e=t("#editor-form").width()/2,"right"===f.settings.editorSplitDirection()&&(e*=-1)),e},this.editNodeInVisualStudioCodeEditor=function(t){f.usingVisualStudioCodeExtension()?(f.setYarnDocumentIsDirty(),window.vsCodeApi.postMessage({type:"OpenNode",payload:{title:t.title().trim(),tags:t.tags().trim(),body:f.trimBodyLinks(t.body().trim())}})):console.error("Tried to open node in Visual Studio Code text editor but we're not in the Visual Studio Code extension")},this.chooseRelativePathImage=function(t){f.insertTextAtCursor(t)},this.getNodeByTitle=function(t){return f.nodes().find(e=>e.title().trim().toLowerCase()===t.trim().toLowerCase())},this.openNodeByTitle=function(t,e=""){f.isEditorInPlayMode()&&f.togglePlayMode(),f.makeNodeWithName(t);const n=f.nodes().find(e=>e.title().trim().toLowerCase()===t.trim().toLowerCase());n&&(f.editNode(n,!0),e&&setTimeout(()=>f.editor.find(e),200))},this.openLastEditedNode=function(){if(0===f.nodeVisitHistory.length)f.saveNode(),f.closeEditor();else{const t=f.nodeVisitHistory.pop();f.propagateUpdateFromNode(f.editing()),f.openNodeByTitle(t)}},this.getSpellCheckSuggestionItems=function(){var t=Object(r.suggest_word_for_misspelled)(f.editor.getSelectedText());if(t){var e={};return t.forEach(t=>{e[t]={name:t,icon:"edit",callback:t=>{f.insertTextAtCursor(t)}}}),e}return!1},this.getThesaurusItems=function(){var t=n("GLdW")(f.editor.getSelectedText());if(!t)return!1;var e=[];if(Object.keys(t).forEach((function(n){t[n].forEach((function(t){e.includes(t)||t===n||e.push(t)}))})),e.length>0){var i={};return e.forEach(t=>{i[t]={name:t,icon:"edit",callback:t=>{f.insertTextAtCursor(t)}}}),i}return!1},this.toggleSpellCheck=function(){setTimeout((function(){f.settings.spellcheckEnabled()?Object(r.enable_spellcheck)():Object(r.disable_spellcheck)()}),50)},this.toggleInvertColors=function(){const e=f.settings.invertColorsEnabled()?{filter:"invert(100%)"}:{filter:"invert(0%)"};t("#app").css(e),t("#app-bg").css(e),t(".tooltip").css(e),t(".node .body").css(e),t(".editor-container .editor-preview").css(e)},this.initGrid=function(){if(f.settings.snapGridEnabled()){var e=t(window).width(),n=t(window).height();t("#grid-canvas").attr("width",e),t("#grid-canvas").attr("height",n),t("#gridSize").attr("disabled",!1),f.workspace.gridContext.strokeStyle=f.workspace.gridContext.fillStyle=t(".grid-canvas").css("color")}else t("#gridSize").attr("disabled",!0);app.workspace.updateGrid()},this.toggleShowCounter=function(){f.settings.editorStatsEnabled()?t(".node-editor .form .editor-counter").css({display:"initial"}):t(".node-editor .form .editor-counter").css({display:"none"})},this.toggleAutocompleteSuggestions=function(){f.settings.autocompleteSuggestionsEnabled(!f.settings.autocompleteSuggestionsEnabled()),f.updateEditorOptions()},this.toggleAutoCloseBrackets=function(){f.settings.autoCloseBrackets(!f.settings.autoCloseBrackets()),f.updateEditorOptions()},this.updateEditorOptions=function(){f.editor.setOptions({enableBasicAutocompletion:app.settings.autocompleteSuggestionsEnabled(),enableLiveAutocompletion:app.settings.autocompleteSuggestionsEnabled(),behavioursEnabled:app.settings.autoCloseBrackets()})},this.togglePreviewMode=function(e){const n=t(".editor")[0],i=t("#editor-preview")[0];f.isEditorInPreviewMode=e,app.ui.dispatchEvent("yarnInPreviewMode"),e?(t(".bbcode-toolbar").addClass("hidden"),n.style.display="none",i.style.display="block",i.innerHTML=f.richTextFormatter.richTextToHtml(f.editing().body(),!0),i.scrollTop=f.editor.renderer.scrollTop):(t(".bbcode-toolbar").removeClass("hidden"),f.editor.session.setScrollTop(i.scrollTop),i.innerHTML="",i.style.display="none",n.style.display="flex",f.editor.focus(),f.editor.resize(),t("#colorPicker-container").is(":visible")&&t("#colorPicker-container").hide(),t("#emojiPicker-container").is(":visible")&&t("#emojiPicker-container").hide())},this.appendText=function(t){f.editing().body(f.editing().body()+t);const e=f.editor.session.getLength()-1,n=f.editor.session.getLine(e).length;f.editor.gotoLine(e+1,n)},this.moveEditCursor=function(t){const e=f.editor.getCursorPosition();f.editor.gotoLine(e.row+1,e.column+t),f.editor.focus()},this.insertTextAtCursor=function(t,e=!1){if(!f.editing())return;f.editor.session.replace(f.editor.selection.getRange(),"");const n=f.editor.getCursorPosition();if(f.editor.session.insert(n,t),e){const t=f.editor.getCursorPosition();editor.scrollToLine(t.row,!0,!0,(function(){})),f.editor.focus()}f.updateEditorStats(),f.editor.focus()},this.getTagBeforeCursor=function(){const t=f.editor.getSelectionRange(),e=t.start.row,n=f.editor.session.getLine(e).substring(t.start.column-2,t.start.column+2);if(!n)return"";if("ink"===app.settings.documentType()){if(["->"].includes(n.trim()))return n.trim()}else if(["[[","<<"].includes(n.trim())||n.includes("|"))return n.trim();return f.richTextFormatter.identifyTag(n)},this.saveNode=function(){const e=f.editing();if(e){const n=t("#editorTitle")[0],i=f.getFutureEditedNodeTitle();n.value=i,e.title(i),e.body(f.trimBodyLinks(e.body().trim())),f.makeNewNodesFromLinks(),f.propagateUpdateFromNode(e),f.workspace.updateArrows(),setTimeout(f.updateSearch,600),f.setYarnDocumentIsDirty(),app.ui.dispatchEvent("yarnSavedNode")}},this.closeEditor=function(){f.editing().undoManager=f.editor.session.getUndoManager(),t("#node-editor-background").transition({opacity:0},250),t("#node-editor").transition({y:"-100",opacity:0},250,(function(t){f.editing(null)})),f.isEditorSplit=!1,f.isEditorFocused=!1,t(".app-info").show(),app.ui.resetAppButtonsLocation(),f.isEditorInPlayMode()&&f.togglePlayMode(!1),f.isEditorInPreviewMode&&f.togglePreviewMode(!1)},this.convertMarkup=function(){f.nodes().forEach(t=>{t.body(f.richTextFormatter.convert(t.body()))})},this.updateSearch=function(){for(var e=0;e{n.includes(t)||e.push(t)}),t.linkedFrom().forEach(t=>{n.includes(t)||e.push(t)}))},this.updateTagsRepository=function(){if(!app.mustUpdateTags)return;app.mustUpdateTags=!1;f.tags().forEach(t=>t.count=0),f.nodes().forEach(t=>{d.Utils.uniqueSplit(t.tags()," ").forEach(t=>{const e=f.tags().find(e=>e.text==t);if(e)++e.count;else{const e=(()=>{const t=f.tags().map(t=>t.id);for(let e=1;;++e)if(!t.includes(e))return e})();f.tags.push({id:e,style:"tag-style-"+e,text:t,count:1})}})});let t=f.tags().length;for(;t--;)0===f.tags()[t].count&&f.tags().splice(t,1)},this.makeNewNodesFromLinks=function(){if(!f.settings.createNodesEnabled())return console.info("Autocreate new nodes disabled");var t=f.editing().getLinksInNode();if(null!=t)for(var e=0;e0&&!n.includes(t)&&t!=f.editing().title()&&f.newNodeAt(f.editing().x()+e,f.editing().y()-120).title(t)},this.titleExistsTwice=function(t){return f.nodes().filter(e=>e.title().trim()===t.trim()).length>1},this.getFutureEditedNodeTitle=function(){const e=t("#editorTitle")[0];return f.getUniqueTitle(e.value.trim())},this.getOtherNodeTitles=function(){const t=[];return f.nodes().forEach(e=>{if(!f.editing()||e.title()!==f.editing().title()){if("ink"===app.settings.documentType()&&e.title().trim()===u.a.InkGlobalScopeNodeName)return;t.push(e.title().trim())}}),t},this.getHighlightedText=function(e){e=(e=(e=(e=(e=(e=(e=(e=e.replace(/\/g,">")).replace(/\<\<(.*?)\>\>/g,'

        <<

        $1

        >>

        ')).replace(/\[\[([^\|]*?)\]\]/g,'

        [[

        $1

        ]]

        ')).replace(/\[\[([^\[\]]*?)\|([^\[\]]*?)\]\]/g,'

        [[

        $1

        |

        $2

        ]]

        ')).replace(/[^:]\/\/(.*)?($|\n)/g,'//$1\n')).replace(/\/\*((.|[\r\n])*)?\*\//gm,'/*$1*/')).replace(/\/\%((.|[\r\n])*)?\%\//gm,'/%$1%/');var n=t("
        ");return n[0].innerHTML=e,n.find(".comment").each((function(){t(this).find("p").each((function(){t(this).removeClass()}))})),n.find(".linkname").each((function(){var e=t(this).text(),n=!1;for(var i in f.nodes())if(f.nodes()[i].title().toLowerCase()==e.toLowerCase()){n=!0;break}n||t(this).removeClass("linkname")})),e=n[0].innerHTML},this.updateLineNumbers=function(e){for(var n=e.split("\n"),i="",r=0;r0)&&(i+=r+1+"
        ");t(".editor-container .lines").html(i)},this.moveNodes=function(t,e){for(var n in f.nodes()){var i=f.nodes()[n];i.moveTo(i.x()+t,i.y()+e)}},this.getFirstFoundNode=function(t){return f.nodes().find(e=>e.title().toLowerCase().trim()===t)},this.searchWarp=function(){var t=f.$searchField.val().toLowerCase().trim();if(""===t)f.workspace.warpToNodeByIdx(0);else{const e=f.getFirstFoundNode(t);f.workspace.warpToNodeByIdx(f.nodes.indexOf(e))}},this.clearSearch=function(){f.$searchField.val(""),f.updateSearch()},this.updateEditorStats=function(){var e=f.editor.getSession().getValue(),n=f.editor.getCursorPosition(),i=e.split("\n");t(".editor-counter .character-count").html(e.length),t(".editor-counter .line-count").html(i.length),t(".editor-counter .row-index").html(n.row),t(".editor-counter .column-index").html(n.column),u.a.saveAppStateToLocalStorage()},this.getUniqueTitle=function(t){var e=f.getOtherNodeTitles();if(t&&!e.includes(t))return t;var n=t||"Node",i=2;const r=n.match(/^(.*)(_([0-9]+))$/);if(r&&4===r.length&&(n=r[1],i=Number(r[3])),!e.includes(n))return n;for(;;++i){var o=n+"_"+i;if(!e.includes(o))return o}},this.navigateToNodeDuringPlayTest=function(t,e=""){f.openNodeByTitle(t,e),f.togglePlayMode(!0),app.workspace.warpToNode(app.getFirstFoundNode(t))}}}).call(this,n("EVdn"),n("Z1dp"))},"P85/":function(t,e,n){},W2Rx:function(t,e,n){"use strict";(function(t,i){n.d(e,"a",(function(){return a}));var r=n("oj90");let o=0;let a=function(e={}){const n=this;this.titleStyles=["title-style-1","title-style-2","title-style-3","title-style-4","title-style-5","title-style-6","title-style-7","title-style-8","title-style-9"],this.index=t.observable(o++),this.title=t.observable(e.title||app.getUniqueTitle()),this.tags=t.observable(e.tags||""),this.body=t.observable(e.body||""),this.active=t.observable(e.active||!0),this.width=200,this.height=200,this.tempOpacity=null,this.style=null,this.colorID=t.observable(e.colorID||0),this.checked=!1,this.selected=!1,this.createX=e.x||null,this.createY=e.y||null,this.undoManager=null,this.clippedTags=t.computed((function(){return app.updateTagsRepository(),r.Utils.uniqueSplit(n.tags()," ").map(t=>app.tags().find(e=>e.text===t)).filter(t=>t)}),this),this.clippedBody=t.computed((function(){if(app.ui.isScreenNarrow()&&app.editing())return;app.mustRefreshNodes();let t=app.getHighlightedText(this.body());return t=app.richTextFormatter.richTextToHtml(t),t=t.substr(0,1024),t}),this),this.linkedTo=t.observableArray(),this.linkedFrom=t.observableArray(),this.element=null,this.canDoubleClick=!0,this.create=function(){if(n.style=window.getComputedStyle(i(n.element).get(0)),n.createX&&n.createY)n.x(n.createX),n.y(n.createY);else{let t=i(n.element).parent();n.x((-t.offset().left+i(window).width()/2-100)/app.workspace.scale),n.y((-t.offset().top+i(window).height()/2-100)/app.workspace.scale)}app.workspace.bringToFront(n.element),app.workspace.startUpdatingArrows(),i(n.element).css({opacity:0,scale:.8,y:"-=80px",rotate:"45deg"}).transition({opacity:1,scale:1,y:"+=80px",rotate:"0deg"},250,"easeInQuad",(function(){app.workspace.stopUpdatingArrows(),app.workspace.updateArrows()})),n.drag(),i(n.element).on("dblclick",(function(){n.canDoubleClick&&app.editNode(n)})),r.Utils.addDoubleTapDetector(n.element,(function(){n.canDoubleClick&&app.editNode(n)})),i(n.element).on("click",(function(t){t.ctrlKey&&(n.selected?app.workspace.deselectNodes(n):app.workspace.selectNodes(n))}))},this.setSelected=function(t){n.selected=t,n.selected?i(n.element).addClass("selected"):i(n.element).removeClass("selected")},this.toggleSelected=function(){n.setSelected(!n.selected)},this.x=function(t){if(null!=t&&i(n.element).css({x:Math.floor(t)}),n.style)return Math.floor(new WebKitCSSMatrix(n.style.webkitTransform).m41)},this.y=function(t){if(null!=t&&i(n.element).css({y:Math.floor(t)}),n.style)return Math.floor(new WebKitCSSMatrix(n.style.webkitTransform).m42)},this.resetDoubleClick=function(){n.canDoubleClick=!0},this.cycleColorDown=function(){n.doCycleColorDown(),setTimeout(n.resetDoubleClick,500),n.canDoubleClick=!1,app.input.isShiftDown&&app.matchConnectedColorID(n),n.selected&&app.setSelectedColors(n),app.setYarnDocumentIsDirty()},this.cycleColorUp=function(){n.doCycleColorUp(),setTimeout(n.resetDoubleClick,500),n.canDoubleClick=!1,app.input.isShiftDown&&app.matchConnectedColorID(n),n.selected&&app.setSelectedColors(n),app.setYarnDocumentIsDirty()},this.doCycleColorDown=function(){n.colorID(n.colorID()-1),n.colorID()<0&&n.colorID(8)},this.doCycleColorUp=function(){n.colorID(n.colorID()+1),n.colorID()>8&&n.colorID(0)},this.remove=async function(){return new Promise((t,e)=>{i(n.element).transition({opacity:0,scale:.8,y:"-=80px",rotate:"-45deg"},250,"easeInQuad",t)})},this.drag=function(){const t={x:0,y:0};let e=!1,r=!1;i(document.body).on("mousemove touchmove",(function(i){if(e){const e=app.input.isScreenTouched&&i.changedTouches?i.changedTouches[0].pageX:i.pageX,o=app.input.isScreenTouched&&i.changedTouches?i.changedTouches[0].pageY:i.pageY;let{x:a,y:s}=app.workspace.toWorkspaceCoordinates(e,o);a-=t.x,s-=t.y;let l=a-n.x(),c=s-n.y();const u=app.workspace.getSelectedNodes();if(("mousemove"===i.originalEvent.type||u.includes(n)&&"touchmove"===i.originalEvent.type)&&(n.x(a),n.y(s)),r&&(n.selected?u.splice(u.indexOf(n),1):u=app.getNodesConnectedTo(n),u.length>0))for(let t in u)u[t].active()&&(u[t].x(u[t].x()+l),u[t].y(u[t].y()+c));app.workspace.updateArrows()}})),i(n.element).on("pointerdown",(function(i){if(!e&&n.active()&&0===i.button){e=!0,(app.input.isShiftDown||n.selected)&&(r=!0);const{x:o,y:a}=app.workspace.toWorkspaceCoordinates(i.pageX,i.pageY);t.x=app.settings.snapGridEnabled()?app.workspace.stepify(o-n.x(),app.settings.gridSize()):o-n.x(),t.y=app.settings.snapGridEnabled()?app.workspace.stepify(a-n.y(),app.settings.gridSize()):a-n.y()}})),i(n.element).on("touchend",(function(t){app.workspace.selectNodes(n)})),i(document).on("pointerup touchend",(function(){(e||r)&&(e=!1,r=!1,app.setYarnDocumentIsDirty())}))},this.moveTo=function(t,e){app.workspace.startUpdatingArrows(),i(n.element).clearQueue(),i(n.element).transition({x:t,y:e},app.stopUpdatingArrows,500)},this.isConnectedTo=function(t,e){if(e&&t.isConnectedTo(n,!1))return!0;let i=n.linkedTo();for(let e in i){if(i[e]==t)return!0;if(i[e].isConnectedTo(t,!1))return!0;if(t.isConnectedTo(i[e],!1))return!0}return!1},this.getLinksInNode=function(t){const e="yarn"===app.settings.documentType();let i=(t||n).body().match(e?/\[\[(.*?)\]\]/g:/\-\>(.*)/g);if(null!=i){let t={};for(let n=i.length-1;n>=0;n--)e?(i[n]=i[n].substr(2,i[n].length-4).trim(),i[n].indexOf("|")>=0&&(i[n]=i[n].split("|")[1]),null!=t[i[n]]&&i.splice(n,1),t[i[n]]=!0):i[n]=i[n].substr(2,i[n].length).trim();return i}},this.updateLinks=function(){n.resetDoubleClick(),n.updateLinksFromParents(),n.updateLinksToChildren()},this.updateLinksFromParents=function(){n.oldTitle&&n.oldTitle!==n.title()&&(n.linkedFrom.removeAll(),app.nodes().forEach(t=>{const e=n.getLinksInNode(t);if(e)if(e.includes(n.oldTitle)){const e=RegExp("\\|\\s*"+n.oldTitle+"\\s*\\]\\]","g"),i=RegExp("\\[\\[\\s*"+n.oldTitle+"\\s*\\]\\]","g");let r=t.body().replace(e,"|"+n.title()+"]]");r=r.replace(i,"[["+n.title()+"]]"),t.body(r),n.linkedFrom.push(t)}else e.includes(n.title())&&n.linkedFrom.push(t)}),n.oldTitle=void 0)},this.updateLinksToChildren=function(){n.linkedTo.removeAll();let t=n.getLinksInNode();if(t)for(let e in app.nodes()){let i=app.nodes()[e];for(let e=0;e(n.pluginStorage||(n.pluginStorage={}),n.pluginStorage[t]||(n.pluginStorage={...n.pluginStorage,[t]:{}}),this.pluginStorage[t]),o=(t,e,i)=>{const o={...r(t),[e]:i};n.pluginStorage={...n.pluginStorage,[t]:o}};window.addEventListener("yarnLoadedData",t=>{if(null!==e.data.documentHeader()){const t=e.data.documentHeader();"pluginStorage"in t&&(n.pluginStorage=t.pluginStorage)}}),window.addEventListener("newYarnFileStarted",t=>{n.pluginStorage={}});const s=({title:n,valueKey:i,defaultValue:r,optionsKey:o,options:a,setterKey:s,settingsColumn:l})=>{e.settings[i]=t.observable(e.settings.storage.getItem(i)||r).extend({persist:i}),e.ui[o]=a,e[s]=function(t,n){const r=n?n.target.value:t;e.settings[i](r)},window.addEventListener("settingsOpened",()=>{const t=e.ui[o].map(t=>``).join(""),r=`\n \n
        \n \n
        \n `,a=document.createElement("div");a.className="settings-item",a.innerHTML=r,document.getElementById("settingsColumn"+(l||"A")).appendChild(a),document.getElementById("mySelect").addEventListener("change",t=>{e[s](!1,t)})})},l=(t,{name:e,iconName:n,onClick:i,attachTo:r,className:o,title:a,onPointerDown:s,onDoubleClick:l,id:c})=>{if(null!==document.getElementById(c))return;const u=document.createElement("span");return u.id=c||e||a||n,u.innerHTML=`\n \n \n  \n ${e||""}\n \n `,document.getElementById(r).appendChild(u),u},c=(t,{id:e,attachTo:n,className:i,title:r,tooltipId:o,toggleValueKey:a,onToggle:s,enableKey:l,iconName:c})=>{if(null!==document.getElementById(e))return;const u=document.createElement("span");return u.id=e,u.className="styled-checkbox",u.innerHTML=`\n \n \n `,document.getElementById(n).appendChild(u),u},u=t=>{window.addEventListener("yarnSavedNode",e=>{t(e)})},d=t=>{window.addEventListener("yarnInPreviewMode",e=>{t(e)})},p=t=>{window.addEventListener("yarnLoadedData",e=>{t(e)})},h=t=>{window.addEventListener("yarnSetDocumentType",e=>{t(e)})},f=t=>{window.addEventListener("yarnEditorOpen",e=>{t(e)})},m=t=>{window.addEventListener("DOMContentLoaded",e=>{t(e)})},y=t=>{window.addEventListener("yarnSetLanguage",e=>{t(e)})},g=t=>{window.addEventListener("yarnLoadedStateFromLocalStorage",e=>{t(e)})},b=t=>{window.addEventListener("yarnSavedStateToLocalStorage",e=>{t(e)})},v=t=>{i(document).on("keyup",e=>{t(e)})},w=t=>{i(document).on("keydown",e=>{t(e)})};a.forEach(t=>{const n=new t({app:e,createButton:l,createToggle:c,getPluginStore:r,setPluginStore:o,addSettingsItem:s,onYarnLoadedData:p,onYarnEditorOpen:f,onYarnInPreviewMode:u,onYarnSavedNode:d,onYarnSetLanguage:y,onYarnLoadedStateFromLocalStorage:g,onYarnSavedStateToLocalStorage:b,onYarnSetDocumentType:h,onKeyUp:v,onKeyDown:w,onLoad:m});window.addEventListener("DOMContentLoaded",t=>{(t=>{e.plugins[t.name]=t})(n)})})}}).call(this,n("Z1dp"),n("EVdn"))},e6Wu:function(t,e,n){"use strict";n.r(e);n("3ozf"),n("P85/"),n("uMdg"),n("gugv");var i=n("oj90"),r=n("0h2I"),o=n.n(r),a=(n("5uVa"),n("si6p"),n("ghrA"),n("bU/s")),s=n.n(a),l=(n("A8C4"),n("VEX6"),n("jF1P"),n("YhK8"),n("Ab/9"),n("KDOe"),n("XfCI"),n("PSD3")),c=n.n(l),u=n("P0sH"),d=n("pLxK"),p=n("bHyH");window.ko=o.a,window.$=window.jQuery=n("EVdn"),window.ace=s.a,s.a.config.set("basePath",i.Utils.getPublicPath()),window.define=s.a.define,window.Swal=c.a,"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").then(t=>{console.log("SW registered: ",t)}).catch(t=>{console.log("SW registration failed: ",t)})}),window.app=new u.a("Yarn",d.a),window.app.run();const h=new p.a(window.app);window.app.plugins=h},fkuv:function(t,e,n){"use strict";(function(t,i){n.d(e,"a",(function(){return o}));var r=n("2Qx2");const o=function(e){const n=this;this.notification=Swal.mixin({toast:!0,position:"top",showConfirmButton:!1,timer:2500}),this.dispatchEvent=function(t,e){const n=new CustomEvent(t);n.options=e,window.dispatchEvent(n),window.parent.dispatchEvent(n),console.log("Dispatched event",t,n)},this.settingsDialogVisible=t.observable(!1),this.narrowScreenThreshold=600,this.isScreenNarrow=function(){return i(window).width()<=n.narrowScreenThreshold},this.availableMarkupLanguages=[{id:"bbcode",name:"Bbcode"},{id:"html",name:"Html"}],this.availableFiletypeVersions=[{id:"1",name:"1"},{id:"2",name:"2"}],this.availableThemes=[{id:"classic",name:"Classic"},{id:"blueprint",name:"Blueprint"},{id:"dracula",name:"Dracula"}],this.availableDocumentTypes=[{id:"yarn",name:"Yarn"},{id:"ink",name:"Ink"}],this.availableLanguages=[{name:"Čeština",id:"cs-CZ"},{name:"Deutsch",id:"de-DE"},{name:"English",id:"en-GB"},{name:"Español",id:"es-ES"},{name:"Français",id:"fr-FR"},{name:"Íslenska",id:"is-IS"},{name:"Nederlands",id:"nl-NL"},{name:"Norsk bokmål",id:"nb-NO"},{name:"Polski",id:"pl-PL"},{name:"Română",id:"ro-RO"},{name:"Slovenčina",id:"sk-SK"},{name:"Svenska",id:"sv-SE"},{name:"Türkçe",id:"tr-TR"},{name:"български",id:"bg-BG"},{name:"Pусский",id:"ru-RU"},{name:"Српски",id:"sr-RS"},{name:"한국어",id:"ko-KR"}],this.availableLineStyles=[{id:"straight",name:"Straight Lines"},{id:"bezier",name:"Bezier Curves"}],this.openSettingsDialog=function(){n.settingsDialogVisible(!0),i(".settings-dialog").css({opacity:0}).transition({opacity:1},250),i(".settings-dialog .form").css({y:"-100"}).transition({y:"0"},250);var t=new CustomEvent("settingsOpened");window.dispatchEvent(t)},this.openHelpDialog=function(){Swal.fire({title:"Help",html:'\n
        \n ',showCancelButton:!0,confirmButtonText:"About",cancelButtonText:"Close"}).then(t=>{t.value&&Swal.fire({title:"About",html:'\n \n ',showCancelButton:!1,confirmButtonText:"OK"})})},this.closeSettingsDialog=function(){i(".settings-dialog").css({opacity:1}).transition({opacity:0},250,t=>{n.settingsDialogVisible(!1)}),i(".settings-dialog .form").css({y:"0"}).transition({y:"-100"},250),setTimeout(()=>e.settings.apply(),100)},this.isDialogOpen=function(){return n.settingsDialogVisible()||Swal.isVisible()&&!Swal.isTimerRunning()},this.confirmMarkupConversion=function(){Swal.fire({title:"Are you sure?",text:"Markup on all nodes will be modified. This can rarely result in broken texts. This operation can't be undone.",icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, convert it!",cancelButtonText:"No, cancel!",reverseButtons:!0}).then(t=>{t.value&&(e.convertMarkup(),Swal.fire("Converted!","The markup on the nodes has been converted.","success"))})},this.nodeSearchMatches=function(t,e,n=!1){var r=n||i(".search-title input").is(":checked"),o=n||i(".search-body input").is(":checked"),a=n||i(".search-tags input").is(":checked");return 0!==e.length&&(r||o||a)?{matchTitle:r&&t.title().toLowerCase().indexOf(e)>=0,matchBody:o&&t.body().toLowerCase().indexOf(e)>=0,matchTags:a&&t.tags().toLowerCase().indexOf(e)>=0,clearSearch:!1}:{matchTitle:!1,matchBody:!1,matchTags:!1,clearSearch:!0}},this.findMatchingNodes=function(t){const n={matchTitle:[],matchBody:[],matchTags:[],foundNodes:!1};return[...e.nodes()].reverse().forEach(i=>{const{matchTitle:r,matchBody:o,matchTags:a}=e.ui.nodeSearchMatches(i,t,!0);r&&n.matchTitle.push(i),o&&n.matchBody.push(i),a&&n.matchTags.push(i)}),n.foundNodes=n.matchTitle.length>0||n.matchBody.length>0||n.matchTags.length>0,n},this.createSearchMenuLine=function(t,n,o,a="title"){const s=document.createElement("div");if(s.innerHTML=`${t.title()} ${a?`(${a})`:""}`,i(s).addClass("item "+t.titleStyles[t.colorID()]),"link"==n){if(t.title()!==e.editing().title()){if("ink"===e.settings.documentType()&&t.title().trim()===r.a.InkGlobalScopeNodeName)return;s.setAttribute("onclick","ink"===e.settings.documentType()?"app.insertTextAtCursor('-> "+t.title()+"')":"app.insertTextAtCursor('[["+t.title()+"]]')"),o.appendChild(s)}}else"open"==n&&(s.setAttribute("onclick",`app.openNodeByTitle("${t.title()}")`),s.setAttribute("onmouseenter",`app.workspace.warpToNodeByIdx(${e.nodes.indexOf(t)})`),o.appendChild(s))},this.openNodeListMenu=function(t){const n="link"===t?document.getElementById("linkHelperMenuFilter").value.toLowerCase():document.getElementById("nodeSearchInput").value.toLowerCase(),i=document.getElementById(t+"HelperMenu");i.innerHTML="";const r=()=>{[...e.nodes()].reverse().forEach(e=>{this.createSearchMenuLine(e,t,i,"")})};if(!n)return void r();const o=this.findMatchingNodes(n);o.foundNodes?(o.matchTitle.forEach(e=>{this.createSearchMenuLine(e,t,i,"title")}),o.matchTags.forEach(e=>{this.createSearchMenuLine(e,t,i,"tags")}),o.matchBody.forEach(e=>{this.createSearchMenuLine(e,t,i,"body")})):r()},this.checkAndMoveAppButtons=function(){i(".app-add-node").toggleClass("app-add-node-alt","right"===e.settings.editorSplitDirection()),i(".app-sort").toggleClass("app-sort-alt","right"===e.settings.editorSplitDirection()),i(".app-undo-redo").toggleClass("app-undo-redo-alt","right"===e.settings.editorSplitDirection()),i(".app-zoom").toggleClass("app-zoom-alt","right"===e.settings.editorSplitDirection())},this.resetAppButtonsLocation=function(){i(".app-add-node").removeClass("app-add-node-alt"),i(".app-sort").removeClass("app-sort-alt"),i(".app-undo-redo").removeClass("app-undo-redo-alt"),i(".app-zoom").removeClass("app-zoom-alt")},this.toastMixin=Swal.mixin({toast:!0,icon:"success",title:"Done!",animation:!1,position:"bottom",showConfirmButton:!1,timer:2500,timerProgressBar:!0,didOpen:t=>{t.addEventListener("mouseenter",Swal.stopTimer),t.addEventListener("mouseleave",Swal.resumeTimer)}}),this.insertTextAtCursorWithParams=function(t="",n=[]){const r=n.map((t,e)=>"boolean"==typeof t.default?`
        ${t.name} :
        `:"number"==typeof t.default?`
        ${t.name} :
        `:`
        ${t.name} :
        `).join("\n");Swal.fire({title:"Snippet properties",html:r,preConfirm:function(){return new Promise((function(t){t(n.map((t,e)=>"boolean"==typeof t.default?i("#swal-input"+e).is(":checked"):i("#swal-input"+e).val()))}))},onOpen:function(){i("#swal-input0").focus(),n.forEach((t,e)=>{void 0!==t.default&&("boolean"==typeof t.default?i("#swal-input"+e)[0].checked=t.default:i("#swal-input"+e)[0].value=t.default,console.log(i("#swal-input"+e)))})}}).then((function(n){if(!n.value)return;let i=t;n.value.forEach((t,e)=>{void 0!==t&&(i=i.replace("%"+e,t))}),e.insertTextAtCursor(i)}))}}}).call(this,n("Z1dp"),n("EVdn"))},gugv:function(t,e,n){},jF1P:function(t,e,n){(function(t){var e,n;e={},n=0,t.bindingHandlers.ace={init:function(i,r,o,a,s){var l=o().aceOptions||{},c=t.utils.unwrapObservable(r());i.id||(i.id="knockout-ace-"+n,n+=1);var u=ace.edit(i.id);l.theme&&u.setTheme("ace/theme/"+l.theme),l.mode&&u.getSession().setMode("ace/mode/"+l.mode),u.setValue(c),u.gotoLine(0),u.setShowPrintMargin(!1),u.getSession().setUseWrapMode(!0),u.getSession().on("change",(function(e){t.isWriteableObservable(r())&&r()(u.getValue())})),e[i.id]=u,t.utils.domNodeDisposal.addDisposeCallback(i,(function(){try{u.destroy()}catch(t){}delete e[i.id]}))},update:function(n,i,r,o,a){var s=t.utils.unwrapObservable(i()),l=n.id;if(void 0!==l&&""!==l&&e.hasOwnProperty(l)){var c=e[l];c.getValue()!==s&&(c.setValue(s),c.gotoLine(0))}}},t.aceEditors={resizeAll:function(){for(var t in e)e.hasOwnProperty(t)&&e[t].resize()},get:function(t){return e[t]}}}).call(this,n("Z1dp"))},"l8+o":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("mIo7"),r=n("mqgS");const o=function(t){const e=t=>{const e=/(https?:\/\/twitter.com\/[^\s\<]+\/[^\s\<]+\/[^\s\<]+)/gi,n=/((https:\/\/)?(www.)?instagram.com\/p\/[^\s\<]+)/gi,i=/(?:http(?:s?):\/\/|)(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?‌​[\w\?‌​=]*)?(?:\?t=[0-9]+)?/gi,r=new RegExp(`^(?!${e.source}|${i.source}|${n.source})https?:.*$`,"gm");t=t.replace(r,(function(t){return`\n
        \n \n
        \n `}));const o=[];return t=t.replace(e,(function(t){const e=t.match(/https:\/\/twitter.com\/.*\/status\/([0-9]+)/i);if(e.length>1)return o.push(e[1]),``})),setTimeout(()=>{const t=document.querySelectorAll(".tweet");o.forEach((e,n)=>{twttr.widgets.createTweet(e,t[n],{align:"center",follow:!1})})},500),t=(t=t.replace(i,(function(t){const e=t.match(/(?:https\:.*|)(?:www.|)youtu(?:.*\/v\/|.*v\=|\.be\/)([A-Za-z0-9_\-]{11}(?:\?t=[0-9]+)?)/i);if(e.length>1)return`\n \n `}))).replace(n,(function(t){const e=t.match(/((?:https?:\/\/)?(?:www.)?instagram.com\/p\/([^\s\<]+)\/)/i);if(e.length>2)return console.log("EXTRACTED",e),`\n \n `}))};return"html"===t.settings.markupLanguage()?new r.a(t,e):new i.a(t,e)}},mIo7:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return BbcodeRichTextFormatter}));const bbcode=__webpack_require__("L8pc"),BbcodeRichTextFormatter=function(app,addExtraPreviewerEmbeds){const self=this;this.justInsertedAutoComplete=!1,this.completableTags=Object.freeze([{Start:"<<",Completion:">>",Offset:-2},{Start:"[colo",Completion:"r=#][/color]",Offset:-9,BehaviorCompletion:"r=#][/color",Func:()=>{app.insertColorCode()}},{Start:"[b",Completion:"][/b]",BehaviorCompletion:"][/b",Offset:-4},{Start:"[i",Completion:"][/i]",BehaviorCompletion:"][/i",Offset:-4},{Start:"[img",Completion:"][/img]",BehaviorCompletion:"][/img",Offset:-6},{Start:"[u",Completion:"][/u]",BehaviorCompletion:"][/u",Offset:-4},{Start:"[url",Completion:"][/url]",BehaviorCompletion:"][/url",Offset:-6}]),this.getTagOpen=function(t){switch(t){case"cmd":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"~ ":"{ ":"<<";case"opt":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"-> ":"* [":"[[";case"color":return"[color=#]";default:return`[${t}]`}},this.getTagClose=function(t){switch(t){case"cmd":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"":" }":">>";case"opt":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"":"]":"|]]";default:return`[/${t}]`}},this.identifyTag=function(t){return-1!==t.lastIndexOf("[")?t.substring(t.lastIndexOf("["),t.length):""},this.insertTag=function(t){const e=self.getTagOpen(t),n=self.getTagClose(t),i=JSON.parse(JSON.stringify(app.editor.selection.getRange()));app.editor.session.insert(i.start,e),app.editor.session.insert({column:i.end.column+e.length,row:i.end.row},n),"color"===t&&(0===app.editor.getSelectedText().length?app.moveEditCursor(-9):app.editor.selection.setRange({start:{row:app.editor.selection.getRange().start.row,column:app.editor.selection.getRange().start.column-1},end:{row:app.editor.selection.getRange().start.row,column:app.editor.selection.getRange().start.column-1}}),app.insertColorCode()),"img"===t?0===app.editor.getSelectedText().length&&(app.moveEditCursor(-6),app.data.triggerPasteClipboard(),setTimeout(()=>app.moveEditCursor(6),300)):0===app.editor.getSelectedText().length?app.isEditorInPreviewMode||app.moveEditCursor(-n.length):app.editor.selection.setRange({start:app.editor.selection.getRange().start,end:{row:app.editor.selection.getRange().end.row,column:app.editor.selection.getRange().end.column-n.length}}),app.editor.focus()},this._convertTag=function(inPattern,outPattern,text){const globalRegex=new RegExp(inPattern,"gi"),localRegex=new RegExp(inPattern,"i");return text.replace(globalRegex,m=>{const match=m.match(localRegex),template=eval("`"+outPattern+"`");return match.length?template:null})},this.convert=function(t){let e=t;return e=self._convertTag("(.*?)<\\/b>","[b]${match[1]}[/b]",e),e=self._convertTag("(.*?)<\\/u>","[u]${match[1]}[/u]",e),e=self._convertTag("(.*?)<\\/i>","[i]${match[1]}[/i]",e),e=self._convertTag("(.*?)<\\/img>","[img]${match[1]}[/img]",e),e=self._convertTag("(.*?)<\\/color>","[color=#${match[1]}]${match[2]}[/color]",e),e=self._convertTag("(.*?)<\\/url>","[url]${match[1]}[/url]",e),e},this.richTextToHtml=function(t,e=!1){let n=1,i=e?'
        '+n+". "+t+"
        ":t;return i=i.replace(/<(run:"),i=i.replace(/>>/gi,")"),i=i.replace(/\[color=#[A-Za-z0-9]+\]/gi,(function(t){const e=t.match(/\[color=#([A-Za-z0-9]+)\]/i);if(e&&e.length>1)return"[color=#"+e[1]+"]"})),i=i.replace(/\[img\][^\[]+\[\/img\]/gi,(function(t){const n=t.match(/\[img\](.*)\[\/img\]/i);if(n.length>1){const t=app.data.editingFileFolder(n[1]);return app.data.doesFileExist(t)?e?' ':' ':e?' ':' '}})),e&&(i=addExtraPreviewerEmbeds(i)),i=i.replace(/[\n\r]/g,(function(t){let i="
        ";return n+=1,e&&(i+='
        '+n+". "),i})),i=bbcode.parse(i),i}}},mqgS:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return HtmlRichTextFormatter}));const HtmlRichTextFormatter=function(app,addExtraPreviewerEmbeds){const self=this;this.justInsertedAutoComplete=!1,this.completableTags=Object.freeze([{Start:"<<",Completion:">>",Offset:-2},{Start:"",Offset:-9,Func:()=>{app.insertColorCode()}},{Start:"",Offset:-4},{Start:"",Offset:-6},{Start:"",Offset:-4},{Start:"",Offset:-4},{Start:"",Offset:-6}]),this.getTagOpen=function(t){switch(t){case"cmd":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"~ ":"{ ":"<<";case"opt":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"-> ":"* [":"[[";case"color":return"";default:return`<${t}>`}},this.getTagClose=function(t){switch(t){case"cmd":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"":" }":">>";case"opt":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"":"]":"|]]";default:return``}},this.identifyTag=function(t){return-1!==t.lastIndexOf("<")?t.substring(t.lastIndexOf("<"),t.length):""},this.insertTag=function(t){const e=self.getTagOpen(t),n=self.getTagClose(t),i=JSON.parse(JSON.stringify(app.editor.selection.getRange()));app.editor.session.insert(i.start,e),app.editor.session.insert({column:i.end.column+e.length,row:i.end.row},n),"color"===t&&(0===app.editor.getSelectedText().length?app.moveEditCursor(-9):app.editor.selection.setRange({start:{row:app.editor.selection.getRange().start.row,column:app.editor.selection.getRange().start.column-1},end:{row:app.editor.selection.getRange().start.row,column:app.editor.selection.getRange().start.column-1}}),app.insertColorCode()),"img"===t?navigator.clipboard.readText().then(t=>{0===app.editor.getSelectedText().length&&(app.moveEditCursor(-7),app.insertTextAtCursor(` src="${t}"`))}):0===app.editor.getSelectedText().length?app.isEditorInPreviewMode||app.moveEditCursor(-n.length):app.editor.selection.setRange({start:app.editor.selection.getRange().start,end:{row:app.editor.selection.getRange().end.row,column:app.editor.selection.getRange().end.column-n.length}}),app.editor.focus()},this._convertTag=function(inPattern,outPattern,text){const globalRegex=new RegExp(inPattern,"gi"),localRegex=new RegExp(inPattern,"i");return text.replace(globalRegex,m=>{const match=m.match(localRegex),template=eval("`"+outPattern+"`");return match.length?template:null})},this.convert=function(t){let e=t;return e=self._convertTag("\\[b\\](.*?)\\[\\/b\\]","${match[1]}",e),e=self._convertTag("\\[u\\](.*?)\\[\\/u\\]","${match[1]}",e),e=self._convertTag("\\[i\\](.*?)\\[\\/i\\]","${match[1]}",e),e=self._convertTag("\\[img\\](.*?)\\[\\/img\\]","${match[1]}",e),e=self._convertTag("\\[color=#(.*?)\\](.*?)\\[\\/color\\]","${match[2]}",e),e=self._convertTag("\\[url\\](.*?)\\[\\/url\\]","${match[1]}",e),e},this.richTextToHtml=function(t,e=!1){let n=1,i=e?'
        '+n+". "+t+"
        ":t;return i=i.replace(/<(run:"),i=i.replace(/>>/gi,")
        "),[/<color=#(.*?)>(.*?)<\/color>/,/(.*?)<\/color>/].forEach(t=>{const e=new RegExp(t,"gi"),n=new RegExp(t,"i");i=i.replace(e,(function(t){const e=t.match(n);if(e&&e.length>2)return`☗${e[2]}`}))}),i=i.replace(/<img>[^\[]+<\/img>/gi,(function(t){const n=t.match(/<img>(.*?)<\/img>/i);if(n.length>1){const t=app.data.editingFileFolder(n[1]);return app.data.doesFileExist(t)?e?' ':' ':e?' ':' '}})),i=i.replace(/<b>.*<\/b>/gi,t=>{const e=t.match(/<b>(.*)<\/b>/i);if(e.length)return`${e[1]}`}),i=i.replace(/<u>.*<\/u>/gi,t=>{const e=t.match(/<u>(.*)<\/u>/i);if(e.length)return`${e[1]}`}),i=i.replace(/<i>.*<\/i>/gi,t=>{const e=t.match(/<i>(.*)<\/i>/i);if(e.length)return`${e[1]}`}),e&&(i=addExtraPreviewerEmbeds(i)),i=i.replace(/[\n\r]/g,(function(t){let i="
        ";return n+=1,e&&(i+='
        '+n+". "),i})),i}}},oj90:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"FILETYPE",(function(){return i})),n.d(e,"Utils",(function(){return r}));var i={JSON:"json",XML:"xml",TWEE:"twee",TWEE2:"tw2",UNKNOWN:"none",YARN:"yarn",INK:"ink",INKJSON:"ink.json",RENPY:"rpy"},r={createAutocompleter:function(t,e,n,i=1){return{getCompletions:function(r,o,a,s,l){var c=r.session.getTokenAt(a.row,a.column);s.length`,"

        ",t.title,"

        ","
        ","
        ",t.about,"
        ","
        ","
        "].join("")}}},addDoubleTapDetector:function(t,e){t.lastTap=0,t.tapTimeout=0,t.addEventListener("touchend",(function(n){var i=(new Date).getTime(),r=i-t.lastTap;clearTimeout(t.tapTimeout),r<500&&r>0?(e(),n.preventDefault()):t.tapTimeout=setTimeout((function(){clearTimeout(t.tapTimeout)}),500),t.lastTap=i}))},uniqueSplit:function(t,e=" "){return[...new Set(t.split(e).filter(t=>t))]},getHighestZ:function(e){let n=Number.NEGATIVE_INFINITY;return t(e).children().each((function(){let e=parseInt(t(this).css("z-index"))||0;e>n&&(n=e)})),n},clamp:function(t,e,n){return Math.max(Math.min(t,n),e)},rectanglesOverlap:function(t,e){return!(e.left>t.right||e.rightt.bottom||e.bottom=0;)t=t.replace("<","<");for(;t.indexOf(">")>=0;)t=t.replace(">",">");return t},xmlToObject:function(t){var e=[];if((t=t.childNodes.item(0)).hasChildNodes())for(var n=0;n0)){r[s.nodeName]={};for(var l=0;l1){if(n.items={cut:{name:"Cut",icon:"cut",callback:()=>{app.clipboard.length>0&&(app.data.triggerCopyClipboard(),app.insertTextAtCursor(""))}},copy:{name:"Copy",icon:"copy",callback:()=>{app.data.triggerCopyClipboard()}},paste:{name:"Paste",icon:"paste",callback:()=>app.data.triggerPasteClipboard()},sep1:"---------"},!app.getTagBeforeCursor().match(t)||"ink"===app.settings.documentType()&&"END"===app.editor.getSelectedText()||(n.items["go to node"]={name:"Edit node: "+app.editor.getSelectedText(),callback:()=>{const t=app.getFutureEditedNodeTitle();app.nodeVisitHistory.includes(t)||app.nodeVisitHistory.push(t),app.openNodeByTitle(app.editor.getSelectedText())}}),app.settings.spellcheckEnabled()){var i=app.getSpellCheckSuggestionItems();!1!==i&&(n.items.corrections={name:"Correct word",items:i})}var r=app.getThesaurusItems();!1!==r&&(n.items.corrections={name:"Related words",items:r})}else n.items={paste:{name:"Paste",icon:"paste",callback:()=>app.data.triggerPasteClipboard()}},"ink"===app.settings.documentType()&&(n.items.inkSnips={name:"Ink snippets",items:{structure:{name:"Structure",items:{stitch:{name:"Stitch",callback:()=>{app.insertTextAtCursor("= stitchName\nThis is the content of the stitch that should be embedded within a knot.\n-> END")}},end:{name:"Ending indicator",callback:()=>{app.insertTextAtCursor("-> END")}}}},choices:{name:"Choices",items:{basicChoice:{name:"Basic choice",callback:()=>{app.insertTextAtCursor("* This is a choice that can only be chosen once")}},stickyChoice:{name:"Sticky choice",callback:()=>{app.insertTextAtCursor("+ This is a sticky choice - the player can choose it more than once")}},choiceWithoutPrinting:{name:"Choice without printing",callback:()=>{app.insertTextAtCursor("* [A choice where the content isn't printed after choosing]")}},choiceWithoutMixedOutput:{name:"Choice without mixed output",callback:()=>{app.insertTextAtCursor("* Try [it] this example!")}}}},variableText:{name:"Variable text",items:{shuffle:{name:"~Shuffle (rand) text",callback:()=>{app.insertTextAtCursor("I tossed the coin. {~Heads|Tails}.")}},cycle:{name:"&Cycle text",callback:()=>{app.insertTextAtCursor("It was {&Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday} today.")}},sequence:{name:"Sequence text",callback:()=>{app.insertTextAtCursor('The radio hissed into life. {"Three!"|"Two!"|"One!"|There was the white noise racket of an explosion.|But it was just static.}\n\n{I bought a coffee with my five-pound note.|I bought a second coffee for my friend.|I didn\'t have enough money to buy any more coffee.}')}},onceOnly:{name:"!Once only text",callback:()=>{app.insertTextAtCursor("He told me a joke. {!I laughed politely.|I smiled.|I grimaced.|I promised myself to not react again.}\n")}}}},variables:{name:"Variables",items:{globalVariable:{name:"Global variable",callback:()=>{app.insertTextAtCursor("VAR myNumber = 5")}},temporaryVariable:{name:"Temporary variable",callback:()=>{app.insertTextAtCursor("temp myTemporaryValue = 5")}},modifyVariable:{name:"Modify variable",callback:()=>{app.insertTextAtCursor("~ myNumber = myNumber + 1")}}}},conditions:{name:"Conditions",items:{inlineCondition:{name:"Inline condition",callback:()=>{app.insertTextAtCursor("{yourVariable: This is written if yourVariable is true|Otherwise this is written}\n")}},multilineCondition:{name:"Multiline condition",callback:()=>{app.insertTextAtCursor("{yourVariable:\n This is written if yourVariable is true.\n - else:\n Otherwise this is written.\n}")}}}}}},n.items.code={name:"Code",items:{equal:{name:"== (equal)",callback:()=>app.insertTextAtCursor("== ")},notEqual:{name:"!= (not equal)",callback:()=>app.insertTextAtCursor("!= ")},tag:{name:"# (tag)",callback:()=>app.insertTextAtCursor("# ")},list:{name:"LIST",callback:()=>app.insertTextAtCursor("LIST = ")},listFunc:{name:"List functions",items:{count:{name:"count",callback:()=>app.insertTextAtCursor("LIST_COUNT()")},min:{name:"min",callback:()=>app.insertTextAtCursor("LIST_MIN()")},max:{name:"max",callback:()=>app.insertTextAtCursor("LIST_MAX()")},rand:{name:"random",callback:()=>app.insertTextAtCursor("LIST_RANDOM()")}}},variable:{name:"VAR",callback:()=>app.insertTextAtCursor("VAR = ")},temp:{name:"~ temp",callback:()=>app.insertTextAtCursor("~ temp = ")},plusEq:{name:"+= (plus equal)",callback:()=>app.insertTextAtCursor("+= ")},else:{name:"- else",callback:()=>app.insertTextAtCursor("- else:\n")},or:{name:"|",callback:()=>app.insertTextAtCursor("|")},rand:{name:"~",callback:()=>app.insertTextAtCursor("~")}}},n.items.bladeCoder={name:"BladeCoder",items:{player:{name:"$PLAYER>",callback:()=>app.insertTextAtCursor("$PLAYER> ")},animation:{name:"Animation",callback:()=>app.ui.insertTextAtCursorWithParams("> Animation: animation=%0.%1, wait=%2, keepDirection=%3, repeat=%4, count=%5",[{name:"Actor",default:"$PLAYER"},{name:"Animation",default:"stand.right"},{name:"Wait",default:!1},{name:"Keep direction",default:!1},{name:"Repeat",default:"SPRITE_DEFINED"},{name:"Count",default:-1}])},goto:{name:"Goto",callback:()=>app.ui.insertTextAtCursorWithParams("> Goto: actor=%0, target=%1",[{name:"Actor",default:"$PLAYER"},{name:"target",default:"target"}])},wait:{name:"Wait",callback:()=>app.ui.insertTextAtCursorWithParams("> Wait: time=%0",[{name:"Time",default:.8}])},playSound:{name:"Play Sound",callback:()=>app.ui.insertTextAtCursorWithParams("> PlaySound: sound=%0, stop=%1",[{name:"Sound",default:"yawn"},{name:"Stop",default:!1}])},setActorAttr:{name:"Set Actor Attribute",callback:()=>app.ui.insertTextAtCursorWithParams("> SetActorAttr: actor=%0, talkAnimation=%1, visible=%2",[{name:"Actor",default:"$PLAYER"},{name:"Talk animation"},{name:"Visible",default:!0}])}}},n.items.end={name:"-> END",callback:()=>app.insertTextAtCursor("-> END")},n.items.star={name:"* (choice)",callback:()=>app.insertTextAtCursor("* ")},n.items.gather={name:"- (gather)",callback:()=>app.insertTextAtCursor("-")},n.items.stitch={name:"= (stitch)",callback:()=>app.insertTextAtCursor("= ")},n.items.glue={name:"<> (glue)",callback:()=>app.insertTextAtCursor("<>")},n.items.comment={name:"// (comment)",callback:()=>app.insertTextAtCursor("// ")},n.items.nested={name:"Nested",items:{gather2:{name:"-- (gather)",callback:()=>app.insertTextAtCursor("-- ")},star2:{name:"** (choice)",callback:()=>app.insertTextAtCursor("** ")}}},n.items.inkDoc={name:"How to use ink",callback:()=>window.open("https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md","_blank").focus()});return app.getTagBeforeCursor().match(/\[img/g)&&(n.items["Choose image"]={name:"Choose image",callback:()=>{app.data.insertImageFileName()}}),n}}}}}}.call(this,n("EVdn"))},owJe:function(t,e,n){(function(t){var i=n("jXEy"),r=n("oj90"),o=r.Utils.getPublicPath("dictionaries/en/index.dic"),a=r.Utils.getPublicPath("dictionaries/en/index.aff");t("").appendTo("head"),t("").appendTo("head");var s=null;function l(t){var e=t.split(/\s+|\.|\,|\?|\\|\/|\!|\[|\]|"|'|;|:|`|\+|\-|\&|\$|@|~|#|>|<|_|\)|\(|£|\^|%|\*|„|“|\||[0-9]+/g),n=0,i=[];for(word in e){var r=e[word];s.correct(r)||(i[i.length]=[n,n+e[word].length]),n+=e[word].length+1}return i}e.load_dictionary=function(e){console.info(`Loading ${e} hunspell dictionary locally`),o=r.Utils.getPublicPath(`dictionaries/${e}/index.dic`),a=r.Utils.getPublicPath(`dictionaries/${e}/index.aff`),t.get(o,(function(t){dicData=t})).fail((function(){const n=sessionStorage.getItem("affData"),r=sessionStorage.getItem("dicData");if(n&&r)return console.info(e+" found in sessionStorage. Loading dictionary from cache..."),s=new i(n,r),void(c=!0);console.error(e+" not found locally. Loading dictionary from server instead..."),o=`https://raw.githubusercontent.com/wooorm/dictionaries/main/dictionaries/${e}/index.dic`,a=`https://raw.githubusercontent.com/wooorm/dictionaries/main/dictionaries/${e}/index.aff`,t.get(o,(function(t){dicData=t})).done((function(){t.get(a,(function(t){affData=t})).done((function(){sessionStorage.setItem("affData",affData),sessionStorage.setItem("dicData",dicData),s=new i(affData,dicData),c=!0}))}))})).done((function(){t.get(a,(function(t){affData=t})).done((function(){console.log("Dictionary loaded locally"),s=new i(affData,dicData),c=!0}))}))},e.misspelled=l;var c=!0,u=!1,d=[];function p(){if(null!=s&&!u&&c){u=!0;var t=ace.edit("editor").getSession();f();try{var e=ace.require("ace/range").Range,n=t.getDocument().getAllLines();for(var i in n){var r=l(n[i]);for(var o in r){var a=new e(i,r[o][0],i,r[o][1]);d[d.length]=t.addMarker(a,"misspelled","typo",!0)}}}finally{u=!1,c=!1}}}e.spell_check=p;var h=!1;function f(){var t=ace.edit("editor").getSession();for(var e in d)t.removeMarker(d[e]);d=[];var n=t.getDocument().getAllLines();for(var e in n)t.removeGutterDecoration(e,"misspelled")}e.enable_spellcheck=function(){h=!0,ace.edit("editor").getSession().on("change",(function(t){h&&(c=!0,p())})),c=!0,p()},e.disable_spellcheck=function(){h=!1,f()},e.clear_spellcheck_markers=f,e.suggest_word_for_misspelled=function(t){var e=s.suggest(t);return 0!==e.length&&e}}).call(this,n("EVdn"))},pLxK:function(t){t.exports=JSON.parse('{"a":"0.4.258"}')},pYPP:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));const i=function(e){const n=this,i=window.vsCodeApi?{getItem:()=>{},setItem:()=>{}}:window.localStorage;this.storage=i,t.extenders.persist=function(t,e){return t.subscribe((function(t){i.setItem(e,t)})),t},this.apply=function(){e.setTheme(n.theme()),e.setLanguage(n.language()),e.setDocumentType(n.documentType()),e.toggleInvertColors(),e.setMarkupLanguage(n.markupLanguage()),e.workspace.setThrottle(n.redrawThrottle()),e.setGistCredentials({token:n.gistToken(),file:null!==n.gistFile()?n.gistFile().split("/").pop():null})},this.validateGridSize=function(){n.gridSize()<20&&n.gridSize(20),n.gridSize()>200&&n.gridSize(200),n.gridSize(parseInt(n.gridSize())),e.initGrid()},this.theme=t.observable(i.getItem("theme")||"dracula").extend({persist:"theme"}),this.documentType=t.observable(i.getItem("documentType")||"yarn").extend({persist:"documentType"}),this.language=t.observable(i.getItem("language")||"en-GB").extend({persist:"language"}),this.redrawThrottle=t.observable(parseInt(i.getItem("redrawThrottle")||"50")).extend({persist:"redrawThrottle"}),this.gistToken=t.observable(i.getItem("gistToken")).extend({persist:"gistToken"}),this.gistFile=t.observable(i.getItem("gistFile")).extend({persist:"gistFile"}),this.spellcheckEnabled=t.observable(null===i.getItem("spellcheckEnabled")||"true"===i.getItem("spellcheckEnabled")).extend({persist:"spellcheckEnabled"}),this.autoCloseTags=t.observable(null===i.getItem("autoCloseTags")||"true"===i.getItem("autoCloseTags")).extend({persist:"autoCloseTags"}),this.autocompleteSuggestionsEnabled=t.observable(null===i.getItem("autocompleteSuggestionsEnabled")||"true"===i.getItem("autocompleteSuggestionsEnabled")).extend({persist:"autocompleteSuggestionsEnabled"}),this.autoCloseBrackets=t.observable(null===i.getItem("autoCloseBrackets")||"true"===i.getItem("autoCloseBrackets")).extend({persist:"autoCloseBrackets"}),this.invertColorsEnabled=t.observable(null!==i.getItem("invertColorsEnabled")&&"true"===i.getItem("invertColorsEnabled")).extend({persist:"invertColorsEnabled"}),this.snapGridEnabled=t.observable(null!==i.getItem("snapGridEnabled")&&"true"===i.getItem("snapGridEnabled")).extend({persist:"snapGridEnabled"}),this.gridSize=t.observable(parseInt(i.getItem("gridSize")||"40")).extend({persist:"gridSize"}),this.createNodesEnabled=t.observable(null===i.getItem("createNodesEnabled")||"true"===i.getItem("createNodesEnabled")).extend({persist:"createNodesEnabled"}),this.editorStatsEnabled=t.observable(null!==i.getItem("editorStatsEnabled")&&"true"===i.getItem("editorStatsEnabled")).extend({persist:"editorStatsEnabled"}),this.markupLanguage=t.observable(i.getItem("markupLanguage")||"bbcode").extend({persist:"markupLanguage"}),this.filetypeVersion=t.observable(i.getItem("filetypeVersion")||"1").extend({persist:"filetypeVersion"}),this.lineStyle=t.observable(i.getItem("lineStyle")||"straight").extend({persist:"lineStyle"}),this.fileTabsVisible=t.observable(null===i.getItem("fileTabsVisible")||"true"===i.getItem("fileTabsVisible")).extend({persist:"fileTabsVisible"}),this.selectedFileTab=t.observable(i.getItem("selectedFileTab")||0).extend({persist:"selectedFileTab"}),this.alwaysOpenNodesInVisualStudioCodeEditor=t.observable(null!==i.getItem("alwaysOpenNodesInVisualStudioCodeEditor")&&"true"===i.getItem("alwaysOpenNodesInVisualStudioCodeEditor")).extend({persist:"alwaysOpenNodesInVisualStudioCodeEditor"}),this.editorSplitDirection=t.observable(i.getItem("editorSplitDirection")||"left").extend({persist:"editorSplitDirection"}),this.editorSplit=t.observable(null!==i.getItem("editorSplit")&&"true"===i.getItem("editorSplit")).extend({persist:"editorSplit"}),this.editorSplitSize=t.observable(i.getItem("editorSplitSize")||"50%").extend({persist:"editorSplitSize"})}}).call(this,n("Z1dp"))},qVgP:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var i=n("+qE3");const{Story:r}=n("OeYU");var o=function(){let e=new i.EventEmitter;this.emiter=e,this.story=null,this.log=[],this.onRecompile=()=>{},this.curStory={messages:[],choices:[],tags:[],paragraphEl:""},this.resetStory=()=>{this.prevSavePoints=[],this.choiceHistory=[],this.textAreaEl.innerHTML="",this.curStory={messages:[],choices:[],tags:[],paragraphEl:""},this.story.ResetState()},this.terminate=()=>{if(this.textAreaEl)try{e.removeAllListeners(),this.finished=!0}catch(t){console.warn(t)}},this.setCurStory=({messages:t,choices:e,tags:n,paragraphEl:i})=>{this.curStory={messages:t,choices:e,tags:n,paragraphEl:i}};const n=(t="",e="")=>{const n=(t=>{let e=[];for(;t.canContinue;)e.push(t.Continue().replace(/\n/g,""));return e})(this.story),i=t.includes('"')?t:`[${t}]`,r=document.createElement("p");if(t){const o=document.createElement("p");o.innerHTML=``,o.onclick=()=>app.navigateToNodeDuringPlayTest(e,i),r.appendChild(o),n.forEach(t=>{const e=document.createElement("p");e.innerHTML=t+"
        ",r.appendChild(e)})}else r.innerHTML=n.join("
        ");this.setCurStory({...this.curStory,messages:this.log?[...this.curStory.messages,t?`--${t}--`:"",n].filter(Boolean):[n],tags:this.story.currentTags,choices:this.story.currentChoices,paragraphEl:r}),a()};this.prevSavePoints=[];const o=(t,e)=>{this.prevSavePoints.push(this.story.state.toJson());const i=this.story.state.currentChoices[t].sourcePath.split(".")[0];this.story.ChooseChoiceIndex(t),n(e,i)};this.rewindStory=()=>{document.getElementById("choiceButtons").remove(),this.textAreaEl.removeChild(this.textAreaEl.lastElementChild),this.story.state.LoadJson(this.prevSavePoints.pop()),n()},this.createAndAddParagraph=e=>{if(console.log("made",e),e.innerHTML){const n=document.createElement("p");n.appendChild(e),n.className="story-playtest-bubble story-playtest-answer answer-post fade-in is-paused",this.textAreaEl.appendChild(n),t(n).removeClass("is-paused")}};const a=()=>{this.createAndAddParagraph(this.curStory.paragraphEl),this.textAreaEl.querySelectorAll("div").forEach(t=>t.remove());const t=document.createElement("div");t.id="choiceButtons",t.className="flex-wrap";const e=document.createElement("button");e.innerText="🔄",e.title="Recompile story",e.onclick=this.onRecompile,e.className="storyPreviewChoiceButton",t.appendChild(e);const i=document.createElement("button");i.innerText="🎬",i.title="Restart story",i.onclick=()=>{this.resetStory(),n()},i.className="storyPreviewChoiceButton",t.appendChild(i);const r=document.createElement("button");r.innerText="⏪",r.title="Go to previous",r.disabled=0===this.prevSavePoints.length,r.onclick=()=>{this.rewindStory(),n()},t.appendChild(r),r.className="storyPreviewChoiceButton",this.curStory.choices.forEach((e,n)=>{const i=document.createElement("button");i.innerText=e.text,i.onclick=t=>{t.stopPropagation(),o(n,e.text)},i.className="storyPreviewChoiceButton",t.appendChild(i)}),this.textAreaEl.appendChild(t),this.textAreaEl.scrollTo({top:this.textAreaEl.scrollHeight+100,left:0,behavior:"smooth"})};this.initInk=(t,e,i,o,a,s,l,c,u,d)=>{this.onRecompile=e,console.log("INIT INK"),this.finished=!1,document.getElementById(s).style.visibility="hidden",this.textAreaEl=document.getElementById(c),this.textAreaEl.innerHTML='

        Parsing ink

        .

        .

        .

        ',this.inkTextData=o,this.compiler=t,this.compiler.init(t=>{if(this.textAreaEl.innerHTML="",t.errors.length>0)return this.textAreaEl.innerHTML=`

        Parsing failed:

        >

        ${t.errors.join("

        ")}


        ${t.warnings.join("

        ")}

        `,void(this.textAreaEl.onclick=()=>{console.log("====>",t),app.data.goToErrorInkNode(this.inkTextData,t.errors[0]),this.textAreaEl.onclick=null});if(t.warnings.length>0){const e=document.createElement("p");e.className="title-warning",t.warnings.forEach(t=>{const n=document.createElement("p");n.innerText=t,n.onclick=()=>{app.data.goToErrorInkNode(this.inkTextData,t)},e.appendChild(n)}),this.createAndAddParagraph(e)}if(this.story=new r(t.story),console.log("STORY",this.story),console.warn("Warnings",t.warnings),n(),""===this.story.currentText&&0===this.story.currentChoices.length)if(a!==app.data.InkGlobalScopeNodeName)this.compiler.submit(`-> ${a}\n`+o);else{const t=o.split("\n").find(t=>t.includes("==="));this.compiler.submit(`-> ${t.split("===")[1]}\n`+o)}}).then(()=>{if(!i.recompile&&i.story&&0!==i.prevSavePoints.length)return this.story=i.story,i.childNodes.forEach(t=>this.textAreaEl.appendChild(t)),this.prevSavePoints=i.prevSavePoints,void n();o&&this.compiler.submit(o)})}}}).call(this,n("EVdn"))},tUqF:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));const i=n("Wd8k"),r=n("L8pc"),o=new i.Runner,a=n("+qE3").EventEmitter;var s=function(){this.visitedNodes=[];this.node={title:""};let t=new a;this.emiter=t;let e=[];this.commandsPassedLog=e;this.commandPassed="";let n=!0;this.finished=n,this.scrollTextStyle=!1,this.visitedChapters=[],this.self=this,this.vnChoiceSelectionCursor=">",this.startTimeWait,this.vnSelectedChoice=-1,this.vnTextScrollInterval,this.storyChapter="",this.choices={};let i,s,l,c,u,d,p,h,f=null;this.vnSelectChoice=()=>{(new Date).getTime()-this.startTimeWait<1e3||(this.choices[this.storyChapter].push(c.options[this.vnSelectedChoice]),c.select(this.vnSelectedChoice),this.emiter.emit("choiceMade",c.options[this.vnSelectedChoice]),s="",i=void 0,c=self.goToNext(),this.vnSelectedChoice=-1,this.changeTextScrollSpeed(111))},this.vnUpdateChoice=(e=0)=>{if(this.vnSelectedChoice<0)return;let n=this.vnSelectedChoice+e;n>c.options.length-1?n=0:n<0&&(n=c.options.length-1),this.vnSelectedChoice=n,i=document.createElement("DIV"),c.options.forEach((t,e)=>{const n=document.createElement("DIV");e==this.vnSelectedChoice?n.innerHTML=`${this.vnChoiceSelectionCursor} [${t}]`:n.innerHTML=`${this.vnChoiceSelectionCursor.replace(/.*/gm," ")} [${t}]`,n.onclick=t=>{t.stopPropagation(),this.vnSelectedChoice=e,this.vnUpdateChoice()},n.ondblclick=t=>{t.stopPropagation(),this.vnSelectedChoice=e,this.vnSelectChoice()},n.className="storyPreviewChoiceButton",i.appendChild(n)}),t.emit("choiceUpdated",this.vnSelectedChoice),self.updateVNHud()},this.changeTextScrollSpeed=(e=0)=>{if(e!==this.vnTextScrollInterval){if(this.vnTextScrollInterval=e,clearInterval(d),f<0){if(this.isFinishedParsing(c))return void t.emit("finished");if("TextResult"===c.constructor.name)return s=c.text,f=0,t.emit("textResult",s),void this.changeTextScrollSpeed(220);"OptionsResult"===c.constructor.name&&-1===this.vnSelectedChoice&&(this.vnSelectedChoice=0,this.vnUpdateChoice(),this.startTimeWait=(new Date).getTime())}0!==e&&(d=setInterval(this.scrollUpdateText,e))}},self.goToNext=()=>{const t=u.next().value;if(!this.isFinishedParsing(t))return"TextResult"===t.constructor.name&&t.data&&this.node.title!==t.data.title&&(s="",f=-1,this.node=self.jsonCopy(t.data),this.visitedNodes.push(t.data.title),this.emiter.emit("startedNode",this.node)),t},this.isFinishedParsing=t=>(void 0===t||null===c)&&(n||(n=!0,f=-1),n=!0,n),this.runCommand=()=>{t.emit("commandCall",c.text),e.push(c.text),c=self.goToNext(),this.isFinishedParsing(c)||("TextResult"===c.constructor.name&&(s+="\n"+c.text,t.emit("textResult",c.text)),"OptionsResult"===c.constructor.name&&(f=-1))},this.scrollUpdateText=()=>{if(!this.isFinishedParsing(c))if(f<0)"CommandResult"===c.constructor.name&&this.runCommand();else if(f>s.length){if("TextResult"===c.constructor.name){if(c=self.goToNext(),this.isFinishedParsing(c))return;"CommandResult"===c.constructor.name?this.runCommand():("TextResult"===c.constructor.name||"OptionsResult"===c.constructor.name)&&(f=-1)}}else"TextResult"===c.constructor.name&&(f+=1,l=s.substring(0,f),self.updateVNHud())},self.updateVNHud=()=>{if("TextResult"===c.constructor.name){for(;l.lastIndexOf("[img]")>l.lastIndexOf("[/img]");)f+=1,l=s.substring(0,f);for(;l.lastIndexOf("[")>l.lastIndexOf("]");)f+=1,l=s.substring(0,f)}this.scrollTextStyle&&(document.getElementById(p).innerHTML=r.parse(l)+"
        "),void 0!==i&&(this.scrollTextStyle||(document.getElementById(p).innerHTML=""),document.getElementById(p).appendChild(i))},this.terminate=()=>{try{let e=document.getElementById(p);e&&(e.innerHTML=""),e=document.getElementById(h),e&&(e.innerHTML=""),i=void 0,t.removeAllListeners(),this.finished=!0}catch(t){console.warn(t)}},this.initYarn=(e,i,a,s,l,c,u)=>{const d=["#f5ff6f","#44fe66","#e00ec0","#e93ecf","#0ec0e0","#3ecfe9","#e4dbcb","#978e7e","#666","#2f919a","deeppink","black","#97E1E9","#576574","#6EA5E0","#9EDE74","#FFE374","#F7A666","#C47862"],f=["__̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡| ̲▫̲͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡, ̴̡ı̴̡̡ ̡͌l̡̡̡̡.___","°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸","(===||:::::::::::::::>","¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>","=^..^=","|==|iiii|>-----"," ¦̵̱ ̵̱ ̵̱ ̵̱ ̵̱(̢ ̡͇̅└͇̅┘͇̅ (▤8כ−◦","(♥_♥)","龴ↀ◡ↀ龴","☁ ▅▒░☼‿☼░▒▅ ☁,","▓⚗_⚗▓","<:3 )~~~","(╯°□°)╯︵ ┻━┻","●▬▬▬▬๑۩۩๑▬▬▬▬▬●","(/)(Ö,,,,Ö)(/)","/)^3^(\\","( . Y . )","< )))) ><","(ノಠ益ಠ)ノ彡","d(^o^)b¸¸♬·¯·♩¸¸♪·¯·♫¸¸","O=('-'Q)","-`ღ´-","ˁ(⦿ᴥ⦿)ˀ","(╥﹏╥)","✲´*。.❄¨¯`*✲。❄。*。¨¯`*✲","▂▃▅▇█▓▒░۩۞۩ ۩۞۩░▒▓█▇▅▃▂","( •_•)O*¯`·.¸.·´¯`°Q(•_• )","┻━┻︵ (°□°)/ ︵ ┻━┻","|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡ ̴̡ı̴̴̡ ̡l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ |","❤◦.¸¸. ◦✿","ʕʘ̅͜ʘ̅ʔ","( ๏ Y ๏ )","ʕ•̫͡•ʕ*̫͡*ʕ•͓͡•ʔ-̫͡-ʕ•̫͡•ʔ*̫͡*ʔ-̫͡-ʔ","(っ◕‿◕)っ","❚█══█❚","─=≡Σ((( つ◕ل͜◕)つ","^ↀᴥↀ^","༼ つ ͡◕ Ѿ ͡◕ ༽つ","ᕦ(ò_óˇ)ᕤ","┬┴┬┴┤ ͜ʖ ͡°) ├┬┴┬┴","[̲̅$̲̅(̲̅5)̲̅$̲̅]","(ꈍ⌓ꈍ✿)","(๑•́ ₃ •̀๑) ♡","( • )( • )ԅ(≖⌣≖ԅ)","(。々°)","⊂(´・◡・⊂ )∘˚˳°","( ㅅ )","(ノ☉ヮ⚆)ノ ⌒*:・゚✧","(-‸ლ)","(‿|‿)","(㇏(•̀ᵥᵥ•́)ノ)","ʚ✟⃛ɞ","(′ꈍωꈍ‵)","♚ ♛ ♜ ♝ ♞ ♟ ♔ ♕ ♖ ♗ ♘ ♙","(´ᴗ`)(´ᴗ`)","♥(´∀`)","ฅ(˵●ﻌ●˵)ฅ"];if(h=l,p=a,this.yarnDataObject=e,this.startChapter=i,this.resourcesPath=s,this.finished=!1,this.scrollTextStyle="npc"===c,document.getElementById(h).innerHTML="
        🚥Press/Hold Z or 📱Double-click/Tap to advance
        ",t.on("startedNode",(function(t){document.getElementById(h).innerHTML+="

        📜 --- Loaded next node ---",document.getElementById(h).innerHTML+=` ${f[Math.floor(Math.random()*f.length)]}`,document.getElementById(h).innerHTML+="
           Title: "+t.title+"",t.tags.length>0&&t.tags[0].length>0&&(document.getElementById(h).innerHTML+="
           Tags: "+t.tags+"")})),t.on("choiceMade",(function(t){this.scrollTextStyle?document.getElementById(h).innerHTML+="
        🐙Player chose: >"+t+"":document.getElementById(h).innerHTML+=`

        ${r.parse(t)}

        `})),t.on("commandCall",(function(t){document.getElementById(h).innerHTML+=`
        🐣Command call: <<${t}>>`})),this.scrollTextStyle||(t.on("textResult",(function(t){document.getElementById(h).innerHTML+=`

        ${r.parse(t)}

        `,document.getElementById(p).innerHTML='

        .

        .

        .

        ',document.getElementById(p).className="story-playtest-bubble",document.getElementById(h).scrollTo({top:document.getElementById(h).scrollHeight,left:0,behavior:"smooth"})})),t.on("choiceUpdated",(function(t){document.getElementById(p).className="story-playtest-answer"}))),t.on("finished",(function(){n=!0,t.removeAllListeners()})),Array.isArray(e))o.load(e);else{if(!("nodes"in e))return;o.load(e.nodes)}this.loadYarnChapter(i),o.variables.data={},u.forEach((function(t){console.log(t),o.variables.set(t.key,t.value)}))},this.loadYarnChapter=t=>{n=!1,this.storyChapter=t,this.choices[this.storyChapter]=[],this.visitedChapters.push(t),u=o.run(t),c=self.goToNext(),s=c.text,this.changeTextScrollSpeed(100)},this.wasChoiceMade=(t,e=this.storyChapter)=>!!this.choices[e].includes(t),this.timesNodeWasVisited=t=>{let e=0;return this.visitedNodes.forEach((n,i)=>{n===t&&(e+=1)}),e},self.jsonCopy=t=>JSON.parse(JSON.stringify(t))}},uMdg:function(t,e,n){},wt9v:function(t,e){function n(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="wt9v"},zn8O:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var i=function({app:e,createButton:n,createToggle:i,onYarnEditorOpen:r,onYarnSetLanguage:o}){const a=this;this.name="Transcribe",this.transcribeEnabled=t.observable(!1),o(t=>{console.log(t),spoken.recognition.lang=t.language}),this.speakText=function(){const t=e.editor.getSelectedText(),n=t||e.editor.getSession().getValue();spoken.voices().then(t=>{const i=e.settings.language().split("-")[0],r=t.filter(t=>!t.lang.indexOf(i));console.log(i,r),r.length?(console.log("Loaded voice",r[0]),spoken.say(n,r[0])):spoken.say(n)})},this.startCapture=function(){spoken.listen({continuous:!0}).then(t=>{if(console.log(t),e.editing())e.insertTextAtCursor(t+". "),document.getElementById("speakTextBtnBubble").title="Transcribe";else if("open"===t){console.log("try open...");var n=e.getFirstFoundNode(e.$searchField.val().toLowerCase()).title();console.log("try open:",n),e.openNodeByTitle(n)}else"clear"===t?(e.$searchField.val(""),e.updateSearch()):(e.$searchField.val(t),e.updateSearch());spoken.listen.stop().then(()=>{e.editing()&&(document.getElementById("speakTextBtnBubble").style.visibility="hidden"),this.continueCapture()})}).catch(t=>spoken.listen.stop().then(()=>this.continueCapture()))},this.continueCapture=function(){spoken.delay(500).then(()=>{spoken.recognition.continuous&&e.startCapture()})},this.toggleTranscribing=function(){const t=spoken.listen.available(),n=document.getElementById("speakTextBtnBubble");null!==n&&(n.style.visibility="hidden",t&&a.transcribeEnabled()?(spoken.listen.on.partial(t=>{e.editing()?(n.style.visibility="visible",n.title=`🗣️ ${t} 🦜`):e.$searchField.val(`🗣️ ${t} 🦜`)}),e.startCapture()):(n.style.visibility="hidden",spoken.recognition.continuous=!1,spoken.listen.stop()))},this.hearText=function(){spoken.listen.available()?(spoken.listen.on.partial(t=>{console.log(t),document.getElementById("speakTextBtnBubble").title=`🗣️ ${t} 🦜`}),spoken.listen().then(t=>{e.insertTextAtCursor(t+" "),document.getElementById("speakTextBtnBubble").title="Transcribe"}).catch(t=>console.warn(t.message))):Swal.fire({title:"Speech recognition not available!",icon:"error"})},r(()=>{n(a.name,{id:"hearTextBtnId",title:"Hear text",attachTo:"bbcodeToolbar",onClick:"hearText()",iconName:"voice",className:"bbcode-button bbcode-button-right hide-when-narrow"}),i(a.name,{id:"transcribeToggleBtnId",iconName:"microphone",attachTo:"editorFooter",className:"transcribe-button",title:"Transcribe",tooltipId:"speakTextBtnBubble",toggleValueKey:"toggleTranscribing",onToggle:"toggleTranscribing",enableKey:"transcribeEnabled"}),a.toggleTranscribing()})}}).call(this,n("Z1dp"))}},[["e6Wu",1,2]]]); \ No newline at end of file diff --git a/js/main.e335dd34512b0477f4ea.js b/js/main.e335dd34512b0477f4ea.js new file mode 100644 index 000000000..48d99e107 --- /dev/null +++ b/js/main.e335dd34512b0477f4ea.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{0:function(e,t){},1:function(e,t){},10:function(e,t){},"1mrn":function(e,t,n){},2:function(e,t){},"2Qx2":function(e,t,n){"use strict";(function(e,i){n.d(t,"a",(function(){return d}));var o=n("W2Rx"),a=n("oj90");const s=n("33yf"),r=n("OeYU"),l=n("Iab2"),d={appInstanceStates:e.observable([]),restoreFromLocalStorage:e.observable(!0),isDocumentDirty:e.observable(!1),editingPath:e.observable(null),editingName:e.observable("NewFile"),editingType:e.observable("json"),editingFolder:e.observable(null),documentHeader:e.observable(null),lastStorageHost:e.observable("LOCAL"),lastEditedUnix:e.observable(new Date),lastSavedUnix:e.observable(null),inkCompiler:null,editingFileFolder:function(e=""){const t=d.editingPath()?d.editingPath():"";return e.length>0?s.join(s.dirname(t),e):s.dirname(t)},startNewFile:function(e="NewFile",t="json"){d.editingPath(null),d.editingName(e),d.editingType(t),d.editingFolder(null),d.documentHeader(null),app.workspace.selectedNodes=[],app.editing(null),t===a.FILETYPE.INK&&app.settings.documentType("ink"),app.nodes([app.newNode(!0).title("ink"===app.settings.documentType()?d.InkGlobalScopeNodeName:"Start").body("ink"===app.settings.documentType()?"":"Empty text")]),app.tags([]),app.updateNodeLinks(),app.workspace.warpToNodeByIdx(0),d.lastStorageHost("LOCAL"),d.isDocumentDirty(!0),app.refreshWindowTitle(),d.saveAppStateToLocalStorage(),app.ui.dispatchEvent("newYarnFileStarted")},askForFileName:function(){Swal.fire({title:"Enter a New File Name",input:"text",inputPlaceholder:"NewFile",showCancelButton:!0}).then(e=>{(e.value||""===e.value)&&d.startNewFile(e.value||"NewFile")})},setNewFile:function(){Swal.fire({title:"Create a New File?",text:`Any unsaved progress to ${d.editingName()}.${d.editingType()} will be lost!\n Path: ${d.editingPath()}\n Storage: ${d.lastStorageHost()}\n `,icon:"warning",showCancelButton:!0,confirmButtonText:"New file",cancelButtonText:"No, cancel!"}).then(e=>{e.value&&d.askForFileName()})},loadDocumentStateTabFromIndex:function(e){console.log("ATTEMPT TO LOAD STATE",e),app.settings.selectedFileTab(e),d.loadAppStateFromLocalStorage()},getCurrentAppState:function(){return{editingPath:d.editingPath(),editingName:d.editingName(),documentType:app.settings.documentType(),editingType:d.editingType(),editingFolder:d.editingFolder(),editingTitle:app.editing()?app.editing().title():null,nodes:d.getNodesAsObjects(),documentHeader:d.documentHeader(),tags:app.tags(),editorSelection:app.editor?app.editor.selection.getRange():null,transform:app.workspace.transform,scale:app.workspace.scale,lastStorageHost:d.lastStorageHost(),lastEditedUnix:d.lastEditedUnix()||"",lastSavedUnix:d.lastSavedUnix(),pluginStorage:app.plugins.pluginStorage}},deleteDocumentStateTab:function(e){Swal.fire({title:"Are you sure?",text:`Are you sure you want to close this file? Any unsaved changes to ${d.editingName()}.${d.editingType()} will be lost!\n Path: ${d.editingPath()||""}\n Storage: ${d.lastStorageHost()}\n `,icon:"warning",showCancelButton:!0,confirmButtonText:"Yes close",cancelButtonText:"Cancel",reverseButtons:!0}).then(t=>{if(t.value){console.log("DELETE TAB",d.appInstanceStates(),e);const t=d.appInstanceStates().filter((t,n)=>n!==e).map(e=>({...e}));d.appInstanceStates([...t]),d.saveAppStateToLocalStorage(!1),setTimeout(()=>{const t=e>d.appInstanceStates().length-1?d.appInstanceStates().length-1:e;d.loadDocumentStateTabFromIndex(t)},500),console.log(d.appInstanceStates(),"resulting mutation",t)}})},addDocumentState:function({editingName:e,editingType:t,yarnData:n,checked:i}){d.appInstanceStates([...d.appInstanceStates(),{...d.getCurrentAppState()}]),console.log("DOCUMENT TAB ADDED",d.appInstanceStates()),d.saveAppStateToLocalStorage(),d.loadDocumentStateTabFromIndex(d.appInstanceStates().length-1),i?(d.editingName(e),d.editingType(t)):d.startNewFile(e,t),console.log({editingName:e,yarnData:n,editingType:t,checked:i})},addDocumentStateTab:function(){d.promptFileNameAndFormat(d.addDocumentState,null,"📜 Name of new file"," Copy of "+d.editingName())},saveAppStateToLocalStorage:function(e=!0){if(!d.restoreFromLocalStorage())return;const t=app.settings.storage;d.isDocumentDirty(!0),d.lastEditedUnix(new Date),app.refreshWindowTitle();const n=[...d.appInstanceStates()];e&&(n[app.settings.selectedFileTab()]=d.getCurrentAppState()),d.appInstanceStates(n),t.setItem("appStates",JSON.stringify(d.appInstanceStates())),app.ui.dispatchEvent("yarnSavedStateToLocalStorage")},loadAppStateFromLocalStorage:function(){if(!d.restoreFromLocalStorage())return;const e=app.settings.storage;e.getItem("appState")&&e.clear();const t=JSON.parse(e.getItem("appStates")),n=t[app.settings.selectedFileTab()];if(d.appInstanceStates(t),console.log("APP state",t,n),n){const{editingPath:e,lastStorageHost:t,editingName:i,editingType:o,documentType:a,editingFolder:s,editingTitle:r,editorSelection:l,nodes:c,documentHeader:p,tags:u,transform:g,scale:h,pluginStorage:m,lastEditedUnix:f,lastSavedUnix:y}=n;d.editingPath(e),d.editingName(i),d.editingType(o),app.settings.documentType(a),d.editingFolder(s),d.lastStorageHost(t),d.lastEditedUnix(f),d.lastSavedUnix(y),app.nodes([]),d.getNodesFromObjects(c).forEach(e=>app.nodes.push(e)),app.tags(u),app.updateNodeLinks(),app.workspace.setTranslation(g.x,g.y),app.workspace.setZoom(4*h),r&&(app.editNode(app.nodes().find(e=>e.title()===r)),l&&app.editor.selection.setRange(l)),app.plugins.pluginStorage=m,d.documentHeader(p),d.isDocumentDirty(!0),app.refreshWindowTitle(),app.ui.dispatchEvent("yarnLoadedStateFromLocalStorage")}},readFile:function(e,t,n){d.getFileData(e,t).then(t=>{d.editingPath(e.path),d.editingType(t.type),d.loadData(t.data,t.type,n)})},setNewFileStats:function(e,t,n="LOCAL"){console.log("Updated save data",e,t),d.editingName(e.replace(/^.*[\\\/]/,"")),d.isDocumentDirty(!1),d.editingPath(t),d.lastStorageHost(n),app.refreshWindowTitle()},openFile:function(e,t){const n=d.editingPath()?"Any unsaved progress to "+d.editingName()+" will be lost.":"Any unsaved progress will be lost.";Swal.fire({title:"Are you sure you want to open another file?",text:n,icon:"warning",showConfirmButton:!0,showCancelButton:!0}).then(n=>{!0===n.value&&(d.readFile(e,t,!0),d.setNewFileStats(t,e.path),app.refreshWindowTitle())})},openFileFromFilePath:function(e){const t=app.path.basename(e);i.ajax({url:e,async:!1,success:n=>{const i=d.getFileType(t);i===a.FILETYPE.UNKNOWN?Swal.fire({title:"Unknown filetype!",icon:"error"}):(d.loadData(n,i,!0),d.setNewFileStats(t,e),d.editingType(i))}})},getFileData:function(e,t){return new Promise((n,i)=>{const o=new FileReader;o.onload=function(s){const r=d.getFileType(t);r===a.FILETYPE.UNKNOWN?(Swal.fire({title:"Unknown filetype!",icon:"error"}),i()):n({file:e,type:r,data:o.result,name:e.name})},o.readAsText(e)})},openFiles:async function(e,t){const n=document.getElementById("open-file").files;for(const e of Object.values(n)){const t=await d.getFileData(e,e.name);console.log("FILEDATA",t);const n=t.name,i=t.type;d.addDocumentState({editingName:n,editingType:i,yarnData:t.data}),d.loadData(t.data,i,!0)}},openFolder:function(e,t){editingFolder=t,Swal.fire({text:"openFolder not yet implemented e: "+e+" foldername: "+t,icon:"error"})},appendFile:function(e,t){d.readFile(e,t,!1)},getFileType:function(e){const t=e.toLowerCase();return t.endsWith(".json")?a.FILETYPE.JSON:t.endsWith(".yarn.txt")?a.FILETYPE.YARN:t.endsWith(".ink")?a.FILETYPE.INK:t.endsWith(".yarn")?a.FILETYPE.YARN:t.endsWith(".xml")?a.FILETYPE.XML:t.endsWith(".txt")?a.FILETYPE.TWEE:t.endsWith(".tw2")||t.endsWith(".twee")?a.FILETYPE.TWEE2:a.FILETYPE.UNKNOWN},dispatchEventDataLoaded:function(){var e=new CustomEvent("yarnLoadedData");e.document=document,e.data=d,e.app=app,window.dispatchEvent(e),window.parent.dispatchEvent(e)},restoreSettingsFromDocumentHeader:function(){if(null!==d.documentHeader()){const e=d.documentHeader();console.log("Apply settings from file header:",e),"markupLanguage"in e&&app.settings.markupLanguage(e.markupLanguage),"language"in e&&app.settings.language(e.language),"filetypeVersion"in e&&app.settings.filetypeVersion(e.filetypeVersion),app.settings.apply()}},loadData:function(e,t,n){const i=[],o=e=>{for(let t=0;t{try{r.title=s[e].split("//yarn-editor-metadata:")[0].replace(/===/g,"").trim();const{x:t,y:n,colorID:i}=JSON.parse(s[e].split("//yarn-editor-metadata:")[1]);r.position={x:parseInt(t),y:parseInt(n)},r.colorID=i}catch(e){console.warn("node metadata failed parse: ",e)}};for(let e=0;e-1)null==r&&(r={}),r.title=s[e].substr(7,s[e].length-7);else if(s[e].indexOf("position:")>-1){null==r&&(r={});var c=s[e].substr(9,s[e].length-9).split(",");r.position={x:Number(c[0].trim()),y:Number(c[1].trim())}}else s[e].indexOf("colorID:")>-1?(null==r&&(r={}),r.colorID=Number(s[e].substr(9,s[e].length-9).trim())):s[e].indexOf("tags:")>-1?(null==r&&(r={}),r.tags=s[e].substr(6,s[e].length-6)):"---"===s[e].trim()&&(l=!0,r.body="");null!=r&&i.push(r),app.setDocumentType("yarn")}else if(t===a.FILETYPE.TWEE||t===a.FILETYPE.TWEE2){s=e.split("\n"),r=null;for(var p=0,u=0;u0&&y>0&&(h=s[u].substr(f+1,y-f-1));var b=s[u].indexOf("<"),v=s[u].indexOf(">");if(b>0&&v>0){var w=s[u].substr(b+1,v-b-1).split(",");m.x=parseInt(w[0]),m.y=parseInt(w[1])}var T=0;f>0?T=f:b>0&&(T=b),g=(g=T?s[u].substr(3,T-3):s[u].substr(3)).trim(),r.title=g,r.tags=h,r.body="",r.position=m}else null!=r&&(r.body.length>0&&(s[u]+="\n"),r.body+=s[u]);null!=r&&i.push(r),app.setDocumentType("yarn")}else if(t===a.FILETYPE.XML){app.setDocumentType("yarn");var S=(new DOMParser).parseFromString(e,"text/xml");if(void 0!==(e=a.Utils.xmlToObject(S)))for(let t=0;t{n&&app.nodes.removeAll(),d.getNodesFromObjects(i).forEach(e=>app.nodes.push(e))}),d.editingType(t),d.restoreSettingsFromDocumentHeader(),app.updateNodeLinks(),app.workspace.warpToNodeByIdx(0),d.isDocumentDirty(!1),d.addGlobalScopeToInkDoc(),d.dispatchEventDataLoaded()},addGlobalScopeToInkDoc:function(){"ink"!==app.settings.documentType()||app.nodes().find(e=>e.title().trim()===d.InkGlobalScopeNodeName)||app.newNode(!0).title(d.InkGlobalScopeNodeName).x(-400)},getNodeFromObject:function(e){return new o.a({title:e.title,body:e.body,tags:e.tags,colorID:e.colorID,x:parseInt(e.position.x),y:parseInt(e.position.y)})},getNodeAsObject:function(e){return{title:e.title(),tags:e.tags(),body:e.body(),position:{x:e.x(),y:e.y()},colorID:e.colorID()}},getNodesFromObjects:function(e){const t=[];return e?(e.forEach(e=>{t.push(d.getNodeFromObject(e))}),t):[]},getNodesAsObjects:function(){const e=[],t=app.nodes();for(var n=0;ne.title.trim()===d.InkGlobalScopeNodeName);if(e){if(n){const t=e.body.split(/\r\n|\r|\n/).filter(e=>e.trim().startsWith("INCLUDE "));o+=e.body.split(/\r\n|\r|\n/).filter(e=>!e.trim().startsWith("INCLUDE ")).join("\n");for(const e of t){const t=e.trim().split("INCLUDE ");if(t.length>1){const e=d.appInstanceStates().find(e=>e.editingType===a.FILETYPE.INK&&e.editingName===t[1]);if(e){o+=await d.getSaveData(a.FILETYPE.INK,null,n,e.nodes)+"\n"}}}}else o+=e.body;if(t&&o.split(/\r\n|\r|\n/).length>t)return e}for(let e=0;e0&&"\n"===s[s.length-1]||(o+="\n"),t&&o.split(/\r\n|\r|\n/).length>t)return n}}else if(e===a.FILETYPE.INKJSON){const e=await d.getSaveData("ink",null,!0),t=new Promise((t,n)=>{app.ui.toastMixin.fire({title:"Ink file is compiling",icon:"info",timer:4e3,text:"Please wait..."}),d.inkCompiler.init(i=>{i.errors.length>0?(Swal.fire({title:"Failed to parse ink file",html:`
        ${i.errors.join("
        ")}
        `,icon:"error"}).then(()=>d.goToErrorInkNode(e,i.errors[0])),n()):(console.log("Warnings",i.warnings),app.ui.toastMixin.fire({animation:!0,title:i.warnings.length>0?"Ink file compiled with some warnings":"Ink file compiled successfully",icon:i.warnings.length>0?"warning":"success",text:i.warnings.join("\n")}),console.log({responseStory:i.story}),t(JSON.stringify(i.story,null,"\t")))}).then(()=>d.inkCompiler.submit(e))});o=await t}else if(e===a.FILETYPE.YARN)for(let e=0;e0&&"\n"===s[s.length-1]||(o+="\n"),o+="===\n"}else if(e===a.FILETYPE.RENPY)for(let e=0;e0&&"\n"===t[t.length-1]||(o+="\n");let n=!1,a=!1,s="";const r=i[e].tags.includes("renpy");t.split("\n").forEach(e=>{const t=e.trim(),i=a?"\t\t":"\t";if(r)s+=`${i}${e}\n`;else if(t.startsWith("[[")){const e=t.replace(/[\[\[]|[\]\]]]/g,"").split("|");e.length>1?(n||(s+=i+"menu:\n",n=!0),s+=`${i}\t"${e[0].trim()}":\n${i}\t\tjump ${e[1].trim()}\n`):s+=`${i}jump ${e[0].trim()}\n`}else if(t.startsWith("<\>|if/g,"").split(/==|!=|>||==|!=|<)/);s+=e.length>1&&n?`\tif ${e[0].trim()} ${n[0]} ${e[1].trim()}:\n`:`\t# ${t}\n`,a=!0}else if(t.startsWith("<\>|elseif/g,"").split(/==|!=|>||==|!=|<)/);s+=e.length>1&&n?`\telif ${e[0].trim()} ${n[0]} ${e[1].trim()}:\n`:`\t# ${t}\n`,a=!0}else if(t.startsWith("<\$]|set /g,"").split("=");console.log({set:e}),s+=e.length>1?`${i}$ ${e[0].trim()} = ${e[1].trim()}\n`:`${i}#$ ${e[0].trim()} = 0:\n`}else t.startsWith("<<")?s+=`${i}${t.replace(/[\<\>]/g,"")}\n`:t.startsWith("//")?s+=`${i}#${t.substring(2)}\n`:t.length>0&&(t.endsWith('"')?s+=`${i}${t}\n`:s+=`${i}"${t}"\n`);n=!1}),o+=s+"\n"}else if(e===a.FILETYPE.TWEE)for(let e=0;e0&&(r=" ["+i[e].tags+"]"),o+=":: "+i[e].title+r+"\n",o+=i[e].body+"\n\n"}else if(e===a.FILETYPE.TWEE2)for(let e=0;e0&&(r=" ["+i[e].tags+"]");var l=" <"+i[e].position.x+","+i[e].position.y+">";o+=":: "+i[e].title+r+l+"\n",o+=i[e].body+"\n\n"}else if(e===a.FILETYPE.XML){o+="\n";for(let e=0;e\n",o+="\t\t"+i[e].title+"\n",o+="\t\t"+i[e].tags+"\n",o+="\t\t"+i[e].body+"\n",o+='\t\t\n',o+="\t\t"+i[e].colorID+"\n",o+="\t\n";o+="\n"}return d.isDocumentDirty(!1),app.refreshWindowTitle(),o},saveTo:function(e,t,n=null){app.fs&&app.fs.writeFile(e,t,{encoding:"utf-8"},(function(t){d.editingPath(e),n&&n(),t?Swal.fire({title:"Error Saving Data to "+e+": "+t,icon:"error"}):(app.ui.notification.fire({title:"Saved!",icon:"success"}),app.ui.dispatchEvent("yarnSavedData"),d.setNewFileStats(e,e,"LOCAL"))}))},openFileDialog:function(e,t){e.bind("change",(function(n){t(n.currentTarget.files[0],e.val());var i="";null!=e.attr("nwsaveas")&&(i='nwsaveas="'+e.attr("nwsaveas")+'"'),null!=e.attr("accept")&&(i='accept="'+e.attr("accept")+'"'),e.parent().append('"),e.unbind("change"),e.remove()})),e.trigger("click")},saveFileDialog:function(e,t,n){const i=(d.editingName()||"").replace(/\.[^/.]+$/,"")+"."+t;if(app.electron)app.electron.remote.dialog.showSaveDialog({title:"Saving "+i,filters:[{name:t+" file",extensions:[t]}],defaultPath:i}).then(e=>{d.saveTo(e.filePath,n)}).catch(e=>{console.error(e)});else{var o=new Blob([n],{type:"text/plain;charset=utf-8"});l(o,i)}},insertImageFileName:function(){d.openFileDialog(i("#open-image"),(function(e,t){app.insertTextAtCursor(e.path?e.path:e.name)}))},tryOpenFile:function(){d.openFileDialog(i("#open-file"),d.openFiles)},promptFileNameAndFormat:function(e,t=null,n="💾 Save file - enter file name",i=""){const o=d.editingName().replace(/\.[^/.]+$/,"")+"(new)."+d.editingType();Swal.fire({title:n,html:` \n \n ${t&&t.map(e=>`\n ${i?`

        ${i}`:""}\n `,onOpen:()=>{"NewFile"!==d.editingName()&&(document.getElementById("swal-input1").value=o)},showCancelButton:!0,preConfirm:()=>({name:document.getElementById("swal-input1").value,checked:!!i&&document.getElementById("swal-checkbox-checked").checked})}).then(({value:t})=>{if(t){const{name:n,checked:i}=t,o=n.split(".").pop(),s=Object.values(a.FILETYPE).includes(o)?o:d.editingType(),r=(n||"").replace(/\.[^/.]+$/,"")+"."+s;d.getSaveData(s).then(t=>{e({editingName:r,editingType:s,yarnData:t,checked:i})})}})},tryShareFilePwa:function(e){d.promptFileNameAndFormat(({editingName:e,yarnData:t})=>{const n=[new Blob([t],{type:"text/plain"})],i=new File(n,e,{});navigator.canShare&&navigator.canShare({files:[i]})?navigator.share({title:e,text:t,file:[i]}).then(()=>console.log("Successful share")).catch(e=>console.log("Error sharing",e)):Swal.fire({title:"Web Share API is not supported in your browser.\nTry using it on your smartphone or tablet...",icon:"error"})})},trySaveGist:function(e){e&&e.file&&e.file.length>0?e.get(e.file).then(t=>{const n=Object.keys(t.body.files);console.log(n),d.promptFileNameAndFormat(({editingName:t,yarnData:n})=>{d.editingName(t),e.edit(e.file,{files:{[t]:{content:n}}}),Swal.fire("Saved!","The Yarn has been saved to gist "+e.file,"success"),d.lastStorageHost("GIST"),d.isDocumentDirty(!1),app.refreshWindowTitle()},n)}):(Swal.fire("Not configured","Your github settings are not configured","warning"),app.ui.openSettingsDialog())},openGist:function(e,t){const n=d.getFileType(t);d.loadData(e,n,!0),d.isDocumentDirty(!1),d.lastStorageHost("GIST"),d.editingPath(null),d.editingName(t),app.refreshWindowTitle()},tryOpenGist:function(e){e&&e.file&&e.file.length>0?e.get(e.file).then(e=>{const t=e.body.files,n={};Object.keys(t).forEach(e=>{n[e]=e}),Swal.fire({title:"🐙 Open file from a gist",input:"select",inputOptions:n,inputAttributes:{autocomplete:"off"},inputPlaceholder:"Select a file from the gist",showCancelButton:!0}).then(({value:e})=>{if(e){const n=t[e].content;d.openGist(n,e)}})}):(Swal.fire("Not configured","Your github settings are not configured","warning"),app.ui.openSettingsDialog())},tryOpenFolder:function(){d.openFileDialog(i("#open-folder"),d.openFolder)},tryAppend:function(){d.openFileDialog(i("#open-file"),d.appendFile)},save:function(){app.editingVisualStudioCodeFile()||(d.editingPath()?d.trySaveCurrent():d.trySave(a.FILETYPE.JSON))},trySave:function(e){d.getSaveData(e).then(t=>d.saveFileDialog(i("#save-file"),e,t))},trySaveCurrent:function(){if(d.isDocumentDirty())if("GIST"===d.lastStorageHost()){const e=app.gists;e.get(e.file).then(t=>{d.getSaveData(d.editingType()).then(t=>{d.getSaveData(d.editingType()),e.edit(e.file,{files:{[d.editingName()]:{content:t}}}),d.lastStorageHost("GIST"),d.isDocumentDirty(!1),app.refreshWindowTitle(),app.ui.toastMixin.fire({title:"Saved",text:`Saved ${d.editingName()} to Gist`})})})}else d.editingPath()?d.editingPath().length>0&&d.editingType().length>0&&d.getSaveData(d.editingType()).then(e=>{d.saveTo(d.editingPath(),e)}):app.gists&&app.gists.options.token?d.trySaveGist(app.gists):d.trySave(a.FILETYPE.JSON)},doesFileExist:function(e){return!1},triggerPasteClipboard:function(){if(app.electron){const e=app.electron.clipboard.readText();app.clipboard=e,document.execCommand("paste")}else navigator.clipboard&&navigator.clipboard.readText().then(e=>{app.clipboard=e}).catch(e=>{app.clipboard=app.editor.getSelectedText(),console.log("No clipboard access",e,"using local instead")}),setTimeout(()=>app.insertTextAtCursor(app.clipboard),100)},triggerCopyClipboard:function(){if(app.electron)app.electron.clipboard.writeText(app.editor.getSelectedText()),app.clipboard=app.editor.getSelectedText();else{const e=app.editor.getSelectedText();app.clipboard=e,navigator.clipboard&&e.length>0&&navigator.clipboard.writeText(e).then(()=>{app.clipboard=e})}},InkCompiler:function(){this.errors=[],this.warnings=[],this.errorHandler=(e,t)=>{let n=e.match(/^(ERROR|RUNTIME ERROR): ('([^']+)' )?line (\d+): (.*)/);let i=e.match(/^(WARNING|RUNTIME WARNING|TODO): ('([^']+)' )?line (\d+): (.*)/);n?this.errors.push(e):i&&this.warnings.push(e)},this.compilerOptions=new r.CompilerOptions(null,[],!1,this.errorHandler),this.ready=!1,this.worker=null,this.onComplete=()=>{},this.init=(e=(()=>{}))=>(this.onComplete=e,new Promise((e,t)=>{e()})),this.submit=e=>{this.errors=[],this.warnings=[];const t=new r.Compiler(e,this.compilerOptions).Compile().ToJson(),n={story:JSON.parse(t),warnings:this.warnings,errors:this.errors};this.onComplete(n)},this.getInkErrorGotoNode=async(e,t)=>{const n=t.substr(t.lastIndexOf(":")+1,t.length).trim();try{const e=Number(t.match(/line ([0-9]+):/)[1]);return{ln:e,node:(await d.getSaveData(a.FILETYPE.INK,e)).title,find:n}}catch(e){return console.error(e),null}}},InkGlobalScopeNodeName:"INK_GLOBAL_SCOPE",goToErrorInkNode:(e,t)=>{d.inkCompiler.getInkErrorGotoNode(e,t).then(e=>{if(e){const{node:t,ln:n,find:i}=e;app.openNodeByTitle(t,i)}})}}}).call(this,n("Z1dp"),n("EVdn"))},3:function(e,t){},"3ozf":function(e,t,n){},4:function(e,t){},5:function(e,t){},"5aMW":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var i=n("tUqF"),o=n("qVgP");const{JSONEditor:a}=n("JGHU");var s=function({app:t,createButton:s,addSettingsItem:r,getPluginStore:l,onYarnEditorOpen:d,onYarnInPreviewMode:c,onYarnSavedNode:p,onYarnSetDocumentType:u,onKeyUp:g,onKeyDown:h,onLoad:m,setPluginStore:f}){const y=this;this.name="Runner",this.onOpenDialog=async()=>{let e=null;const{value:t}=await Swal.fire({title:"Playtest starting variables",html:'
        ',focusConfirm:!1,customClass:"swal-wide",onOpen:()=>{n("1mrn"),e=new a({id:"jsoneditor"});const t=l(y.name);console.log({editor:e}),e.setValue("object"!=typeof t.variables?[{key:"er",value:"erd"}]:t.variables),f(y.name,"runnerVariablesOpen",!0)},preConfirm:()=>(f(y.name,"runnerVariablesOpen",!1),e.getValue())});t&&f(y.name,"variables",t)},m(()=>{r({title:"Playtesting Style",valueKey:"playtestStyle",defaultValue:"chat",optionsKey:"availablePlaytestStyles",options:[{id:"npc",name:"Npc bubble"},{id:"chat",name:"Chat messages"}],setterKey:"setPlaytestStyle",settingsColumn:"A"}),s(y.name,{name:"Playtest variables",attachTo:"fileMenuDropdown",onClick:"onOpenDialog()",iconName:"cog"}),l(y.name).runnerVariablesOpen&&y.onOpenDialog()});const b=()=>{if("yarn"===t.settings.documentType())this.previewStory=new i.a,this.gotoLastPlayNode=function(){t.editing()&&t.editing().title()!==y.previewStory.node.title&&t.openNodeByTitle(y.previewStory.node.title),t.editor.focus()},this.advanceStoryPlayMode=function(e=5){y.previewStory.finished?(y.togglePlayMode(!1),y.gotoLastPlayNode()):(y.previewStory.changeTextScrollSpeed(e),-1!=y.previewStory.vnSelectedChoice&&5===e&&y.previewStory.vnSelectChoice())},this.togglePlayMode=function(n=!1){const i=e(".editor")[0],o=document.getElementById("storyPlayButton"),a=document.getElementById("editor-play");if(e("#editor-play").addClass("inYarnMode"),e("#commandDebugLabel").addClass("inYarnMode"),t.isEditorInPlayMode(n),n){i.style.display="none",e(".bbcode-toolbar").addClass("hidden"),a.style.display="flex",e(o).addClass("disabled"),y.previewStory.emiter.on("finished",(function(){y.togglePlayMode(!1),y.gotoLastPlayNode()})),y.previewStory.emiter.on("startedNode",(function(e){t.isEditorSplit&&t.workspace.warpToNode(t.getFirstFoundNode(e.title.toLowerCase().trim()))}));const n=l(y.name);console.log("variables",n),t.data.getSaveData("json").then(e=>{y.previewStory.initYarn(JSON.parse(e),t.editing().title().trim(),"NVrichTextLabel",!1,"commandDebugLabel",t.settings.playtestStyle(),n.variables||[])})}else t.editor.session.setScrollTop(a.scrollTop),a.style.display="none",i.style.display="flex",e(o).removeClass("disabled"),e(".bbcode-toolbar").removeClass("hidden"),e(".toggle-toolbar").removeClass("hidden"),e(".editor-counter").removeClass("hidden"),y.previewStory.terminate()},c(()=>y.togglePlayMode(!1)),p(()=>y.togglePlayMode(!1)),d(()=>{s(y.name,{iconName:"play",title:"Preview",attachTo:"bbcodeToolbar",onClick:"togglePlayMode(true)",className:"bbcode-button bbcode-button-right",id:"storyPlayButton"});const e=document.createElement("div");e.innerHTML=`\n
        \n

        \n
        \n
        \n `,document.getElementById("editorContainer").appendChild(e),h(e=>{if(t.editing()&&!y.previewStory.finished)switch(e.keyCode){case t.input.keys.Z:y.previewStory.changeTextScrollSpeed(10),-1!=y.previewStory.vnSelectedChoice&&y.previewStory.vnSelectChoice();break;case t.input.keys.Up:-1!=y.previewStory.vnSelectedChoice&&y.previewStory.vnUpdateChoice(-1);break;case t.input.keys.Down:-1!=y.previewStory.vnSelectedChoice&&y.previewStory.vnUpdateChoice(1)}}),g(e=>{e.keyCode===t.input.keys.Z&&(y.previewStory.changeTextScrollSpeed(200),-1!=y.previewStory.vnSelectedChoice&&y.previewStory.vnSelectChoice())})});else{this.previewStory=new o.a,this.prevSession={story:null,prevSavePoints:[],childNodes:[],recompile:!1};const n=new t.data.InkCompiler;this.togglePlayMode=function(i=!1){const o=e(".editor")[0],a=document.getElementById("storyPlayButton"),s=document.getElementById("editor-play");if(t.isEditorInPlayMode(i),e("#editor-play").addClass("inInkMode"),e("#commandDebugLabel").addClass("inInkMode"),i){s.style.display="flex",e("#editor").addClass("editor-take-half"),y.previewStory.emiter.on("finished",(function(){y.togglePlayMode(!1),y.gotoLastPlayNode()})),y.previewStory.emiter.on("startedNode",(function(e){t.isEditorSplit&&t.workspace.warpToNode(t.getFirstFoundNode(e.title.toLowerCase().trim()))}));const i=l(y.name);console.log("VARIABLES::::",i),t.data.getSaveData("ink",null,!0).then(e=>{y.previewStory.initInk(n,()=>{y.prevSession={...y.prevSession,recompile:!0},y.togglePlayMode(!0)},y.prevSession,e,t.editing().title().trim(),"NVrichTextLabel",!1,"commandDebugLabel",t.settings.playtestStyle(),i.variables||[])})}else t.editor.session.setScrollTop(s.scrollTop),s.style.display="none",o.style.display="flex",e("#editor").removeClass("editor-take-half"),e(a).removeClass("disabled"),y.prevSession={prevSavePoints:y.previewStory.prevSavePoints,story:y.previewStory.story,childNodes:y.previewStory.textAreaEl?[...y.previewStory.textAreaEl.childNodes]:[],recompile:!1},y.previewStory.terminate();t.editor.resize()},c(()=>y.togglePlayMode(!1)),p(()=>y.togglePlayMode(!1)),this.advanceStoryPlayMode=function(e=5){},d(()=>{s(y.name,{iconName:"play",title:"Preview",attachTo:"bbcodeToolbar",onClick:"togglePlayMode(!app.isEditorInPlayMode())",className:"bbcode-button bbcode-button-right",id:"storyPlayButton"});const e=document.createElement("div");e.innerHTML=`\n
        \n

        \n
        \n
        \n `,document.getElementById("editorContainer").appendChild(e)})}};b(),u(b),t.togglePlayMode=this.togglePlayMode}}).call(this,n("EVdn"))},"5dEm":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var i=n("oj90");const o=function(t){const n=this,o={toast:!0,position:"bottom",icon:"error",title:"Alignment requires two or more nodes be selected.",showConfirmButton:!1,timer:3500,timerProgressBar:!0};this.canvas=e(".arrows")[0],this.context=n.canvas.getContext("2d"),this.gridCanvas=e("#grid-canvas")[0],this.gridContext=n.gridCanvas.getContext("2d"),this.gridEnabled=!0,this.updateArrowsThrottle=50,this.updateArrowsInterval=void 0,this.deferredArrowsDrawInterval=void 0,this.nextArrowsUpdate=Number.NEGATIVE_INFINITY,this.isDrawingArrows=!1,this.selectedNodes=[],this.scale=1,this.offset={x:0,y:0},this.transform={x:0,y:0},this.isMarqueeEnabled=!1,this.marqueeSelection=[],this.marqueeRect={x1:0,y1:0,x2:0,y2:0},this.marqueeOffset=[0,0],this.zoomSpeed=.005,this.zoomLimitMin=.05,this.zoomLimitMax=1,this.setThrottle=function(e,t){const o=t?t.target.value:e;n.updateArrowsThrottle=i.Utils.clamp(o,16,250)},this.setTranslation=function(e,t,i=0){n.transform.x=e,n.transform.y=t,n.translate(i)},this.shiftTranslation=function(e,t,i=0){n.setTranslation(n.transform.x+e,n.transform.y+t,i)},this.translate=function(t){t&&n.startUpdatingArrows(),e(".nodes-holder").finish().transition({transform:"matrix("+n.scale+",0,0,"+n.scale+","+n.transform.x+","+n.transform.y+")"},t||0,"easeInQuad",(function(){t&&n.stopUpdatingArrows(),n.updateArrows(),n.updateGrid()}))},this.toWorkspaceCoordinates=(e,i)=>t.settings.snapGridEnabled()?{x:n.stepify((e-n.transform.x)/n.scale,t.settings.gridSize()),y:n.stepify((i-n.transform.y)/n.scale,t.settings.gridSize())}:{x:(e-n.transform.x)/n.scale,y:(i-n.transform.y)/n.scale},this.onPanLeft=function(){n.shiftTranslation(n.getPanAmount(),0,100)},this.onPanRight=function(){n.shiftTranslation(-n.getPanAmount(),0,100)},this.onPanUp=function(){n.shiftTranslation(0,n.getPanAmount(),100)},this.onPanDown=function(){n.shiftTranslation(0,-n.getPanAmount(),100)},this.getPanAmount=function(){return t.input.isShiftDown?100*n.scale:500*n.scale},this.setZoom=function(e){n.scale=e/4,n.translate(200)},this.onZoom=function(e,t,o){const a=n.scale,s=o*n.zoomSpeed*n.scale;n.scale=i.Utils.clamp(n.scale+s,n.zoomLimitMin,n.zoomLimitMax);const r=e-n.transform.x,l=t-n.transform.y,d=r-r*(n.scale/a),c=l-l*(n.scale/a);n.shiftTranslation(d,c)},this.onDragStart=function(e){n.offset.x=e.x,n.offset.y=e.y},this.onDragUpdate=function(e){n.isMarqueeEnabled&&t.workspace.onMarqueeEnd(),t.workspace.shiftNodes(e)},this.onDragEnd=function(){t.data.saveAppStateToLocalStorage()},this.onMarqueeStart=function(e){n.isMarqueeEnabled=!0,n.offset.x=e.x,n.offset.y=e.y,n.marqueeSelection=[],n.marqueeOffset[0]=0,n.marqueeOffset[1]=0,n.marqueeRect={x1:0,y1:0,x2:0,y2:0}},this.onMarqueeUpdate=function(e){n.isMarqueeEnabled&&(n.updateMarqueeRect(e),n.selectNodesInsideMarquee())},this.updateMarqueeRect=function(t){t.x>n.offset.x&&t.yn.offset.x&&t.y>n.offset.y?(n.marqueeRect.x1=n.offset.x,n.marqueeRect.y1=n.offset.y,n.marqueeRect.x2=t.x,n.marqueeRect.y2=t.y):t.x{const t=n.marqueeSelection.indexOf(e),o=t>=0,s=e.x(),r=e.y(),l={left:s,right:s+e.width,top:r,bottom:r+e.height},d=i.Utils.rectanglesOverlap(a,l);d&&!o&&(n.selectNodes(e),n.marqueeSelection.push(e)),!d&&o&&(n.deselectNodes(e),n.marqueeSelection.splice(t,1))})},this.onMarqueeEnd=function(){n.isMarqueeEnabled&&(0==n.marqueeSelection.length&&n.deselectAll(),n.isMarqueeEnabled=!1,n.marqueeSelection=[],n.marqueeRect={x1:0,y1:0,x2:0,y2:0},e("#marquee").css({display:"none",x:0,y:0,width:0,height:0}))},this.shiftNodes=function(e){const t={x:e.x-n.offset.x,y:e.y-n.offset.y};n.shiftTranslation(t.x,t.y),n.offset=e},this.updateGrid=function(){const i=e(".nodes-holder").offset(),o=t.settings.gridSize();if(n.gridContext.clearRect(0,0,n.gridCanvas.width,n.gridCanvas.height),t.settings.snapGridEnabled()){const r=e(window).width(),l=e(window).height(),d=i.left%(o*n.scale),c=i.top%(o*n.scale);n.gridContext.beginPath(),n.gridContext.lineWidth=.5;for(var a=d;a=315?(u=!0,h=(n.x()+n.width)*s+a.left,m=(n.y()+n.halfHeight)*s+a.top,f=e.x()*s+a.left-l,y=(e.y()+e.halfHeight)*s+a.top,p.push({x1:f+l,y1:y,x2:f-l,y2:y-d,x3:f-l,y3:y+d})):g>45&&g<135?(u=!1,h=(n.x()+n.halfWidth)*s+a.left,m=n.y()*s+a.top,f=(e.x()+e.halfWidth)*s+a.left,y=(e.y()+n.height)*s+a.top+d,p.push({x1:f,y1:y-d,x2:f-l,y2:y+d,x3:f+l,y3:y+d})):g>=135&&g<=225?(u=!0,h=n.x()*s+a.left,m=(n.y()+n.halfHeight)*s+a.top,f=(e.x()+e.width)*s+a.left+l,y=(e.y()+e.halfHeight)*s+a.top,p.push({x1:f-l,y1:y,x2:f+l,y2:y-d,x3:f+l,y3:y+d})):g>225&&g<315&&(u=!1,h=(n.x()+n.halfWidth)*s+a.left,m=(n.y()+n.height)*s+a.top,f=(e.x()+e.halfWidth)*s+a.left,y=e.y()*s+a.top-d,p.push({x1:f,y1:y+d,x2:f-l,y2:y-d,x3:f+l,y3:y-d})),c.push({x1:h,y1:m,x2:f,y2:y,drawHorizontal:u})}n.context.beginPath();for(let e of c)n.context.moveTo(e.x1,e.y1),"straight"===t.settings.lineStyle()?n.context.lineTo(e.x2,e.y2):!0===e.drawHorizontal?n.context.bezierCurveTo(e.x2,e.y1,e.x1,e.y2,e.x2,e.y2):n.context.bezierCurveTo(e.x1,e.y2,e.x2,e.y1,e.x2,e.y2);n.context.stroke(),n.context.beginPath();for(let e of p)n.context.moveTo(e.x1,e.y1),n.context.lineTo(e.x2,e.y2),n.context.lineTo(e.x3,e.y3);n.context.fill(),n.isDrawingArrows=!1},this.bringToFront=function(t){const n=e(t),o=i.Utils.getHighestZ(n.parent());n.css("z-index",o+1)},this.selectAll=function(){n.selectNodes(t.nodes())},this.deselectAll=function(){n.deselectNodes(t.nodes())},this.selectNodes=function(e){const i=Array.isArray(e)?e:[e];for(let e of i)if(e.active()&&!n.selectedNodes.includes(e)&&t.canEditNodeMeta(e.title())){if(t.input.isScreenTouched&&t.input.isDragging)return;n.selectedNodes.push(e),e.setSelected(!0)}},this.deselectNodes=function(e){const t=Array.isArray(e)?e:[e];for(let e of t){const t=n.selectedNodes.indexOf(e);e.active()&&t>=0&&(n.selectedNodes.splice(t,1),e.setSelected(!1))}},this.getSelectedNodes=function(){return 1===n.selectedNodes.length?[n.selectedNodes[0]]:Array.apply(this,n.selectedNodes)},this.warpToNodeByIdx=function(e){n.warpToNode(t.nodes()[e]),t.focusedNodeIdx=e},this.warpToSelectedNodeByIdx=function(e){n.warpToNode(n.getSelectedNodes()[e]),t.focusedNodeIdx=e},this.warpToNode=function(t){if(t){var i=e(t.element);n.warpToXY(t.x()||t.createX,t.y()||t.createY),i.clearQueue(),i.transition({outlineColor:"pink",outlineWidth:2,outlineOffset:0},500),setTimeout(()=>{i.transition({outlineColor:"transparent",outlineWidth:1,outlineOffset:50},300)},700)}},this.warpToXY=function(i,o){const a=-i*n.scale,s=-o*n.scale,r=e(window).width()/2,l=e(window).height()/2,d=100*n.scale/2,c=100*n.scale/2;n.setTranslation(a+r-d+t.getSplitEditorXOffset(),s+l-c,100)},this.alignV=function(){if(t.input.isCtrlDown)return void n.reduceAlignV();const e=t.nodes().filter(e=>e.selected).sort((e,t)=>e.y()>t.y()?1:e.y(){e.moveTo(i.x(),e.y())})},this.reduceAlignV=function(){const e=t.settings.gridSize(),i=t.nodes().filter(e=>e.selected).sort((e,t)=>e.y()>t.y()?1:e.y(){const i=t.settings.snapGridEnabled()?a.y()+e.height*(n+1)+s*(n+1):a.y()+210*(n+1);e.moveTo(a.x(),i)})},this.alignH=function(){if(t.input.isCtrlDown)return void n.reduceAlignH();const e=t.nodes().filter(e=>e.selected).sort((e,t)=>e.x()>t.x()?1:e.x(){e.moveTo(e.x(),i.y())})},this.reduceAlignH=function(){const e=t.settings.gridSize(),i=t.nodes().filter(e=>e.selected).sort((e,t)=>e.x()>t.x()?1:e.x(){const i=t.settings.snapGridEnabled()?a.x()+e.width*(n+1)+s*(n+1):a.x()+210*(n+1);e.moveTo(i,a.y())})},this.arrangeSpiral=function(){const e=n.getSelectedNodes();e.length<2?Swal.fire(o):(e.forEach((e,i)=>{e.moveTo(t.settings.snapGridEnabled()?n.stepify(Math.cos(.5*i)*(600+30*i),t.settings.gridSize()):Math.cos(.5*i)*(600+30*i),t.settings.snapGridEnabled()?n.stepify(Math.sin(.5*i)*(600+30*i),t.settings.gridSize()):Math.cos(.5*i)*(600+30*i))}),n.warpToXY(0,0))},this.sortAlphabetical=function(){const i=n.getSelectedNodes().sort((e,t)=>e.title().localeCompare(t.title()));if(i.length<2)return void Swal.fire(o);let a=Math.round(i.length/2),s=0,r=0;const l=e(i[0].element).width()+30,d=e(i[0].element).height()+30,c=t.settings.gridSize();t.settings.snapGridEnabled()&&i[0].moveTo(n.stepify(i[0].x(),c),n.stepify(i[0],c)),i.forEach((e,n)=>{n%a?s+=1:(r+=1,s=0),1===n&&(r=0);const o=i[0].x()+i[0].width,p=c-o%c+c,u=i[0].y()+i[0].height,g=c-u%c+c;e.moveTo(t.settings.snapGridEnabled()?i[0].x()+s*e.width+s*p:i[0].x()+s*l,t.settings.snapGridEnabled()?i[0].y()+r*e.height+r*g:i[0].y()+r*d)}),n.warpToNode(i[0])},this.stepify=function(e,t){return Math.round(e/t)*t}}}).call(this,n("EVdn"))},6:function(e,t){},7:function(e,t){},8:function(e,t){},9:function(e,t){},INAQ:function(e,t,n){"use strict";(function(e,i){n.d(t,"a",(function(){return a}));var o=n("oj90");const a=function(t){const n=this,a=Object.freeze({Left:0,Middle:1,Right:2}),s=Object.freeze({Enter:13,Escape:27,Space:32,Left:37,Up:38,Right:39,Down:40,Delete:46,A:65,C:67,D:68,O:79,S:83,V:86,W:87,X:88,Y:89,Z:90});this.keys=s,this.mouse={x:0,y:0},this.isDragging=!1,this.isScreenTouched=!1,this.isMiddleButtonDown=!1,this.isLeftButtonDown=!1,this.isShiftDown=!1,this.isCtrlDown=!1,this.isHoverOverWorkspace=!1,this.trackMouseEvents=function(){e(document).on("pointerdown",e=>{if(n.isDragging="nodes"===e.target.className||"body"===e.target.className&&(n.isMiddleButtonDown||0===t.workspace.selectedNodes.length),n.mouse.x=e.pageX,n.mouse.y=e.pageY,n.isMiddleButtonDown=e.button===a.Middle,this.isLeftButtonDown=e.button===a.Left,t.inWorkspace()){if(n.isDragging)switch(e.button){case a.Left:"nodes"===e.target.className&&t.workspace.onMarqueeStart({x:e.pageX,y:e.pageY});break;case a.Middle:t.workspace.onDragStart({x:e.pageX,y:e.pageY})}}else t.inEditor()&&e.button===a.Right&&(t.guessPopUpHelper(),e.preventDefault())}),window.addEventListener("touchstart",()=>{n.isScreenTouched=!0}),e(document).on("pointermove",e=>{n.mouse.x=e.pageX,n.mouse.y=e.pageY}),e(document).on("mousemove touchmove",e=>{if(n.isDragging){t.focusedNodeIdx=-1;const i=n.isScreenTouched&&e.changedTouches?e.changedTouches[0].pageX:e.pageX,o=n.isScreenTouched&&e.changedTouches?e.changedTouches[0].pageY:e.pageY;t.inWorkspace()&&(e.altKey||n.isMiddleButtonDown||n.isScreenTouched?t.workspace.onDragUpdate({x:i,y:o}):t.workspace.onMarqueeUpdate({x:i,y:o}))}}),e(document).on("pointerup touchend",e=>{n.isScreenTouched=!1,n.isDragging=!1,e.button===a.Left&&(n.isLeftButtonDown=!1),e.button===a.Middle&&(n.isMiddleButtonDown=!1),t.inWorkspace()&&(t.workspace.onDragEnd(),t.workspace.onMarqueeEnd())}),e(".nodes").mousewheel(e=>{e.altKey||(t.inWorkspace()||n.isHoverOverWorkspace)&&(t.workspace.onZoom(e.pageX,e.pageY,e.deltaY),e.preventDefault())}),e(".nodes").hover(()=>{n.isHoverOverWorkspace=!0},()=>{n.isHoverOverWorkspace=!1}),e(".nodes").on("pointerdown",()=>{t.isEditorSplit&&(t.focusEditor(!1),t.makeNewNodesFromLinks(),t.propagateUpdateFromNode(t.editing()),t.mustUpdateTags=!0,t.updateTagsRepository(),t.workspace.updateArrows())}),e(document).contextmenu(n=>{if(!t.inWorkspace())return;const i=e(n.target).hasClass("nodes")||e(n.target).parents(".nodes").length;if(n.button===a.Right&&i){const{x:e,y:i}=t.workspace.toWorkspaceCoordinates(n.pageX,n.pageY);t.newNodeAt(e,i)}return!i})},this.trackKeyboardEvents=function(){e(document).on("keyup keydown",e=>{n.isShiftDown=e.shiftKey,n.isCtrlDown=e.ctrlKey}),e(document).on("keyup",(function(e){if(e.keyCode===s.Space){if(t.inWorkspace()&&e.altKey||t.inEditor()&&!e.altKey)return;t.workspace.scale=1;const n=t.workspace.getSelectedNodes(),i=n.length>0,o=i>0?n:t.nodes();++t.focusedNodeIdx,(t.focusedNodeIdx<0||t.focusedNodeIdx>=o.length)&&(t.focusedNodeIdx=0),t.inWorkspace()?i?t.workspace.warpToSelectedNodeByIdx(t.focusedNodeIdx):t.workspace.warpToNodeByIdx(t.focusedNodeIdx):t.inEditor()&&t.editNode(t.nodes()[t.focusedNodeIdx])}})),e(document).on("keydown",e=>{if(t.inWorkspace()){if((e.metaKey||e.ctrlKey)&&e.shiftKey)switch(e.keyCode){case s.S:t.data.trySave(o.FILETYPE.JSON);break;case s.A:t.data.tryAppend()}if((e.metaKey||e.ctrlKey)&&e.altKey)switch(e.keyCode){case s.S:t.data.trySaveCurrent()}else if(e.metaKey||e.ctrlKey)switch(e.keyCode){case s.C:t.nodeClipboard=t.cloneNodeArray(t.workspace.getSelectedNodes());break;case s.D:t.workspace.deselectAll();break;case s.O:t.data.tryOpenFile();break;case s.S:t.data.trySaveCurrent();break;case s.X:const e=t.workspace.getSelectedNodes();t.nodeClipboard=t.cloneNodeArray(e),t.deleteNodes(e);break;case s.Y:t.historyDirection("redo");break;case s.Z:t.historyDirection("undo")}else e.keyCode===s.Delete||"Delete"===e.key?t.confirmDeleteNodes(t.workspace.getSelectedNodes()):t.$searchField.is(":focus")||e.ctrlKey||e.metaKey||(e.keyCode===s.A||e.keyCode===s.Left?t.workspace.onPanLeft():e.keyCode===s.D||e.keyCode===s.Right?t.workspace.onPanRight():e.keyCode===s.W||e.keyCode===s.Up?t.workspace.onPanUp():e.keyCode!==s.S&&e.keyCode!==s.Down||t.workspace.onPanDown())}}),e(document).on("keyup",e=>{if(t.inWorkspace())if(e.metaKey||e.ctrlKey)switch(e.keyCode){case s.A:t.workspace.selectAll();break;case s.V:t.pasteNodes()}else if(e.keyCode===s.Enter||"Enter"===e.key){const e=t.nodes()[t.focusedNodeIdx];e?t.editNode(e):t.editNode(t.nodes()[0])}}),e(document).on("keydown",(function(e){if(t.inEditor())if(e.metaKey||e.ctrlKey)switch(e.keyCode){case s.C:n.clipboard=t.editor.getSelectedText();break;case s.X:document.execCommand("copy"),t.clipboard=t.editor.getSelectedText(),t.insertTextAtCursor("");break;case s.S:t.data.trySaveCurrent()}else switch(e.keyCode){case s.Escape:t.saveNode(),t.closeEditor()}})),e(document).on("keyup",(function(e){if(t.inEditor()&&(e.metaKey||e.ctrlKey)&&e.altKey)switch(e.keyCode){case s.Enter:t.saveNode(),t.closeEditor()}})),e(document).on("keydown",(function(e){if(t.ui.settingsDialogVisible())switch(e.keyCode){case s.Escape:t.ui.closeSettingsDialog()}})),e(document).on("keyup keydown pointerdown pointerup",(function(e){t.inEditor()&&t.updateEditorStats()}))},this.initKnockoutBindings=function(){i.bindingHandlers.preventBubble={init:function(e,t){var n=i.utils.unwrapObservable(t());i.utils.registerEventHandler(e,n,(function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}))}},i.bindingHandlers.mousedown={init:function(t,n,o,a,s){var r=i.unwrap(n());e(t).mousedown((function(){r()}))}}};n.initKnockoutBindings(),n.trackMouseEvents(),n.trackKeyboardEvents()}}).call(this,n("EVdn"),n("Z1dp"))},JGHU:function(e,t,n){"use strict";n.r(t),function(e,i){n.d(t,"JSONEditor",(function(){return o}));var o=function({id:t}){this.tableAdd=({key:t,value:n})=>{var i=this.table.find("tr.hide").clone(!0).removeClass("hide table-line");t&&n&&(console.log("mutate",{key:t,value:n,html:i.html()}),i.html(`\n ${t}\n ${n}\n \n x delete\n \n `),e(".table-remove").on("click",(function(){e(this).parents("tr").detach()}))),this.table.find("table").append(i)},this.getValue=()=>{var t=this.table.find("tr:not(:hidden)"),n=[],i=[];return e(t.shift()).find("th:not(:empty):not([data-attr-ignore])").each((function(){n.push(e(this).text().toLowerCase())})),t.each((function(){var t=e(this).find("td"),o={};n.forEach((function(e,n){o[e]=t.eq(n).text()})),i.push(o)})),i},this.init=()=>{document.getElementById(t).innerHTML='\n
        \n
        \n \n \n \n \n \n \n\n\n \x3c!-- This is our clonable table line --\x3e\n \n \n \n \n \n
        KeyValueRemove
        keyval\n x delete\n
        \n\n \n
        \n
        \n ';var n=e("#table"),o=e("#save-btn");this.table=n,this.rows=n.find("tr:not(:hidden)"),e("#save-btn").addClass("hide"),e(".table-add").on("click",this.tableAdd),e(".table-remove").on("click",(function(){console.log({removeThis:this}),e(this).parents("tr").detach()})),i.fn.pop=[].pop,i.fn.shift=[].shift,o.on("click",this.getValue)},this.init(),this.setValue=(e=[])=>{e.forEach(this.tableAdd)}}}.call(this,n("EVdn"),n("EVdn"))},P0sH:function(e,t,n){"use strict";(function(e,i){n.d(t,"a",(function(){return g}));var o=n("owJe"),a=n("W2Rx"),s=n("5dEm"),r=n("INAQ"),l=n("pYPP"),d=n("fkuv"),c=n("2Qx2"),p=n("oj90"),u=n("l8+o"),g=function(t,g){const h=this;this.utils=p.Utils,this.setTheme=function(t,n){let i=n?n.target.value:t;setTimeout(h.initGrid,50),setTimeout(h.workspace.updateArrows,50),e("#theme-stylesheet").attr("href",p.Utils.getPublicPath(`themes/${i}.css`))},this.setLanguage=function(e,t){const n=t?t.target.value:e;Object(o.load_dictionary)(h.settings.language().split("-")[0]);const i=new CustomEvent("yarnSetLanguage");i.language=n,window.dispatchEvent(i),window.parent.dispatchEvent(i)},this.setDocumentType=function(e,t){const n=t?t.target.value:e;h.settings.documentType(n),console.log("Set doc type",e,app.data.inkCompiler),"ink"===n?(null===app.data.inkCompiler&&(app.data.inkCompiler=new app.data.InkCompiler),c.a.addGlobalScopeToInkDoc(),app.setMarkupLanguage("html")):app.data.inkCompiler=null,app.updateNodeLinks();const i=new CustomEvent("yarnSetDocumentType");i.language=n,window.dispatchEvent(i),window.parent.dispatchEvent(i)},this.setMarkupLanguage=function(e,t){const n=t?t.target.value:e;app.settings.markupLanguage(n),h.richTextFormatter=new u.a(h),h.mustRefreshNodes.notifySubscribers()},this.setFiletypeVersion=function(e,t){const n=t?t.target.value:e;h.filetypeVersion=n},this.setGistCredentials=function(e,t){const{token:i,file:o}=e,a=new(n("XZLo"))({token:i});h.gists=a,h.gists.file=o},this.input=new r.a(h),this.settings=new l.a(h),this.workspace=new s.a(h),this.ui=new d.a(h),this.richTextFormatter=new u.a(h),this.data=c.a,this.name=i.observable(t),this.version=i.observable(g),this.editing=i.observable(null),this.nodes=i.observableArray([]),this.tags=i.observableArray([]),this.mustRefreshNodes=i.observable(),this.mustUpdateTags=!0,this.nodeHistory=[],this.nodeFuture=[],this.editingHistory=[],this.editingSaveHistoryTimeout=null,this.focusedNodeIdx=-1,this.isElectron=!1,this.editor=null,this.nodeVisitHistory=[],this.plugins={pluginStorage:{}},this.clipboard="",this.nodeClipboard=[],this.speachInstance=null,this.editingPath=i.observable(null),this.$searchField=e(".search-field"),this.isEditorInPreviewMode=!1,this.isEditorInPlayMode=i.observable(!1),this.isEditorSplit=!1,this.isEditorFocused=!1,this.editorResizeHandleOptions={handleSelector:"#editor-resize-handle",resizeHeight:!1,resizeWidthFrom:"right",onDragStart:function(){h.isSplitEditorInFocus=!0,e("#node-editor").removeClass("split-editor-out-of-focus")},onDragEnd:function(){h.editor.resize(),h.settings.editorSplitSize(e("#editor-form").width())}},this.inEditor=()=>(h.editing()||h.isEditorSplit&&h.isEditorFocused)&&!h.ui.isDialogOpen(),this.inWorkspace=()=>(!h.editing()||h.isEditorSplit&&!1===h.isEditorFocused)&&!h.ui.isDialogOpen(),this.run=function(){var t="Unknown OS";-1!=navigator.platform.indexOf("Win")&&(t="Windows"),-1!=navigator.platform.indexOf("Mac")&&(t="MacOS"),-1!=navigator.platform.indexOf("X11")&&(t="UNIX"),-1!=navigator.platform.indexOf("Linux")&&(t="Linux"),-1!=navigator.platform.indexOf("Linux")&&(t="Linux"),h.isElectron=navigator.userAgent.toLowerCase().includes("electron");var n=navigator.userAgent||navigator.vendor||window.opera;let o;/android|iPad|iPhone|iPod/.test(n.toLowerCase())&&!window.MSStream&&(t="mobile"),"Windows"==t&&(h.workspace.zoomSpeed=.1),window.addEventListener("beforeunload",e=>(this.data.saveAppStateToLocalStorage(),null)),window.addEventListener("DOMContentLoaded",e=>{if(h.electron){const e=h.electron.remote.process.argv.length>1?h.electron.remote.process.argv[1]:null;if(e&&app.fs.existsSync(e))return void this.data.openFileFromFilePath(e)}this.data.loadAppStateFromLocalStorage();const t=new URL(window.location),n=t.searchParams.get("text")||t.searchParams.get("url");null!==n&&h.insertTextAtCursor(n+"\n",!0)});const a=e("#addPwa")[0];a.style.display="none",window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),o=e,a.style.display="block",a.addEventListener("click",e=>{a.style.display="none",o.prompt(),o.userChoice.then(e=>{"accepted"===e.outcome?(console.log("User accepted the A2HS prompt"),a.style.display="none"):console.log("User dismissed the A2HS prompt"),o=null})})}),e("#app").show(),i.applyBindings(h,e("#app")[0]),h.editingVisualStudioCodeFile()||h.newNode().title("Start"),h.settings.apply(),e(".search-title input").click(h.updateSearch),e(".search-body input").click(h.updateSearch),e(".search-tags input").click(h.updateSearch),h.$searchField.on("input",h.updateSearch),h.$searchField.on("keyup",(function(e){27==e.keyCode?h.clearSearch():h.searchWarp()})),"mobile"===t&&h.workspace.setZoom(3),e(window).on("resize",(function(){h.ui.isScreenNarrow()&&h.editing()&&h.isEditorSplit&&h.toggleEditorView(),h.workspace.updateArrows(),h.initGrid()})),setTimeout(h.initGrid,50),this.guessPopUpHelper=function(){/color=#([a-zA-Z0-9]{3,6})$/.test(h.getTagBeforeCursor())&&h.insertColorCode()},this.insertEmoji=function(){this.emPicker.toggle(),h.togglePreviewMode(!0),e("#emojiPicker-container").css({left:h.input.mouse.x-200,top:h.input.mouse.y-125}),e("#emojiPicker-container").show()},this.insertColorCode=function(){e("#colorPicker-container").is(":visible")||(e("#colorPicker").spectrum("set",h.editor.getSelectedText()),e("#colorPicker").spectrum("toggle"),e("#colorPicker-container").css({left:h.input.mouse.x-70,top:h.input.mouse.y-50}),e("#colorPicker-container").show(),h.togglePreviewMode(!0),setTimeout(()=>{const t=e("#colorPicker").spectrum("get");h.applyPickerColorEditor(t)},100))},this.applyPickerColorEditor=function(e){const t=JSON.parse(JSON.stringify(h.editor.selection.getRange()));h.editor.selection.setRange(t);const n=e.toHexString().replace("#","");h.editor.session.replace(t,n),h.editor.selection.setRange({start:h.editor.getCursorPosition(),end:{row:h.editor.getCursorPosition().row,column:h.editor.getCursorPosition().column-n.length}}),h.togglePreviewMode(!0)},document.addEventListener("contextmenu",(function(e){h.editing()&&e.preventDefault()}),!1),document.ondragover=document.ondrop=e=>{e.preventDefault()},document.body.ondrop=e=>{e.preventDefault();for(var t=0;t{const t=e.data;switch(t.type){case"UpdateNode":h.nodes().forEach(e=>{e.title().trim()===t.payload.originalNodeTitle.trim()&&(e.title(t.payload.title),e.tags(t.payload.tags),e.body(t.payload.body),h.setYarnDocumentIsDirty())})}});var s=new CustomEvent("yarnReady");s.document=document,s.data=c.a,s.app=this,window.dispatchEvent(s),window.parent.dispatchEvent(s);const r=new URLSearchParams(window.location.href.split("?")[1]),l=r.get("gist"),d=r.get("fileName");l&&d&&fetch("https://api.github.com/gists/"+l).then(e=>e.json()).then(e=>{const t=e.files[d].content;c.a.openGist(t,d)})},this.limitNodesUpdate=function(e){h.nodes.extend({rateLimit:{method:"notifyWhenChangesStop",timeout:250}}),e(),h.nodes.limit(e=>()=>e())},this.getNodesConnectedTo=function(e){var t=[],n=h.nodes();for(var i in n)if(n[i]!=e&&n[i].isConnectedTo(e,!0)){var o=!1;for(var a in t)if(t[a]==n[i]){o=!0;break}o||t.push(n[i])}return t},this.matchConnectedColorID=function(e){var t=h.getNodesConnectedTo(e);for(var n in t)t[n].colorID(e.colorID())},this.quit=function(){h.isElectron},this.canEditNodeMeta=function(e){return"ink"!==app.settings.documentType()||e.trim()!==c.a.InkGlobalScopeNodeName},this.sanitiseNodeTitle=function(){"ink"===app.settings.documentType()&&(app.editing().title().startsWith("function ")||app.editing().title(app.editing().title().replace(/[ ]/g,"_")))},this.validateTitle=function(){var t=document.getElementById("editorTitle").value,n=e("#editorTitle");h.getOtherNodeTitles().includes(t)||h.titleExistsTwice(t)?(n.attr("class","title title-error"),n.attr("title","Another node has the same title")):"yarn"!==app.settings.documentType()||RegExp("^[a-z0-9]+$","i").test(t)?(n.removeAttr("title"),n.removeClass("title-error")):(n.attr("class","title title-error"),n.attr("title","Only upper or lower case letters and numbers are allowed in a node title."))},this.refreshWindowTitle=function(){let e="";"LOCAL"===c.a.lastStorageHost()?e="Yarn - "+(c.a.editingPath()||c.a.editingName())+" "+(c.a.isDocumentDirty()?"*":""):"GIST"===c.a.lastStorageHost()&&(e="Gist - "+(c.a.editingPath()||c.a.editingName())+" "+(c.a.isDocumentDirty()?"*":"")),h.electron?h.electron.remote.getCurrentWindow().setTitle(e):document.title=e},this.usingVisualStudioCodeExtension=function(){return!!window.vsCodeApi},this.editingVisualStudioCodeFile=function(){return!0===window.editingVsCodeFile},this.setYarnDocumentIsDirty=function(){h.usingVisualStudioCodeExtension()&&h.editingVisualStudioCodeFile()&&c.a.getSaveData(c.a.editingType()).then(e=>{window.vsCodeApi.postMessage({type:"DocumentEdit",payload:e})})},this.recordNodeAction=function(e,t){if(h.nodeFuture.length>0){for(var n=0;n=0&&h.nodes.splice(t,1),h.updateNodeLinks()}var n=null;if(n="undo"==e?h.nodeHistory.pop():h.nodeFuture.pop()){var i=n.action,o=n.node;"undo"==e?("created"==i?(n.lastX=o.x(),n.lastY=o.y(),t(o)):"removed"==i&&h.recreateNode(o,n.lastX,n.lastY),h.nodeFuture.push(n),h.setYarnDocumentIsDirty()):("created"==i?h.recreateNode(o,n.lastX,n.lastY):"removed"==i&&t(o),h.nodeHistory.push(n),h.setYarnDocumentIsDirty())}},this.recreateNode=function(e,t,n){h.nodes.push(e),e.moveTo(t,n),h.updateNodeLinks()},this.setSelectedColors=function(e){var t=h.workspace.getSelectedNodes();for(var n in t.splice(t.indexOf(e),1),t)t[n].colorID(e.colorID())},this.pasteNodes=function(){h.nodeClipboard.length&&(h.workspace.deselectAll(),h.nodeClipboard.forEach((function(e){var t=new a.a({title:h.getUniqueTitle(e.title()),body:e.body(),tags:e.tags(),colorID:e.colorID(),x:e.createX,y:e.createY});h.nodes.push(t),h.workspace.selectNodes(t),h.recordNodeAction("created",t)})),h.updateNodeLinks())},this.confirmDeleteNodes=function(e){const t=Array.isArray(e)?void 0:e,n=Array.isArray(e)?[...e]:t&&t.selected?[...h.workspace.getSelectedNodes()]:[e];n.length&&Swal.fire({title:"Are you sure?",text:`${n.length} ${1===n.length?"node":"nodes"} will be deleted.`,icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, delete!",cancelButtonText:"No, cancel!",reverseButtons:!0}).then(e=>{e.value&&h.deleteNodes(n)})},this.deleteNodes=function(e){const t=Array.isArray(e)?e:[e],n=[];for(let e=t.length-1;e>=0;--e)n.push(t[e].remove());Promise.all(n).then(()=>{h.limitNodesUpdate(()=>{for(let e=t.length-1;e>=0;--e)h.inEditor()&&h.editing()===t[e]&&h.closeEditor(),h.deleteNode(t[e]);h.updateNodeLinks(),h.workspace.deselectNodes(t),h.workspace.updateArrows()})})},this.deleteNode=function(e){const t=h.nodes.indexOf(e);t>=0&&(h.recordNodeAction("removed",e),h.nodes.splice(t,1)),h.setYarnDocumentIsDirty()},this.cloneNodeArray=function(e){return e.map((function(e){return new a.a({title:e.title(),body:e.body(),tags:e.tags(),colorID:e.colorID(),x:e.x()+10,y:e.y()+10})}))},this.newNode=function(e=!0){var t=new a.a;return h.nodes.push(t),e&&h.updateNodeLinks(),h.recordNodeAction("created",t),t},this.newNodeAt=function(e,t){var n=new a.a({x:e-100,y:t-100});return h.nodes.push(n),h.updateNodeLinks(),h.recordNodeAction("created",n),n},this.searchTextInEditor=function(e=!0){e?h.editor.execCommand("find"):h.editor.searchBox&&h.editor.searchBox.hide()},this.showRandomQuote=function(){e.ajax({url:"https://api.forismatic.com/api/1.0/?",dataType:"jsonp",data:"method=getQuote&format=jsonp&lang=en&jsonp=?",success:function(e){Swal.fire({text:e.quoteText+"\n\n-"+e.quoteAuthor})}})},this.editNode=function(t,n=!0){if(!n&&!t.active())return;if(h.settings.alwaysOpenNodesInVisualStudioCodeEditor())return void h.editNodeInVisualStudioCodeEditor(t);h.editing()&&h.editing()!==t&&h.saveNode(!1),h.isEditorInPlayMode()&&h.togglePlayMode(!1),h.isEditorInPreviewMode&&h.togglePreviewMode(!1),t.oldTitle=t.title(),h.editing(t),h.mustUpdateTags=!0,e("#node-editor-background").css({opacity:0}).transition({opacity:1},250),e("#node-editor").css({y:"-100",opacity:0}).transition({y:"0",opacity:1},250),h.editor=ace.edit("editor"),h.editor.setOptions({scrollPastEnd:.5}),h.editor.focus(),h.editor.navigateFileEnd(),e("#colorPicker").spectrum({flat:!0,showButtons:!1,showInput:!0,showPalette:!0,preferredFormat:"hex",palette:[["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"]],move:function(e){h.applyPickerColorEditor(e)},clickoutFiresChange:!0});const i=ace.require("ace/ext/language_tools"),a=p.Utils.createAutocompleter("ink"===app.settings.documentType()?["divert.target"]:["string.llink","string.rlink"],app.getOtherNodeTitles().map(e=>{const n=h.getNodeByTitle(e);return{word:e,title:e,about:`${n.tags().length>0?`tags: ${n.tags()}
        `:""}Preview:
        ${n.clippedBody()}`,titleStyle:t.titleStyles[n.colorID()]}}),"Node Link");i.setCompleters([a,i.keyWordCompleter,i.textCompleter,i.snippetCompleter]);let s=void 0;h.editor.getSession().on("change",(function(e){const t=h.settings.autoCloseTags();if("insert"===e.action&&t){if(h.richTextFormatter.justInsertedAutoComplete)return void(h.richTextFormatter.justInsertedAutoComplete=!1);s&&clearTimeout(s),s=setTimeout(()=>{s=void 0,h.richTextFormatter.completableTags.forEach(e=>{if(h.getTagBeforeCursor()===e.Start){h.richTextFormatter.justInsertedAutoComplete=!0;let t=e.Completion,n=e.Offset;h.settings.autoCloseBrackets()&&e.BehaviorCompletion&&(t=e.BehaviorCompletion,n+=1),e.Completion&&h.insertTextAtCursor(t),e.Offset&&h.moveEditCursor(n),e.Func&&e.Func()}})},200)}})),this.emPicker=new EmojiPicker(document.getElementById("emojiPickerDom"),e=>{h.insertTextAtCursor(e.char),this.emPicker.toggle(),h.togglePreviewMode(!1)}),Object(o.enable_spellcheck)(),h.toggleInvertColors(),h.toggleShowCounter(),h.toggleSpellCheck(),h.validateTitle(),h.updateEditorStats(),h.updateEditorOptions(),h.$searchField.val().length>0&&e(".search-body input").is(":checked")&&h.editor.findAll(h.$searchField.val()),h.settings.editorSplit()&&(h.splitEditor(),h.workspace.warpToNodeByIdx(t.index()-1)),"right"===h.settings.editorSplitDirection()?(e("#editor-form").addClass("split-editor-right"),e("#editor-resize-handle").addClass("float-right")):(e("#editor-form").removeClass("split-editor-right"),e("#editor-resize-handle").removeClass("float-right")),e(".node-editor").on("pointerdown","> *",(function(e){h.isEditorSplit&&(h.focusEditor(!0),e.stopPropagation())})),e(".app-info").hide(),h.editor.resize(),null!=t.undoManager&&h.editor.session.setUndoManager(t.undoManager);var r=new CustomEvent("yarnEditorOpen");r.document=document,r.data=c.a,r.app=app,window.dispatchEvent(r),window.parent.dispatchEvent(r)},this.splitEditor=function(){h.isEditorSplit=!0,h.focusEditor(!0),h.settings.editorSplit(!0),h.editorResizeHandleOptions.resizeWidthFrom="right"===h.settings.editorSplitDirection()?"left":"right",e("#editor-form").width(h.settings.editorSplitSize()).addClass("split-editor").toggleClass("split-editor-right","right"===h.settings.editorSplitDirection()).resizable(h.editorResizeHandleOptions),e("#node-editor-background").addClass("hidden"),e("#node-editor").css({"z-index":10002}),e("#editor-resize-handle").removeClass("hidden").toggleClass("float-right","right"===h.settings.editorSplitDirection()),e("#split-editor-button").addClass("hidden"),e("#snap-editor-button").removeClass("hidden"),e("#exit-editor").removeClass("hidden"),e("#full-size-editor-button").removeClass("hidden"),e("#split-button-separator").removeClass("hidden"),h.ui.checkAndMoveAppButtons()},this.toggleEditorView=function(){h.settings.editorSplit(!h.settings.editorSplit()),h.reopenEditor()},this.reopenEditor=function(){h.saveNode();let e=h.editing();h.closeEditor(),setTimeout(()=>{h.editNode(e)},250)},this.editorSnapToggle=function(){h.settings.editorSplitDirection("right"===h.settings.editorSplitDirection()?"left":"right"),h.reopenEditor()},this.focusEditor=function(t){!0===t?(e("#node-editor").removeClass("split-editor-unfocused"),h.isEditorFocused=!0):(e("#node-editor").addClass("split-editor-unfocused"),h.isEditorFocused=!1)},this.getSplitEditorXOffset=function(){let t=0;return h.inEditor()&&h.settings.editorSplit()&&(t=e("#editor-form").width()/2,"right"===h.settings.editorSplitDirection()&&(t*=-1)),t},this.editNodeInVisualStudioCodeEditor=function(e){h.usingVisualStudioCodeExtension()?(h.setYarnDocumentIsDirty(),window.vsCodeApi.postMessage({type:"OpenNode",payload:{title:e.title().trim(),tags:e.tags().trim(),body:h.trimBodyLinks(e.body().trim())}})):console.error("Tried to open node in Visual Studio Code text editor but we're not in the Visual Studio Code extension")},this.chooseRelativePathImage=function(e){h.insertTextAtCursor(e)},this.getNodeByTitle=function(e){return h.nodes().find(t=>t.title().trim().toLowerCase()===e.trim().toLowerCase())},this.openNodeByTitle=function(e,t=""){h.isEditorInPlayMode()&&h.togglePlayMode(),h.makeNodeWithName(e);const n=h.nodes().find(t=>t.title().trim().toLowerCase()===e.trim().toLowerCase());n&&(h.editNode(n,!0),t&&setTimeout(()=>h.editor.find(t),200))},this.openLastEditedNode=function(){if(0===h.nodeVisitHistory.length)h.saveNode(),h.closeEditor();else{const e=h.nodeVisitHistory.pop();h.propagateUpdateFromNode(h.editing()),h.openNodeByTitle(e)}},this.getSpellCheckSuggestionItems=function(){var e=Object(o.suggest_word_for_misspelled)(h.editor.getSelectedText());if(e){var t={};return e.forEach(e=>{t[e]={name:e,icon:"edit",callback:e=>{h.insertTextAtCursor(e)}}}),t}return!1},this.getThesaurusItems=function(){var e=n("GLdW")(h.editor.getSelectedText());if(!e)return!1;var t=[];if(Object.keys(e).forEach((function(n){e[n].forEach((function(e){t.includes(e)||e===n||t.push(e)}))})),t.length>0){var i={};return t.forEach(e=>{i[e]={name:e,icon:"edit",callback:e=>{h.insertTextAtCursor(e)}}}),i}return!1},this.toggleSpellCheck=function(){setTimeout((function(){h.settings.spellcheckEnabled()?Object(o.enable_spellcheck)():Object(o.disable_spellcheck)()}),50)},this.toggleInvertColors=function(){const t=h.settings.invertColorsEnabled()?{filter:"invert(100%)"}:{filter:"invert(0%)"};e("#app").css(t),e("#app-bg").css(t),e(".tooltip").css(t),e(".node .body").css(t),e(".editor-container .editor-preview").css(t)},this.initGrid=function(){if(h.settings.snapGridEnabled()){var t=e(window).width(),n=e(window).height();e("#grid-canvas").attr("width",t),e("#grid-canvas").attr("height",n),e("#gridSize").attr("disabled",!1),h.workspace.gridContext.strokeStyle=h.workspace.gridContext.fillStyle=e(".grid-canvas").css("color")}else e("#gridSize").attr("disabled",!0);app.workspace.updateGrid()},this.toggleShowCounter=function(){h.settings.editorStatsEnabled()?e(".node-editor .form .editor-counter").css({display:"initial"}):e(".node-editor .form .editor-counter").css({display:"none"})},this.toggleAutocompleteSuggestions=function(){h.settings.autocompleteSuggestionsEnabled(!h.settings.autocompleteSuggestionsEnabled()),h.updateEditorOptions()},this.toggleAutoCloseBrackets=function(){h.settings.autoCloseBrackets(!h.settings.autoCloseBrackets()),h.updateEditorOptions()},this.updateEditorOptions=function(){h.editor.setOptions({enableBasicAutocompletion:app.settings.autocompleteSuggestionsEnabled(),enableLiveAutocompletion:app.settings.autocompleteSuggestionsEnabled(),behavioursEnabled:app.settings.autoCloseBrackets()})},this.togglePreviewMode=function(t){const n=e(".editor")[0],i=e("#editor-preview")[0];h.isEditorInPreviewMode=t,app.ui.dispatchEvent("yarnInPreviewMode"),t?(e(".bbcode-toolbar").addClass("hidden"),n.style.display="none",i.style.display="block",i.innerHTML=h.richTextFormatter.richTextToHtml(h.editing().body(),!0),i.scrollTop=h.editor.renderer.scrollTop):(e(".bbcode-toolbar").removeClass("hidden"),h.editor.session.setScrollTop(i.scrollTop),i.innerHTML="",i.style.display="none",n.style.display="flex",h.editor.focus(),h.editor.resize(),e("#colorPicker-container").is(":visible")&&e("#colorPicker-container").hide(),e("#emojiPicker-container").is(":visible")&&e("#emojiPicker-container").hide())},this.appendText=function(e){h.editing().body(h.editing().body()+e);const t=h.editor.session.getLength()-1,n=h.editor.session.getLine(t).length;h.editor.gotoLine(t+1,n)},this.moveEditCursor=function(e){const t=h.editor.getCursorPosition();h.editor.gotoLine(t.row+1,t.column+e),h.editor.focus()},this.insertTextAtCursor=function(e,t=!1){if(!h.editing())return;h.editor.session.replace(h.editor.selection.getRange(),"");const n=h.editor.getCursorPosition();if(h.editor.session.insert(n,e),t){const e=h.editor.getCursorPosition();editor.scrollToLine(e.row,!0,!0,(function(){})),h.editor.focus()}h.updateEditorStats(),h.editor.focus()},this.getTagBeforeCursor=function(){const e=h.editor.getSelectionRange(),t=e.start.row,n=h.editor.session.getLine(t).substring(e.start.column-2,e.start.column+2);if(!n)return"";if("ink"===app.settings.documentType()){if(["->"].includes(n.trim()))return n.trim()}else if(["[[","<<"].includes(n.trim())||n.includes("|"))return n.trim();return h.richTextFormatter.identifyTag(n)},this.saveNode=function(){const t=h.editing();if(t){const n=e("#editorTitle")[0],i=h.getFutureEditedNodeTitle();n.value=i,t.title(i),t.body(h.trimBodyLinks(t.body().trim())),h.makeNewNodesFromLinks(),h.propagateUpdateFromNode(t),h.workspace.updateArrows(),setTimeout(h.updateSearch,600),h.setYarnDocumentIsDirty(),app.ui.dispatchEvent("yarnSavedNode")}},this.closeEditor=function(){h.editing().undoManager=h.editor.session.getUndoManager(),e("#node-editor-background").transition({opacity:0},250),e("#node-editor").transition({y:"-100",opacity:0},250,(function(e){h.editing(null)})),h.isEditorSplit=!1,h.isEditorFocused=!1,e(".app-info").show(),app.ui.resetAppButtonsLocation(),h.isEditorInPlayMode()&&h.togglePlayMode(!1),h.isEditorInPreviewMode&&h.togglePreviewMode(!1)},this.convertMarkup=function(){h.nodes().forEach(e=>{e.body(h.richTextFormatter.convert(e.body()))})},this.updateSearch=function(){for(var t=0;t{n.includes(e)||t.push(e)}),e.linkedFrom().forEach(e=>{n.includes(e)||t.push(e)}))},this.updateTagsRepository=function(){if(!app.mustUpdateTags)return;app.mustUpdateTags=!1;h.tags().forEach(e=>e.count=0),h.nodes().forEach(e=>{p.Utils.uniqueSplit(e.tags()," ").forEach(e=>{const t=h.tags().find(t=>t.text==e);if(t)++t.count;else{const t=(()=>{const e=h.tags().map(e=>e.id);for(let t=1;;++t)if(!e.includes(t))return t})();h.tags.push({id:t,style:"tag-style-"+t,text:e,count:1})}})});let e=h.tags().length;for(;e--;)0===h.tags()[e].count&&h.tags().splice(e,1)},this.makeNewNodesFromLinks=function(){if(!h.settings.createNodesEnabled())return console.info("Autocreate new nodes disabled");var e=h.editing().getLinksInNode();if(null!=e)for(var t=0;t0&&!n.includes(e)&&e!=h.editing().title()&&h.newNodeAt(h.editing().x()+t,h.editing().y()-120).title(e)},this.titleExistsTwice=function(e){return h.nodes().filter(t=>t.title().trim()===e.trim()).length>1},this.getFutureEditedNodeTitle=function(){const t=e("#editorTitle")[0];return h.getUniqueTitle(t.value.trim())},this.getOtherNodeTitles=function(){const e=[];return h.nodes().forEach(t=>{if(!h.editing()||t.title()!==h.editing().title()){if("ink"===app.settings.documentType()&&t.title().trim()===c.a.InkGlobalScopeNodeName)return;e.push(t.title().trim())}}),e},this.getHighlightedText=function(t){t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\/g,">")).replace(/\<\<(.*?)\>\>/g,'

        <<

        $1

        >>

        ')).replace(/\[\[([^\|]*?)\]\]/g,'

        [[

        $1

        ]]

        ')).replace(/\[\[([^\[\]]*?)\|([^\[\]]*?)\]\]/g,'

        [[

        $1

        |

        $2

        ]]

        ')).replace(/[^:]\/\/(.*)?($|\n)/g,'//$1\n')).replace(/\/\*((.|[\r\n])*)?\*\//gm,'/*$1*/')).replace(/\/\%((.|[\r\n])*)?\%\//gm,'/%$1%/');var n=e("
        ");return n[0].innerHTML=t,n.find(".comment").each((function(){e(this).find("p").each((function(){e(this).removeClass()}))})),n.find(".linkname").each((function(){var t=e(this).text(),n=!1;for(var i in h.nodes())if(h.nodes()[i].title().toLowerCase()==t.toLowerCase()){n=!0;break}n||e(this).removeClass("linkname")})),t=n[0].innerHTML},this.updateLineNumbers=function(t){for(var n=t.split("\n"),i="",o=0;o0)&&(i+=o+1+"
        ");e(".editor-container .lines").html(i)},this.moveNodes=function(e,t){for(var n in h.nodes()){var i=h.nodes()[n];i.moveTo(i.x()+e,i.y()+t)}},this.getFirstFoundNode=function(e){return h.nodes().find(t=>t.title().toLowerCase().trim()===e)},this.searchWarp=function(){var e=h.$searchField.val().toLowerCase().trim();if(""===e)h.workspace.warpToNodeByIdx(0);else{const t=h.getFirstFoundNode(e);h.workspace.warpToNodeByIdx(h.nodes.indexOf(t))}},this.clearSearch=function(){h.$searchField.val(""),h.updateSearch()},this.updateEditorStats=function(){var t=h.editor.getSession().getValue(),n=h.editor.getCursorPosition(),i=t.split("\n");e(".editor-counter .character-count").html(t.length),e(".editor-counter .line-count").html(i.length),e(".editor-counter .row-index").html(n.row),e(".editor-counter .column-index").html(n.column),c.a.saveAppStateToLocalStorage()},this.getUniqueTitle=function(e){var t=h.getOtherNodeTitles();if(e&&!t.includes(e))return e;var n=e||"Node",i=2;const o=n.match(/^(.*)(_([0-9]+))$/);if(o&&4===o.length&&(n=o[1],i=Number(o[3])),!t.includes(n))return n;for(;;++i){var a=n+"_"+i;if(!t.includes(a))return a}},this.navigateToNodeDuringPlayTest=function(e,t=""){h.openNodeByTitle(e,t),h.togglePlayMode(!0),app.workspace.warpToNode(app.getFirstFoundNode(e))}}}).call(this,n("EVdn"),n("Z1dp"))},"P85/":function(e,t,n){},W2Rx:function(e,t,n){"use strict";(function(e,i){n.d(t,"a",(function(){return s}));var o=n("oj90");let a=0;let s=function(t={}){const n=this;this.titleStyles=["title-style-1","title-style-2","title-style-3","title-style-4","title-style-5","title-style-6","title-style-7","title-style-8","title-style-9"],this.index=e.observable(a++),this.title=e.observable(t.title||app.getUniqueTitle()),this.tags=e.observable(t.tags||""),this.body=e.observable(t.body||""),this.active=e.observable(t.active||!0),this.width=200,this.height=200,this.tempOpacity=null,this.style=null,this.colorID=e.observable(t.colorID||0),this.checked=!1,this.selected=!1,this.createX=t.x||null,this.createY=t.y||null,this.undoManager=null,this.clippedTags=e.computed((function(){return app.updateTagsRepository(),o.Utils.uniqueSplit(n.tags()," ").map(e=>app.tags().find(t=>t.text===e)).filter(e=>e)}),this),this.clippedBody=e.computed((function(){if(app.ui.isScreenNarrow()&&app.editing())return;app.mustRefreshNodes();let e=app.getHighlightedText(this.body());return e=app.richTextFormatter.richTextToHtml(e),e=e.substr(0,1024),e}),this),this.linkedTo=e.observableArray(),this.linkedFrom=e.observableArray(),this.element=null,this.canDoubleClick=!0,this.create=function(){if(n.style=window.getComputedStyle(i(n.element).get(0)),n.createX&&n.createY)n.x(n.createX),n.y(n.createY);else{let e=i(n.element).parent();n.x((-e.offset().left+i(window).width()/2-100)/app.workspace.scale),n.y((-e.offset().top+i(window).height()/2-100)/app.workspace.scale)}app.workspace.bringToFront(n.element),app.workspace.startUpdatingArrows(),i(n.element).css({opacity:0,scale:.8,y:"-=80px",rotate:"45deg"}).transition({opacity:1,scale:1,y:"+=80px",rotate:"0deg"},250,"easeInQuad",(function(){app.workspace.stopUpdatingArrows(),app.workspace.updateArrows()})),n.drag(),i(n.element).on("dblclick",(function(){n.canDoubleClick&&app.editNode(n)})),o.Utils.addDoubleTapDetector(n.element,(function(){n.canDoubleClick&&app.editNode(n)})),i(n.element).on("click",(function(e){e.ctrlKey&&(n.selected?app.workspace.deselectNodes(n):app.workspace.selectNodes(n))}))},this.setSelected=function(e){n.selected=e,n.selected?i(n.element).addClass("selected"):i(n.element).removeClass("selected")},this.toggleSelected=function(){n.setSelected(!n.selected)},this.x=function(e){if(null!=e&&i(n.element).css({x:Math.floor(e)}),n.style)return Math.floor(new WebKitCSSMatrix(n.style.webkitTransform).m41)},this.y=function(e){if(null!=e&&i(n.element).css({y:Math.floor(e)}),n.style)return Math.floor(new WebKitCSSMatrix(n.style.webkitTransform).m42)},this.resetDoubleClick=function(){n.canDoubleClick=!0},this.cycleColorDown=function(){n.doCycleColorDown(),setTimeout(n.resetDoubleClick,500),n.canDoubleClick=!1,app.input.isShiftDown&&app.matchConnectedColorID(n),n.selected&&app.setSelectedColors(n),app.setYarnDocumentIsDirty()},this.cycleColorUp=function(){n.doCycleColorUp(),setTimeout(n.resetDoubleClick,500),n.canDoubleClick=!1,app.input.isShiftDown&&app.matchConnectedColorID(n),n.selected&&app.setSelectedColors(n),app.setYarnDocumentIsDirty()},this.doCycleColorDown=function(){n.colorID(n.colorID()-1),n.colorID()<0&&n.colorID(8)},this.doCycleColorUp=function(){n.colorID(n.colorID()+1),n.colorID()>8&&n.colorID(0)},this.remove=async function(){return new Promise((e,t)=>{i(n.element).transition({opacity:0,scale:.8,y:"-=80px",rotate:"-45deg"},250,"easeInQuad",e)})},this.drag=function(){const e={x:0,y:0};let t=!1,o=!1;i(document.body).on("mousemove touchmove",(function(i){if(t){const t=app.input.isScreenTouched&&i.changedTouches?i.changedTouches[0].pageX:i.pageX,a=app.input.isScreenTouched&&i.changedTouches?i.changedTouches[0].pageY:i.pageY;let{x:s,y:r}=app.workspace.toWorkspaceCoordinates(t,a);s-=e.x,r-=e.y;let l=s-n.x(),d=r-n.y();const c=app.workspace.getSelectedNodes();if(("mousemove"===i.originalEvent.type||c.includes(n)&&"touchmove"===i.originalEvent.type)&&(n.x(s),n.y(r)),o&&(n.selected?c.splice(c.indexOf(n),1):c=app.getNodesConnectedTo(n),c.length>0))for(let e in c)c[e].active()&&(c[e].x(c[e].x()+l),c[e].y(c[e].y()+d));app.workspace.updateArrows()}})),i(n.element).on("pointerdown",(function(i){if(!t&&n.active()&&0===i.button){t=!0,(app.input.isShiftDown||n.selected)&&(o=!0);const{x:a,y:s}=app.workspace.toWorkspaceCoordinates(i.pageX,i.pageY);e.x=app.settings.snapGridEnabled()?app.workspace.stepify(a-n.x(),app.settings.gridSize()):a-n.x(),e.y=app.settings.snapGridEnabled()?app.workspace.stepify(s-n.y(),app.settings.gridSize()):s-n.y()}})),i(n.element).on("touchend",(function(e){app.workspace.selectNodes(n)})),i(document).on("pointerup touchend",(function(){(t||o)&&(t=!1,o=!1,app.setYarnDocumentIsDirty())}))},this.moveTo=function(e,t){app.workspace.startUpdatingArrows(),i(n.element).clearQueue(),i(n.element).transition({x:e,y:t},app.stopUpdatingArrows,500)},this.isConnectedTo=function(e,t){if(t&&e.isConnectedTo(n,!1))return!0;let i=n.linkedTo();for(let t in i){if(i[t]==e)return!0;if(i[t].isConnectedTo(e,!1))return!0;if(e.isConnectedTo(i[t],!1))return!0}return!1},this.getLinksInNode=function(e){const t="yarn"===app.settings.documentType();let i=(e||n).body().match(t?/\[\[(.*?)\]\]/g:/\-\>(.*)/g);if(null!=i){let e={};for(let n=i.length-1;n>=0;n--)t?(i[n]=i[n].substr(2,i[n].length-4).trim(),i[n].indexOf("|")>=0&&(i[n]=i[n].split("|")[1]),null!=e[i[n]]&&i.splice(n,1),e[i[n]]=!0):i[n]=i[n].substr(2,i[n].length).trim();return i}},this.updateLinks=function(){n.resetDoubleClick(),n.updateLinksFromParents(),n.updateLinksToChildren()},this.updateLinksFromParents=function(){n.oldTitle&&n.oldTitle!==n.title()&&(n.linkedFrom.removeAll(),app.nodes().forEach(e=>{const t=n.getLinksInNode(e);if(t)if(t.includes(n.oldTitle)){const t=RegExp("\\|\\s*"+n.oldTitle+"\\s*\\]\\]","g"),i=RegExp("\\[\\[\\s*"+n.oldTitle+"\\s*\\]\\]","g");let o=e.body().replace(t,"|"+n.title()+"]]");o=o.replace(i,"[["+n.title()+"]]"),e.body(o),n.linkedFrom.push(e)}else t.includes(n.title())&&n.linkedFrom.push(e)}),n.oldTitle=void 0)},this.updateLinksToChildren=function(){n.linkedTo.removeAll();let e=n.getLinksInNode();if(e)for(let t in app.nodes()){let i=app.nodes()[t];for(let t=0;t(n.pluginStorage||(n.pluginStorage={}),n.pluginStorage[e]||(n.pluginStorage={...n.pluginStorage,[e]:{}}),this.pluginStorage[e]),a=(e,t,i)=>{const a={...o(e),[t]:i};n.pluginStorage={...n.pluginStorage,[e]:a}};window.addEventListener("yarnLoadedData",e=>{if(null!==t.data.documentHeader()){const e=t.data.documentHeader();"pluginStorage"in e&&(n.pluginStorage=e.pluginStorage)}}),window.addEventListener("newYarnFileStarted",e=>{n.pluginStorage={}});const r=({title:n,valueKey:i,defaultValue:o,optionsKey:a,options:s,setterKey:r,settingsColumn:l})=>{t.settings[i]=e.observable(t.settings.storage.getItem(i)||o).extend({persist:i}),t.ui[a]=s,t[r]=function(e,n){const o=n?n.target.value:e;t.settings[i](o)},window.addEventListener("settingsOpened",()=>{const e=t.ui[a].map(e=>``).join(""),o=`\n \n
        \n \n
        \n `,s=document.createElement("div");s.className="settings-item",s.innerHTML=o,document.getElementById("settingsColumn"+(l||"A")).appendChild(s),document.getElementById("mySelect").addEventListener("change",e=>{t[r](!1,e)})})},l=(e,{name:t,iconName:n,onClick:i,attachTo:o,className:a,title:s,onPointerDown:r,onDoubleClick:l,id:d})=>{if(null!==document.getElementById(d))return;const c=document.createElement("span");return c.id=d||t||s||n,c.innerHTML=`\n \n \n  \n ${t||""}\n \n `,document.getElementById(o).appendChild(c),c},d=(e,{id:t,attachTo:n,className:i,title:o,tooltipId:a,toggleValueKey:s,onToggle:r,enableKey:l,iconName:d})=>{if(null!==document.getElementById(t))return;const c=document.createElement("span");return c.id=t,c.className="styled-checkbox",c.innerHTML=`\n \n \n `,document.getElementById(n).appendChild(c),c},c=e=>{window.addEventListener("yarnSavedNode",t=>{e(t)})},p=e=>{window.addEventListener("yarnInPreviewMode",t=>{e(t)})},u=e=>{window.addEventListener("yarnLoadedData",t=>{e(t)})},g=e=>{window.addEventListener("yarnSetDocumentType",t=>{e(t)})},h=e=>{window.addEventListener("yarnEditorOpen",t=>{e(t)})},m=e=>{window.addEventListener("DOMContentLoaded",t=>{e(t)})},f=e=>{window.addEventListener("yarnSetLanguage",t=>{e(t)})},y=e=>{window.addEventListener("yarnLoadedStateFromLocalStorage",t=>{e(t)})},b=e=>{window.addEventListener("yarnSavedStateToLocalStorage",t=>{e(t)})},v=e=>{i(document).on("keyup",t=>{e(t)})},w=e=>{i(document).on("keydown",t=>{e(t)})};s.forEach(e=>{const n=new e({app:t,createButton:l,createToggle:d,getPluginStore:o,setPluginStore:a,addSettingsItem:r,onYarnLoadedData:u,onYarnEditorOpen:h,onYarnInPreviewMode:c,onYarnSavedNode:p,onYarnSetLanguage:f,onYarnLoadedStateFromLocalStorage:y,onYarnSavedStateToLocalStorage:b,onYarnSetDocumentType:g,onKeyUp:v,onKeyDown:w,onLoad:m});window.addEventListener("DOMContentLoaded",e=>{(e=>{t.plugins[e.name]=e})(n)})})}}).call(this,n("Z1dp"),n("EVdn"))},e6Wu:function(e,t,n){"use strict";n.r(t);n("3ozf"),n("P85/"),n("uMdg"),n("gugv");var i=n("oj90"),o=n("0h2I"),a=n.n(o),s=(n("5uVa"),n("si6p"),n("ghrA"),n("bU/s")),r=n.n(s),l=(n("A8C4"),n("VEX6"),n("jF1P"),n("YhK8"),n("Ab/9"),n("KDOe"),n("XfCI"),n("PSD3")),d=n.n(l),c=n("P0sH"),p=n("pLxK"),u=n("bHyH");window.ko=a.a,window.$=window.jQuery=n("EVdn"),window.ace=r.a,r.a.config.set("basePath",i.Utils.getPublicPath()),window.define=r.a.define,window.Swal=d.a,"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").then(e=>{console.log("SW registered: ",e)}).catch(e=>{console.log("SW registration failed: ",e)})}),window.app=new c.a("Yarn",p.a),window.app.run();const g=new u.a(window.app);window.app.plugins=g},fkuv:function(e,t,n){"use strict";(function(e,i){n.d(t,"a",(function(){return a}));var o=n("2Qx2");const a=function(t){const n=this;this.notification=Swal.mixin({toast:!0,position:"top",showConfirmButton:!1,timer:2500}),this.dispatchEvent=function(e,t){const n=new CustomEvent(e);n.options=t,window.dispatchEvent(n),window.parent.dispatchEvent(n)},this.settingsDialogVisible=e.observable(!1),this.narrowScreenThreshold=600,this.isScreenNarrow=function(){return i(window).width()<=n.narrowScreenThreshold},this.availableMarkupLanguages=[{id:"bbcode",name:"Bbcode"},{id:"html",name:"Html"}],this.availableFiletypeVersions=[{id:"1",name:"1"},{id:"2",name:"2"}],this.availableThemes=[{id:"classic",name:"Classic"},{id:"blueprint",name:"Blueprint"},{id:"dracula",name:"Dracula"}],this.availableDocumentTypes=[{id:"yarn",name:"Yarn"},{id:"ink",name:"Ink"}],this.availableLanguages=[{name:"Čeština",id:"cs-CZ"},{name:"Deutsch",id:"de-DE"},{name:"English",id:"en-GB"},{name:"Español",id:"es-ES"},{name:"Français",id:"fr-FR"},{name:"Íslenska",id:"is-IS"},{name:"Nederlands",id:"nl-NL"},{name:"Norsk bokmål",id:"nb-NO"},{name:"Polski",id:"pl-PL"},{name:"Română",id:"ro-RO"},{name:"Slovenčina",id:"sk-SK"},{name:"Svenska",id:"sv-SE"},{name:"Türkçe",id:"tr-TR"},{name:"български",id:"bg-BG"},{name:"Pусский",id:"ru-RU"},{name:"Српски",id:"sr-RS"},{name:"한국어",id:"ko-KR"}],this.availableLineStyles=[{id:"straight",name:"Straight Lines"},{id:"bezier",name:"Bezier Curves"}],this.openSettingsDialog=function(){n.settingsDialogVisible(!0),i(".settings-dialog").css({opacity:0}).transition({opacity:1},250),i(".settings-dialog .form").css({y:"-100"}).transition({y:"0"},250);var e=new CustomEvent("settingsOpened");window.dispatchEvent(e)},this.openHelpDialog=function(){Swal.fire({title:"Help",html:'\n
        \n

        Useful editor shortcuts:

        \n \n
          \n
        • Cmd/Ctrl + Left Click -- Create multiple input carets
        • \n
        • Cmd/Ctrl + Left/Right -- Caret jump word
        • \n
        • Cmd/Ctrl + Up/Down -- Scroll up/down
        • \n
        • Cmd/Ctrl + Left/Right + Shift -- Caret jump word selection
        • \n
        • Cmd/Ctrl + F -- Search
        • \n
        • Cmd/Ctrl + Alt + K -- Find All
        • \n
        • Cmd/Ctrl + H -- Search and Replace
        • \n
        • Cmd/Ctrl + A -- Select all
        • \n
        • Cmd/Ctrl + U -- To Uppercase
        • \n
        • Cmd/Ctrl + Shift + U -- To Lowercase
        • \n
        • Alt + Up/Down -- Move line(s) up/down
        • \n
        • ...
        • \n
        \n
        \n
        How to use Yarn Syntax
        \n
        How to use Ink Syntax
        \n

        Runtimes:

        \n YarnSpinner (Unity3d)\n BondageJs (yarn javascript)\n Ink C# (Unity3d)\n InkJs (javascript)\n BladeInk (java)\n Many more Ink parsers\n
        \n ',showCancelButton:!0,confirmButtonText:"About",cancelButtonText:"Close"}).then(e=>{e.value&&Swal.fire({title:"About",html:'\n \n ',showCancelButton:!1,confirmButtonText:"OK"})})},this.closeSettingsDialog=function(){i(".settings-dialog").css({opacity:1}).transition({opacity:0},250,e=>{n.settingsDialogVisible(!1)}),i(".settings-dialog .form").css({y:"0"}).transition({y:"-100"},250),setTimeout(()=>t.settings.apply(),100)},this.isDialogOpen=function(){return n.settingsDialogVisible()||Swal.isVisible()&&!Swal.isTimerRunning()},this.confirmMarkupConversion=function(){Swal.fire({title:"Are you sure?",text:"Markup on all nodes will be modified. This can rarely result in broken texts. This operation can't be undone.",icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, convert it!",cancelButtonText:"No, cancel!",reverseButtons:!0}).then(e=>{e.value&&(t.convertMarkup(),Swal.fire("Converted!","The markup on the nodes has been converted.","success"))})},this.nodeSearchMatches=function(e,t,n=!1){var o=n||i(".search-title input").is(":checked"),a=n||i(".search-body input").is(":checked"),s=n||i(".search-tags input").is(":checked");return 0!==t.length&&(o||a||s)?{matchTitle:o&&e.title().toLowerCase().indexOf(t)>=0,matchBody:a&&e.body().toLowerCase().indexOf(t)>=0,matchTags:s&&e.tags().toLowerCase().indexOf(t)>=0,clearSearch:!1}:{matchTitle:!1,matchBody:!1,matchTags:!1,clearSearch:!0}},this.findMatchingNodes=function(e){const n={matchTitle:[],matchBody:[],matchTags:[],foundNodes:!1};return[...t.nodes()].reverse().forEach(i=>{const{matchTitle:o,matchBody:a,matchTags:s}=t.ui.nodeSearchMatches(i,e,!0);o&&n.matchTitle.push(i),a&&n.matchBody.push(i),s&&n.matchTags.push(i)}),n.foundNodes=n.matchTitle.length>0||n.matchBody.length>0||n.matchTags.length>0,n},this.createSearchMenuLine=function(e,n,a,s="title"){const r=document.createElement("div");if(r.innerHTML=`${e.title()} ${s?`(${s})`:""}`,i(r).addClass("item "+e.titleStyles[e.colorID()]),"link"==n){if(e.title()!==t.editing().title()){if("ink"===t.settings.documentType()&&e.title().trim()===o.a.InkGlobalScopeNodeName)return;r.setAttribute("onclick","ink"===t.settings.documentType()?"app.insertTextAtCursor('-> "+e.title()+"')":"app.insertTextAtCursor('[["+e.title()+"]]')"),a.appendChild(r)}}else"open"==n&&(r.setAttribute("onclick",`app.openNodeByTitle("${e.title()}")`),r.setAttribute("onmouseenter",`app.workspace.warpToNodeByIdx(${t.nodes.indexOf(e)})`),a.appendChild(r))},this.openNodeListMenu=function(e){const n="link"===e?document.getElementById("linkHelperMenuFilter").value.toLowerCase():document.getElementById("nodeSearchInput").value.toLowerCase(),i=document.getElementById(e+"HelperMenu");i.innerHTML="";const o=()=>{[...t.nodes()].reverse().forEach(t=>{this.createSearchMenuLine(t,e,i,"")})};if(!n)return void o();const a=this.findMatchingNodes(n);a.foundNodes?(a.matchTitle.forEach(t=>{this.createSearchMenuLine(t,e,i,"title")}),a.matchTags.forEach(t=>{this.createSearchMenuLine(t,e,i,"tags")}),a.matchBody.forEach(t=>{this.createSearchMenuLine(t,e,i,"body")})):o()},this.checkAndMoveAppButtons=function(){i(".app-add-node").toggleClass("app-add-node-alt","right"===t.settings.editorSplitDirection()),i(".app-sort").toggleClass("app-sort-alt","right"===t.settings.editorSplitDirection()),i(".app-undo-redo").toggleClass("app-undo-redo-alt","right"===t.settings.editorSplitDirection()),i(".app-zoom").toggleClass("app-zoom-alt","right"===t.settings.editorSplitDirection())},this.resetAppButtonsLocation=function(){i(".app-add-node").removeClass("app-add-node-alt"),i(".app-sort").removeClass("app-sort-alt"),i(".app-undo-redo").removeClass("app-undo-redo-alt"),i(".app-zoom").removeClass("app-zoom-alt")},this.toastMixin=Swal.mixin({toast:!0,icon:"success",title:"Done!",animation:!1,position:"bottom",showConfirmButton:!1,timer:2500,timerProgressBar:!0,didOpen:e=>{e.addEventListener("mouseenter",Swal.stopTimer),e.addEventListener("mouseleave",Swal.resumeTimer)}}),this.insertTextAtCursorWithParams=function(e="",n=[]){const o=n.map((e,t)=>"boolean"==typeof e.default?`
        ${e.name} :
        `:"number"==typeof e.default?`
        ${e.name} :
        `:`
        ${e.name} :
        `).join("\n");Swal.fire({title:"Snippet properties",html:o,preConfirm:function(){return new Promise((function(e){e(n.map((e,t)=>"boolean"==typeof e.default?i("#swal-input"+t).is(":checked"):i("#swal-input"+t).val()))}))},onOpen:function(){i("#swal-input0").focus(),n.forEach((e,t)=>{void 0!==e.default&&("boolean"==typeof e.default?i("#swal-input"+t)[0].checked=e.default:i("#swal-input"+t)[0].value=e.default,console.log(i("#swal-input"+t)))})}}).then((function(n){if(!n.value)return;let i=e;n.value.forEach((e,t)=>{void 0!==e&&(i=i.replace("%"+t,e))}),t.insertTextAtCursor(i)}))}}}).call(this,n("Z1dp"),n("EVdn"))},gugv:function(e,t,n){},jF1P:function(e,t,n){(function(e){var t,n;t={},n=0,e.bindingHandlers.ace={init:function(i,o,a,s,r){var l=a().aceOptions||{},d=e.utils.unwrapObservable(o());i.id||(i.id="knockout-ace-"+n,n+=1);var c=ace.edit(i.id);l.theme&&c.setTheme("ace/theme/"+l.theme),l.mode&&c.getSession().setMode("ace/mode/"+l.mode),c.setValue(d),c.gotoLine(0),c.setShowPrintMargin(!1),c.getSession().setUseWrapMode(!0),c.getSession().on("change",(function(t){e.isWriteableObservable(o())&&o()(c.getValue())})),t[i.id]=c,e.utils.domNodeDisposal.addDisposeCallback(i,(function(){try{c.destroy()}catch(e){}delete t[i.id]}))},update:function(n,i,o,a,s){var r=e.utils.unwrapObservable(i()),l=n.id;if(void 0!==l&&""!==l&&t.hasOwnProperty(l)){var d=t[l];d.getValue()!==r&&(d.setValue(r),d.gotoLine(0))}}},e.aceEditors={resizeAll:function(){for(var e in t)t.hasOwnProperty(e)&&t[e].resize()},get:function(e){return t[e]}}}).call(this,n("Z1dp"))},"l8+o":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("mIo7"),o=n("mqgS");const a=function(e){const t=e=>{const t=/(https?:\/\/twitter.com\/[^\s\<]+\/[^\s\<]+\/[^\s\<]+)/gi,n=/((https:\/\/)?(www.)?instagram.com\/p\/[^\s\<]+)/gi,i=/(?:http(?:s?):\/\/|)(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?‌​[\w\?‌​=]*)?(?:\?t=[0-9]+)?/gi,o=new RegExp(`^(?!${t.source}|${i.source}|${n.source})https?:.*$`,"gm");e=e.replace(o,(function(e){return`\n
        \n \n
        \n `}));const a=[];return e=e.replace(t,(function(e){const t=e.match(/https:\/\/twitter.com\/.*\/status\/([0-9]+)/i);if(t.length>1)return a.push(t[1]),``})),setTimeout(()=>{const e=document.querySelectorAll(".tweet");a.forEach((t,n)=>{twttr.widgets.createTweet(t,e[n],{align:"center",follow:!1})})},500),e=(e=e.replace(i,(function(e){const t=e.match(/(?:https\:.*|)(?:www.|)youtu(?:.*\/v\/|.*v\=|\.be\/)([A-Za-z0-9_\-]{11}(?:\?t=[0-9]+)?)/i);if(t.length>1)return`\n \n `}))).replace(n,(function(e){const t=e.match(/((?:https?:\/\/)?(?:www.)?instagram.com\/p\/([^\s\<]+)\/)/i);if(t.length>2)return console.log("EXTRACTED",t),`\n \n `}))};return"html"===e.settings.markupLanguage()?new o.a(e,t):new i.a(e,t)}},mIo7:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return BbcodeRichTextFormatter}));const bbcode=__webpack_require__("L8pc"),BbcodeRichTextFormatter=function(app,addExtraPreviewerEmbeds){const self=this;this.justInsertedAutoComplete=!1,this.completableTags=Object.freeze([{Start:"<<",Completion:">>",Offset:-2},{Start:"[colo",Completion:"r=#][/color]",Offset:-9,BehaviorCompletion:"r=#][/color",Func:()=>{app.insertColorCode()}},{Start:"[b",Completion:"][/b]",BehaviorCompletion:"][/b",Offset:-4},{Start:"[i",Completion:"][/i]",BehaviorCompletion:"][/i",Offset:-4},{Start:"[img",Completion:"][/img]",BehaviorCompletion:"][/img",Offset:-6},{Start:"[u",Completion:"][/u]",BehaviorCompletion:"][/u",Offset:-4},{Start:"[url",Completion:"][/url]",BehaviorCompletion:"][/url",Offset:-6}]),this.getTagOpen=function(e){switch(e){case"cmd":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"~ ":"{ ":"<<";case"opt":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"-> ":"* [":"[[";case"color":return"[color=#]";default:return`[${e}]`}},this.getTagClose=function(e){switch(e){case"cmd":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"":" }":">>";case"opt":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"":"]":"|]]";default:return`[/${e}]`}},this.identifyTag=function(e){return-1!==e.lastIndexOf("[")?e.substring(e.lastIndexOf("["),e.length):""},this.insertTag=function(e){const t=self.getTagOpen(e),n=self.getTagClose(e),i=JSON.parse(JSON.stringify(app.editor.selection.getRange()));app.editor.session.insert(i.start,t),app.editor.session.insert({column:i.end.column+t.length,row:i.end.row},n),"color"===e&&(0===app.editor.getSelectedText().length?app.moveEditCursor(-9):app.editor.selection.setRange({start:{row:app.editor.selection.getRange().start.row,column:app.editor.selection.getRange().start.column-1},end:{row:app.editor.selection.getRange().start.row,column:app.editor.selection.getRange().start.column-1}}),app.insertColorCode()),"img"===e?0===app.editor.getSelectedText().length&&(app.moveEditCursor(-6),app.data.triggerPasteClipboard(),setTimeout(()=>app.moveEditCursor(6),300)):0===app.editor.getSelectedText().length?app.isEditorInPreviewMode||app.moveEditCursor(-n.length):app.editor.selection.setRange({start:app.editor.selection.getRange().start,end:{row:app.editor.selection.getRange().end.row,column:app.editor.selection.getRange().end.column-n.length}}),app.editor.focus()},this._convertTag=function(inPattern,outPattern,text){const globalRegex=new RegExp(inPattern,"gi"),localRegex=new RegExp(inPattern,"i");return text.replace(globalRegex,m=>{const match=m.match(localRegex),template=eval("`"+outPattern+"`");return match.length?template:null})},this.convert=function(e){let t=e;return t=self._convertTag("(.*?)<\\/b>","[b]${match[1]}[/b]",t),t=self._convertTag("(.*?)<\\/u>","[u]${match[1]}[/u]",t),t=self._convertTag("(.*?)<\\/i>","[i]${match[1]}[/i]",t),t=self._convertTag("(.*?)<\\/img>","[img]${match[1]}[/img]",t),t=self._convertTag("(.*?)<\\/color>","[color=#${match[1]}]${match[2]}[/color]",t),t=self._convertTag("(.*?)<\\/url>","[url]${match[1]}[/url]",t),t},this.richTextToHtml=function(e,t=!1){let n=1,i=t?'
        '+n+". "+e+"
        ":e;return i=i.replace(/<(run:"),i=i.replace(/>>/gi,")
        "),i=i.replace(/\[color=#[A-Za-z0-9]+\]/gi,(function(e){const t=e.match(/\[color=#([A-Za-z0-9]+)\]/i);if(t&&t.length>1)return"[color=#"+t[1]+"]"})),i=i.replace(/\[img\][^\[]+\[\/img\]/gi,(function(e){const n=e.match(/\[img\](.*)\[\/img\]/i);if(n.length>1){const e=app.data.editingFileFolder(n[1]);return app.data.doesFileExist(e)?t?' ':' ':t?' ':' '}})),t&&(i=addExtraPreviewerEmbeds(i)),i=i.replace(/[\n\r]/g,(function(e){let i="
        ";return n+=1,t&&(i+='
        '+n+". "),i})),i=bbcode.parse(i),i}}},mqgS:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return HtmlRichTextFormatter}));const HtmlRichTextFormatter=function(app,addExtraPreviewerEmbeds){const self=this;this.justInsertedAutoComplete=!1,this.completableTags=Object.freeze([{Start:"<<",Completion:">>",Offset:-2},{Start:"",Offset:-9,Func:()=>{app.insertColorCode()}},{Start:"",Offset:-4},{Start:"",Offset:-6},{Start:"",Offset:-4},{Start:"",Offset:-4},{Start:"",Offset:-6}]),this.getTagOpen=function(e){switch(e){case"cmd":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"~ ":"{ ":"<<";case"opt":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"-> ":"* [":"[[";case"color":return"";default:return`<${e}>`}},this.getTagClose=function(e){switch(e){case"cmd":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"":" }":">>";case"opt":return"ink"===app.settings.documentType()?0===app.editor.getSelectedText().length?"":"]":"|]]";default:return``}},this.identifyTag=function(e){return-1!==e.lastIndexOf("<")?e.substring(e.lastIndexOf("<"),e.length):""},this.insertTag=function(e){const t=self.getTagOpen(e),n=self.getTagClose(e),i=JSON.parse(JSON.stringify(app.editor.selection.getRange()));app.editor.session.insert(i.start,t),app.editor.session.insert({column:i.end.column+t.length,row:i.end.row},n),"color"===e&&(0===app.editor.getSelectedText().length?app.moveEditCursor(-9):app.editor.selection.setRange({start:{row:app.editor.selection.getRange().start.row,column:app.editor.selection.getRange().start.column-1},end:{row:app.editor.selection.getRange().start.row,column:app.editor.selection.getRange().start.column-1}}),app.insertColorCode()),"img"===e?navigator.clipboard.readText().then(e=>{0===app.editor.getSelectedText().length&&(app.moveEditCursor(-7),app.insertTextAtCursor(` src="${e}"`))}):0===app.editor.getSelectedText().length?app.isEditorInPreviewMode||app.moveEditCursor(-n.length):app.editor.selection.setRange({start:app.editor.selection.getRange().start,end:{row:app.editor.selection.getRange().end.row,column:app.editor.selection.getRange().end.column-n.length}}),app.editor.focus()},this._convertTag=function(inPattern,outPattern,text){const globalRegex=new RegExp(inPattern,"gi"),localRegex=new RegExp(inPattern,"i");return text.replace(globalRegex,m=>{const match=m.match(localRegex),template=eval("`"+outPattern+"`");return match.length?template:null})},this.convert=function(e){let t=e;return t=self._convertTag("\\[b\\](.*?)\\[\\/b\\]","${match[1]}",t),t=self._convertTag("\\[u\\](.*?)\\[\\/u\\]","${match[1]}",t),t=self._convertTag("\\[i\\](.*?)\\[\\/i\\]","${match[1]}",t),t=self._convertTag("\\[img\\](.*?)\\[\\/img\\]","${match[1]}",t),t=self._convertTag("\\[color=#(.*?)\\](.*?)\\[\\/color\\]","${match[2]}",t),t=self._convertTag("\\[url\\](.*?)\\[\\/url\\]","${match[1]}",t),t},this.richTextToHtml=function(e,t=!1){let n=1,i=t?'
        '+n+". "+e+"
        ":e;return i=i.replace(/<(run:"),i=i.replace(/>>/gi,")
        "),[/<color=#(.*?)>(.*?)<\/color>/,/(.*?)<\/color>/].forEach(e=>{const t=new RegExp(e,"gi"),n=new RegExp(e,"i");i=i.replace(t,(function(e){const t=e.match(n);if(t&&t.length>2)return`☗${t[2]}`}))}),i=i.replace(/<img>[^\[]+<\/img>/gi,(function(e){const n=e.match(/<img>(.*?)<\/img>/i);if(n.length>1){const e=app.data.editingFileFolder(n[1]);return app.data.doesFileExist(e)?t?' ':' ':t?' ':' '}})),i=i.replace(/<b>.*<\/b>/gi,e=>{const t=e.match(/<b>(.*)<\/b>/i);if(t.length)return`${t[1]}`}),i=i.replace(/<u>.*<\/u>/gi,e=>{const t=e.match(/<u>(.*)<\/u>/i);if(t.length)return`${t[1]}`}),i=i.replace(/<i>.*<\/i>/gi,e=>{const t=e.match(/<i>(.*)<\/i>/i);if(t.length)return`${t[1]}`}),t&&(i=addExtraPreviewerEmbeds(i)),i=i.replace(/[\n\r]/g,(function(e){let i="
        ";return n+=1,t&&(i+='
        '+n+". "),i})),i}}},oj90:function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"FILETYPE",(function(){return i})),n.d(t,"Utils",(function(){return o}));var i={JSON:"json",XML:"xml",TWEE:"twee",TWEE2:"tw2",UNKNOWN:"none",YARN:"yarn",INK:"ink",INKJSON:"ink.json",RENPY:"rpy"},o={createAutocompleter:function(e,t,n,i=1){return{getCompletions:function(o,a,s,r,l){var d=o.session.getTokenAt(s.row,s.column);r.length`,"

        ",e.title,"

        ","
        ","
        ",e.about,"
        ","
        ","
        "].join("")}}},addDoubleTapDetector:function(e,t){e.lastTap=0,e.tapTimeout=0,e.addEventListener("touchend",(function(n){var i=(new Date).getTime(),o=i-e.lastTap;clearTimeout(e.tapTimeout),o<500&&o>0?(t(),n.preventDefault()):e.tapTimeout=setTimeout((function(){clearTimeout(e.tapTimeout)}),500),e.lastTap=i}))},uniqueSplit:function(e,t=" "){return[...new Set(e.split(t).filter(e=>e))]},getHighestZ:function(t){let n=Number.NEGATIVE_INFINITY;return e(t).children().each((function(){let t=parseInt(e(this).css("z-index"))||0;t>n&&(n=t)})),n},clamp:function(e,t,n){return Math.max(Math.min(e,n),t)},rectanglesOverlap:function(e,t){return!(t.left>e.right||t.righte.bottom||t.bottom=0;)e=e.replace("<","<");for(;e.indexOf(">")>=0;)e=e.replace(">",">");return e},xmlToObject:function(e){var t=[];if((e=e.childNodes.item(0)).hasChildNodes())for(var n=0;n0)){o[r.nodeName]={};for(var l=0;l1){if(n.items={cut:{name:"Cut",icon:"cut",callback:()=>{app.clipboard.length>0&&(app.data.triggerCopyClipboard(),app.insertTextAtCursor(""))}},copy:{name:"Copy",icon:"copy",callback:()=>{app.data.triggerCopyClipboard()}},paste:{name:"Paste",icon:"paste",callback:()=>app.data.triggerPasteClipboard()},sep1:"---------"},!app.getTagBeforeCursor().match(e)||"ink"===app.settings.documentType()&&"END"===app.editor.getSelectedText()||(n.items["go to node"]={name:"Edit node: "+app.editor.getSelectedText(),callback:()=>{const e=app.getFutureEditedNodeTitle();app.nodeVisitHistory.includes(e)||app.nodeVisitHistory.push(e),app.openNodeByTitle(app.editor.getSelectedText())}}),app.settings.spellcheckEnabled()){var i=app.getSpellCheckSuggestionItems();!1!==i&&(n.items.corrections={name:"Correct word",items:i})}var o=app.getThesaurusItems();!1!==o&&(n.items.corrections={name:"Related words",items:o})}else n.items={paste:{name:"Paste",icon:"paste",callback:()=>app.data.triggerPasteClipboard()}},"ink"===app.settings.documentType()&&(n.items.inkSnips={name:"Ink snippets",items:{structure:{name:"Structure",items:{stitch:{name:"Stitch",callback:()=>{app.insertTextAtCursor("= stitchName\nThis is the content of the stitch that should be embedded within a knot.\n-> END")}},end:{name:"Ending indicator",callback:()=>{app.insertTextAtCursor("-> END")}}}},choices:{name:"Choices",items:{basicChoice:{name:"Basic choice",callback:()=>{app.insertTextAtCursor("* This is a choice that can only be chosen once")}},stickyChoice:{name:"Sticky choice",callback:()=>{app.insertTextAtCursor("+ This is a sticky choice - the player can choose it more than once")}},choiceWithoutPrinting:{name:"Choice without printing",callback:()=>{app.insertTextAtCursor("* [A choice where the content isn't printed after choosing]")}},choiceWithoutMixedOutput:{name:"Choice without mixed output",callback:()=>{app.insertTextAtCursor("* Try [it] this example!")}}}},variableText:{name:"Variable text",items:{shuffle:{name:"~Shuffle (rand) text",callback:()=>{app.insertTextAtCursor("I tossed the coin. {~Heads|Tails}.")}},cycle:{name:"&Cycle text",callback:()=>{app.insertTextAtCursor("It was {&Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday} today.")}},sequence:{name:"Sequence text",callback:()=>{app.insertTextAtCursor('The radio hissed into life. {"Three!"|"Two!"|"One!"|There was the white noise racket of an explosion.|But it was just static.}\n\n{I bought a coffee with my five-pound note.|I bought a second coffee for my friend.|I didn\'t have enough money to buy any more coffee.}')}},onceOnly:{name:"!Once only text",callback:()=>{app.insertTextAtCursor("He told me a joke. {!I laughed politely.|I smiled.|I grimaced.|I promised myself to not react again.}\n")}}}},variables:{name:"Variables",items:{globalVariable:{name:"Global variable",callback:()=>{app.insertTextAtCursor("VAR myNumber = 5")}},temporaryVariable:{name:"Temporary variable",callback:()=>{app.insertTextAtCursor("temp myTemporaryValue = 5")}},modifyVariable:{name:"Modify variable",callback:()=>{app.insertTextAtCursor("~ myNumber = myNumber + 1")}}}},conditions:{name:"Conditions",items:{inlineCondition:{name:"Inline condition",callback:()=>{app.insertTextAtCursor("{yourVariable: This is written if yourVariable is true|Otherwise this is written}\n")}},multilineCondition:{name:"Multiline condition",callback:()=>{app.insertTextAtCursor("{yourVariable:\n This is written if yourVariable is true.\n - else:\n Otherwise this is written.\n}")}}}}}},n.items.code={name:"Code",items:{equal:{name:"== (equal)",callback:()=>app.insertTextAtCursor("== ")},notEqual:{name:"!= (not equal)",callback:()=>app.insertTextAtCursor("!= ")},tag:{name:"# (tag)",callback:()=>app.insertTextAtCursor("# ")},list:{name:"LIST",callback:()=>app.insertTextAtCursor("LIST = ")},listFunc:{name:"List functions",items:{count:{name:"count",callback:()=>app.insertTextAtCursor("LIST_COUNT()")},min:{name:"min",callback:()=>app.insertTextAtCursor("LIST_MIN()")},max:{name:"max",callback:()=>app.insertTextAtCursor("LIST_MAX()")},rand:{name:"random",callback:()=>app.insertTextAtCursor("LIST_RANDOM()")}}},variable:{name:"VAR",callback:()=>app.insertTextAtCursor("VAR = ")},temp:{name:"~ temp",callback:()=>app.insertTextAtCursor("~ temp = ")},plusEq:{name:"+= (plus equal)",callback:()=>app.insertTextAtCursor("+= ")},else:{name:"- else",callback:()=>app.insertTextAtCursor("- else:\n")},or:{name:"|",callback:()=>app.insertTextAtCursor("|")},rand:{name:"~",callback:()=>app.insertTextAtCursor("~")}}},n.items.bladeCoder={name:"BladeCoder",items:{player:{name:"$PLAYER>",callback:()=>app.insertTextAtCursor("$PLAYER> ")},animation:{name:"Animation",callback:()=>app.ui.insertTextAtCursorWithParams("> Animation: animation=%0.%1, wait=%2, keepDirection=%3, repeat=%4, count=%5",[{name:"Actor",default:"$PLAYER"},{name:"Animation",default:"stand.right"},{name:"Wait",default:!1},{name:"Keep direction",default:!1},{name:"Repeat",default:"SPRITE_DEFINED"},{name:"Count",default:-1}])},goto:{name:"Goto",callback:()=>app.ui.insertTextAtCursorWithParams("> Goto: actor=%0, target=%1",[{name:"Actor",default:"$PLAYER"},{name:"target",default:"target"}])},wait:{name:"Wait",callback:()=>app.ui.insertTextAtCursorWithParams("> Wait: time=%0",[{name:"Time",default:.8}])},playSound:{name:"Play Sound",callback:()=>app.ui.insertTextAtCursorWithParams("> PlaySound: sound=%0, stop=%1",[{name:"Sound",default:"yawn"},{name:"Stop",default:!1}])},setActorAttr:{name:"Set Actor Attribute",callback:()=>app.ui.insertTextAtCursorWithParams("> SetActorAttr: actor=%0, talkAnimation=%1, visible=%2",[{name:"Actor",default:"$PLAYER"},{name:"Talk animation"},{name:"Visible",default:!0}])}}},n.items.end={name:"-> END",callback:()=>app.insertTextAtCursor("-> END")},n.items.star={name:"* (choice)",callback:()=>app.insertTextAtCursor("* ")},n.items.gather={name:"- (gather)",callback:()=>app.insertTextAtCursor("-")},n.items.stitch={name:"= (stitch)",callback:()=>app.insertTextAtCursor("= ")},n.items.glue={name:"<> (glue)",callback:()=>app.insertTextAtCursor("<>")},n.items.comment={name:"// (comment)",callback:()=>app.insertTextAtCursor("// ")},n.items.nested={name:"Nested",items:{gather2:{name:"-- (gather)",callback:()=>app.insertTextAtCursor("-- ")},star2:{name:"** (choice)",callback:()=>app.insertTextAtCursor("** ")}}},n.items.inkDoc={name:"How to use ink",callback:()=>window.open("https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md","_blank").focus()});return app.getTagBeforeCursor().match(/\[img/g)&&(n.items["Choose image"]={name:"Choose image",callback:()=>{app.data.insertImageFileName()}}),n}}}}}}.call(this,n("EVdn"))},owJe:function(e,t,n){(function(e){var i=n("jXEy"),o=n("oj90"),a=o.Utils.getPublicPath("dictionaries/en/index.dic"),s=o.Utils.getPublicPath("dictionaries/en/index.aff");e("").appendTo("head"),e("").appendTo("head");var r=null;function l(e){var t=e.split(/\s+|\.|\,|\?|\\|\/|\!|\[|\]|"|'|;|:|`|\+|\-|\&|\$|@|~|#|>|<|_|\)|\(|£|\^|%|\*|„|“|\||[0-9]+/g),n=0,i=[];for(word in t){var o=t[word];r.correct(o)||(i[i.length]=[n,n+t[word].length]),n+=t[word].length+1}return i}t.load_dictionary=function(t){console.info(`Loading ${t} hunspell dictionary locally`),a=o.Utils.getPublicPath(`dictionaries/${t}/index.dic`),s=o.Utils.getPublicPath(`dictionaries/${t}/index.aff`),e.get(a,(function(e){dicData=e})).fail((function(){const n=sessionStorage.getItem("affData"),o=sessionStorage.getItem("dicData");if(n&&o)return console.info(t+" found in sessionStorage. Loading dictionary from cache..."),r=new i(n,o),void(d=!0);console.error(t+" not found locally. Loading dictionary from server instead..."),a=`https://raw.githubusercontent.com/wooorm/dictionaries/main/dictionaries/${t}/index.dic`,s=`https://raw.githubusercontent.com/wooorm/dictionaries/main/dictionaries/${t}/index.aff`,e.get(a,(function(e){dicData=e})).done((function(){e.get(s,(function(e){affData=e})).done((function(){sessionStorage.setItem("affData",affData),sessionStorage.setItem("dicData",dicData),r=new i(affData,dicData),d=!0}))}))})).done((function(){e.get(s,(function(e){affData=e})).done((function(){console.log("Dictionary loaded locally"),r=new i(affData,dicData),d=!0}))}))},t.misspelled=l;var d=!0,c=!1,p=[];function u(){if(null!=r&&!c&&d){c=!0;var e=ace.edit("editor").getSession();h();try{var t=ace.require("ace/range").Range,n=e.getDocument().getAllLines();for(var i in n){var o=l(n[i]);for(var a in o){var s=new t(i,o[a][0],i,o[a][1]);p[p.length]=e.addMarker(s,"misspelled","typo",!0)}}}finally{c=!1,d=!1}}}t.spell_check=u;var g=!1;function h(){var e=ace.edit("editor").getSession();for(var t in p)e.removeMarker(p[t]);p=[];var n=e.getDocument().getAllLines();for(var t in n)e.removeGutterDecoration(t,"misspelled")}t.enable_spellcheck=function(){g=!0,ace.edit("editor").getSession().on("change",(function(e){g&&(d=!0,u())})),d=!0,u()},t.disable_spellcheck=function(){g=!1,h()},t.clear_spellcheck_markers=h,t.suggest_word_for_misspelled=function(e){var t=r.suggest(e);return 0!==t.length&&t}}).call(this,n("EVdn"))},pLxK:function(e){e.exports=JSON.parse('{"a":"0.4.258"}')},pYPP:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));const i=function(t){const n=this,i=window.vsCodeApi?{getItem:()=>{},setItem:()=>{}}:window.localStorage;this.storage=i,e.extenders.persist=function(e,t){return e.subscribe((function(e){i.setItem(t,e)})),e},this.apply=function(){t.setTheme(n.theme()),t.setLanguage(n.language()),t.setDocumentType(n.documentType()),t.toggleInvertColors(),t.setMarkupLanguage(n.markupLanguage()),t.workspace.setThrottle(n.redrawThrottle()),t.setGistCredentials({token:n.gistToken(),file:null!==n.gistFile()?n.gistFile().split("/").pop():null})},this.validateGridSize=function(){n.gridSize()<20&&n.gridSize(20),n.gridSize()>200&&n.gridSize(200),n.gridSize(parseInt(n.gridSize())),t.initGrid()},this.theme=e.observable(i.getItem("theme")||"dracula").extend({persist:"theme"}),this.documentType=e.observable(i.getItem("documentType")||"yarn").extend({persist:"documentType"}),this.language=e.observable(i.getItem("language")||"en-GB").extend({persist:"language"}),this.redrawThrottle=e.observable(parseInt(i.getItem("redrawThrottle")||"50")).extend({persist:"redrawThrottle"}),this.gistToken=e.observable(i.getItem("gistToken")).extend({persist:"gistToken"}),this.gistFile=e.observable(i.getItem("gistFile")).extend({persist:"gistFile"}),this.spellcheckEnabled=e.observable(null===i.getItem("spellcheckEnabled")||"true"===i.getItem("spellcheckEnabled")).extend({persist:"spellcheckEnabled"}),this.autoCloseTags=e.observable(null===i.getItem("autoCloseTags")||"true"===i.getItem("autoCloseTags")).extend({persist:"autoCloseTags"}),this.autocompleteSuggestionsEnabled=e.observable(null===i.getItem("autocompleteSuggestionsEnabled")||"true"===i.getItem("autocompleteSuggestionsEnabled")).extend({persist:"autocompleteSuggestionsEnabled"}),this.autoCloseBrackets=e.observable(null===i.getItem("autoCloseBrackets")||"true"===i.getItem("autoCloseBrackets")).extend({persist:"autoCloseBrackets"}),this.invertColorsEnabled=e.observable(null!==i.getItem("invertColorsEnabled")&&"true"===i.getItem("invertColorsEnabled")).extend({persist:"invertColorsEnabled"}),this.snapGridEnabled=e.observable(null!==i.getItem("snapGridEnabled")&&"true"===i.getItem("snapGridEnabled")).extend({persist:"snapGridEnabled"}),this.gridSize=e.observable(parseInt(i.getItem("gridSize")||"40")).extend({persist:"gridSize"}),this.createNodesEnabled=e.observable(null===i.getItem("createNodesEnabled")||"true"===i.getItem("createNodesEnabled")).extend({persist:"createNodesEnabled"}),this.editorStatsEnabled=e.observable(null!==i.getItem("editorStatsEnabled")&&"true"===i.getItem("editorStatsEnabled")).extend({persist:"editorStatsEnabled"}),this.markupLanguage=e.observable(i.getItem("markupLanguage")||"bbcode").extend({persist:"markupLanguage"}),this.filetypeVersion=e.observable(i.getItem("filetypeVersion")||"1").extend({persist:"filetypeVersion"}),this.lineStyle=e.observable(i.getItem("lineStyle")||"straight").extend({persist:"lineStyle"}),this.fileTabsVisible=e.observable(null===i.getItem("fileTabsVisible")||"true"===i.getItem("fileTabsVisible")).extend({persist:"fileTabsVisible"}),this.selectedFileTab=e.observable(i.getItem("selectedFileTab")||0).extend({persist:"selectedFileTab"}),this.alwaysOpenNodesInVisualStudioCodeEditor=e.observable(null!==i.getItem("alwaysOpenNodesInVisualStudioCodeEditor")&&"true"===i.getItem("alwaysOpenNodesInVisualStudioCodeEditor")).extend({persist:"alwaysOpenNodesInVisualStudioCodeEditor"}),this.editorSplitDirection=e.observable(i.getItem("editorSplitDirection")||"left").extend({persist:"editorSplitDirection"}),this.editorSplit=e.observable(null!==i.getItem("editorSplit")&&"true"===i.getItem("editorSplit")).extend({persist:"editorSplit"}),this.editorSplitSize=e.observable(i.getItem("editorSplitSize")||"50%").extend({persist:"editorSplitSize"})}}).call(this,n("Z1dp"))},qVgP:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var i=n("+qE3");const{Story:o}=n("OeYU");var a=function(){let t=new i.EventEmitter;this.emiter=t,this.story=null,this.log=[],this.onRecompile=()=>{},this.curStory={messages:[],choices:[],tags:[],paragraphEl:""},this.resetStory=()=>{this.prevSavePoints=[],this.choiceHistory=[],this.textAreaEl.innerHTML="",this.curStory={messages:[],choices:[],tags:[],paragraphEl:""},this.story.ResetState()},this.terminate=()=>{if(this.textAreaEl)try{t.removeAllListeners(),this.finished=!0}catch(e){console.warn(e)}},this.setCurStory=({messages:e,choices:t,tags:n,paragraphEl:i})=>{this.curStory={messages:e,choices:t,tags:n,paragraphEl:i}};const n=(e="",t="")=>{const n=(e=>{let t=[];for(;e.canContinue;)t.push(e.Continue().replace(/\n/g,""));return t})(this.story),i=e.includes('"')?e:`[${e}]`,o=document.createElement("p");if(e){const a=document.createElement("p");a.innerHTML=``,a.onclick=()=>app.navigateToNodeDuringPlayTest(t,i),o.appendChild(a),n.forEach(e=>{const t=document.createElement("p");t.innerHTML=e+"
        ",o.appendChild(t)})}else o.innerHTML=n.join("
        ");this.setCurStory({...this.curStory,messages:this.log?[...this.curStory.messages,e?`--${e}--`:"",n].filter(Boolean):[n],tags:this.story.currentTags,choices:this.story.currentChoices,paragraphEl:o}),s()};this.prevSavePoints=[];const a=(e,t)=>{this.prevSavePoints.push(this.story.state.toJson());const i=this.story.state.currentChoices[e].sourcePath.split(".")[0];this.story.ChooseChoiceIndex(e),n(t,i)};this.rewindStory=()=>{document.getElementById("choiceButtons").remove(),this.textAreaEl.removeChild(this.textAreaEl.lastElementChild),this.story.state.LoadJson(this.prevSavePoints.pop()),n()},this.createAndAddParagraph=t=>{if(console.log("made",t),t.innerHTML){const n=document.createElement("p");n.appendChild(t),n.className="story-playtest-bubble story-playtest-answer answer-post fade-in is-paused",this.textAreaEl.appendChild(n),e(n).removeClass("is-paused")}};const s=()=>{this.createAndAddParagraph(this.curStory.paragraphEl),this.textAreaEl.querySelectorAll("div").forEach(e=>e.remove());const e=document.createElement("div");e.id="choiceButtons",e.className="flex-wrap";const t=document.createElement("button");t.innerText="🔄",t.title="Recompile story",t.onclick=this.onRecompile,t.className="storyPreviewChoiceButton",e.appendChild(t);const i=document.createElement("button");i.innerText="🎬",i.title="Restart story",i.onclick=()=>{this.resetStory(),n()},i.className="storyPreviewChoiceButton",e.appendChild(i);const o=document.createElement("button");o.innerText="⏪",o.title="Go to previous",o.disabled=0===this.prevSavePoints.length,o.onclick=()=>{this.rewindStory(),n()},e.appendChild(o),o.className="storyPreviewChoiceButton",this.curStory.choices.forEach((t,n)=>{const i=document.createElement("button");i.innerText=t.text,i.onclick=e=>{e.stopPropagation(),a(n,t.text)},i.className="storyPreviewChoiceButton",e.appendChild(i)}),this.textAreaEl.appendChild(e),this.textAreaEl.scrollTo({top:this.textAreaEl.scrollHeight+100,left:0,behavior:"smooth"})};this.initInk=(e,t,i,a,s,r,l,d,c,p)=>{this.onRecompile=t,console.log("INIT INK"),this.finished=!1,document.getElementById(r).style.visibility="hidden",this.textAreaEl=document.getElementById(d),this.textAreaEl.innerHTML='

        Parsing ink

        .

        .

        .

        ',this.inkTextData=a,this.compiler=e,this.compiler.init(e=>{if(this.textAreaEl.innerHTML="",e.errors.length>0)return this.textAreaEl.innerHTML=`

        Parsing failed:

        >

        ${e.errors.join("

        ")}


        ${e.warnings.join("

        ")}

        `,void(this.textAreaEl.onclick=()=>{console.log("====>",e),app.data.goToErrorInkNode(this.inkTextData,e.errors[0]),this.textAreaEl.onclick=null});if(e.warnings.length>0){const t=document.createElement("p");t.className="title-warning",e.warnings.forEach(e=>{const n=document.createElement("p");n.innerText=e,n.onclick=()=>{app.data.goToErrorInkNode(this.inkTextData,e)},t.appendChild(n)}),this.createAndAddParagraph(t)}if(this.story=new o(e.story),console.log("STORY",this.story),console.warn("Warnings",e.warnings),n(),""===this.story.currentText&&0===this.story.currentChoices.length)if(s!==app.data.InkGlobalScopeNodeName)this.compiler.submit(`-> ${s}\n`+a);else{const e=a.split("\n").find(e=>e.includes("==="));this.compiler.submit(`-> ${e.split("===")[1]}\n`+a)}}).then(()=>{if(!i.recompile&&i.story&&0!==i.prevSavePoints.length)return this.story=i.story,i.childNodes.forEach(e=>this.textAreaEl.appendChild(e)),this.prevSavePoints=i.prevSavePoints,void n();a&&this.compiler.submit(a)})}}}).call(this,n("EVdn"))},tUqF:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const i=n("Wd8k"),o=n("L8pc"),a=new i.Runner,s=n("+qE3").EventEmitter;var r=function(){this.visitedNodes=[];this.node={title:""};let e=new s;this.emiter=e;let t=[];this.commandsPassedLog=t;this.commandPassed="";let n=!0;this.finished=n,this.scrollTextStyle=!1,this.visitedChapters=[],this.self=this,this.vnChoiceSelectionCursor=">",this.startTimeWait,this.vnSelectedChoice=-1,this.vnTextScrollInterval,this.storyChapter="",this.choices={};let i,r,l,d,c,p,u,g,h=null;this.vnSelectChoice=()=>{(new Date).getTime()-this.startTimeWait<1e3||(this.choices[this.storyChapter].push(d.options[this.vnSelectedChoice]),d.select(this.vnSelectedChoice),this.emiter.emit("choiceMade",d.options[this.vnSelectedChoice]),r="",i=void 0,d=self.goToNext(),this.vnSelectedChoice=-1,this.changeTextScrollSpeed(111))},this.vnUpdateChoice=(t=0)=>{if(this.vnSelectedChoice<0)return;let n=this.vnSelectedChoice+t;n>d.options.length-1?n=0:n<0&&(n=d.options.length-1),this.vnSelectedChoice=n,i=document.createElement("DIV"),d.options.forEach((e,t)=>{const n=document.createElement("DIV");t==this.vnSelectedChoice?n.innerHTML=`${this.vnChoiceSelectionCursor} [${e}]`:n.innerHTML=`${this.vnChoiceSelectionCursor.replace(/.*/gm," ")} [${e}]`,n.onclick=e=>{e.stopPropagation(),this.vnSelectedChoice=t,this.vnUpdateChoice()},n.ondblclick=e=>{e.stopPropagation(),this.vnSelectedChoice=t,this.vnSelectChoice()},n.className="storyPreviewChoiceButton",i.appendChild(n)}),e.emit("choiceUpdated",this.vnSelectedChoice),self.updateVNHud()},this.changeTextScrollSpeed=(t=0)=>{if(t!==this.vnTextScrollInterval){if(this.vnTextScrollInterval=t,clearInterval(p),h<0){if(this.isFinishedParsing(d))return void e.emit("finished");if("TextResult"===d.constructor.name)return r=d.text,h=0,e.emit("textResult",r),void this.changeTextScrollSpeed(220);"OptionsResult"===d.constructor.name&&-1===this.vnSelectedChoice&&(this.vnSelectedChoice=0,this.vnUpdateChoice(),this.startTimeWait=(new Date).getTime())}0!==t&&(p=setInterval(this.scrollUpdateText,t))}},self.goToNext=()=>{const e=c.next().value;if(!this.isFinishedParsing(e))return"TextResult"===e.constructor.name&&e.data&&this.node.title!==e.data.title&&(r="",h=-1,this.node=self.jsonCopy(e.data),this.visitedNodes.push(e.data.title),this.emiter.emit("startedNode",this.node)),e},this.isFinishedParsing=e=>(void 0===e||null===d)&&(n||(n=!0,h=-1),n=!0,n),this.runCommand=()=>{e.emit("commandCall",d.text),t.push(d.text),d=self.goToNext(),this.isFinishedParsing(d)||("TextResult"===d.constructor.name&&(r+="\n"+d.text,e.emit("textResult",d.text)),"OptionsResult"===d.constructor.name&&(h=-1))},this.scrollUpdateText=()=>{if(!this.isFinishedParsing(d))if(h<0)"CommandResult"===d.constructor.name&&this.runCommand();else if(h>r.length){if("TextResult"===d.constructor.name){if(d=self.goToNext(),this.isFinishedParsing(d))return;"CommandResult"===d.constructor.name?this.runCommand():("TextResult"===d.constructor.name||"OptionsResult"===d.constructor.name)&&(h=-1)}}else"TextResult"===d.constructor.name&&(h+=1,l=r.substring(0,h),self.updateVNHud())},self.updateVNHud=()=>{if("TextResult"===d.constructor.name){for(;l.lastIndexOf("[img]")>l.lastIndexOf("[/img]");)h+=1,l=r.substring(0,h);for(;l.lastIndexOf("[")>l.lastIndexOf("]");)h+=1,l=r.substring(0,h)}this.scrollTextStyle&&(document.getElementById(u).innerHTML=o.parse(l)+"
        "),void 0!==i&&(this.scrollTextStyle||(document.getElementById(u).innerHTML=""),document.getElementById(u).appendChild(i))},this.terminate=()=>{try{let t=document.getElementById(u);t&&(t.innerHTML=""),t=document.getElementById(g),t&&(t.innerHTML=""),i=void 0,e.removeAllListeners(),this.finished=!0}catch(e){console.warn(e)}},this.initYarn=(t,i,s,r,l,d,c)=>{const p=["#f5ff6f","#44fe66","#e00ec0","#e93ecf","#0ec0e0","#3ecfe9","#e4dbcb","#978e7e","#666","#2f919a","deeppink","black","#97E1E9","#576574","#6EA5E0","#9EDE74","#FFE374","#F7A666","#C47862"],h=["__̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡| ̲▫̲͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡, ̴̡ı̴̡̡ ̡͌l̡̡̡̡.___","°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸","(===||:::::::::::::::>","¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>","=^..^=","|==|iiii|>-----"," ¦̵̱ ̵̱ ̵̱ ̵̱ ̵̱(̢ ̡͇̅└͇̅┘͇̅ (▤8כ−◦","(♥_♥)","龴ↀ◡ↀ龴","☁ ▅▒░☼‿☼░▒▅ ☁,","▓⚗_⚗▓","<:3 )~~~","(╯°□°)╯︵ ┻━┻","●▬▬▬▬๑۩۩๑▬▬▬▬▬●","(/)(Ö,,,,Ö)(/)","/)^3^(\\","( . Y . )","< )))) ><","(ノಠ益ಠ)ノ彡","d(^o^)b¸¸♬·¯·♩¸¸♪·¯·♫¸¸","O=('-'Q)","-`ღ´-","ˁ(⦿ᴥ⦿)ˀ","(╥﹏╥)","✲´*。.❄¨¯`*✲。❄。*。¨¯`*✲","▂▃▅▇█▓▒░۩۞۩ ۩۞۩░▒▓█▇▅▃▂","( •_•)O*¯`·.¸.·´¯`°Q(•_• )","┻━┻︵ (°□°)/ ︵ ┻━┻","|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡ ̴̡ı̴̴̡ ̡l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ |","❤◦.¸¸. ◦✿","ʕʘ̅͜ʘ̅ʔ","( ๏ Y ๏ )","ʕ•̫͡•ʕ*̫͡*ʕ•͓͡•ʔ-̫͡-ʕ•̫͡•ʔ*̫͡*ʔ-̫͡-ʔ","(っ◕‿◕)っ","❚█══█❚","─=≡Σ((( つ◕ل͜◕)つ","^ↀᴥↀ^","༼ つ ͡◕ Ѿ ͡◕ ༽つ","ᕦ(ò_óˇ)ᕤ","┬┴┬┴┤ ͜ʖ ͡°) ├┬┴┬┴","[̲̅$̲̅(̲̅5)̲̅$̲̅]","(ꈍ⌓ꈍ✿)","(๑•́ ₃ •̀๑) ♡","( • )( • )ԅ(≖⌣≖ԅ)","(。々°)","⊂(´・◡・⊂ )∘˚˳°","( ㅅ )","(ノ☉ヮ⚆)ノ ⌒*:・゚✧","(-‸ლ)","(‿|‿)","(㇏(•̀ᵥᵥ•́)ノ)","ʚ✟⃛ɞ","(′ꈍωꈍ‵)","♚ ♛ ♜ ♝ ♞ ♟ ♔ ♕ ♖ ♗ ♘ ♙","(´ᴗ`)(´ᴗ`)","♥(´∀`)","ฅ(˵●ﻌ●˵)ฅ"];if(g=l,u=s,this.yarnDataObject=t,this.startChapter=i,this.resourcesPath=r,this.finished=!1,this.scrollTextStyle="npc"===d,document.getElementById(g).innerHTML="
        🚥Press/Hold Z or 📱Double-click/Tap to advance
        ",e.on("startedNode",(function(e){document.getElementById(g).innerHTML+="

        📜 --- Loaded next node ---",document.getElementById(g).innerHTML+=` ${h[Math.floor(Math.random()*h.length)]}`,document.getElementById(g).innerHTML+="
           Title: "+e.title+"",e.tags.length>0&&e.tags[0].length>0&&(document.getElementById(g).innerHTML+="
           Tags: "+e.tags+"")})),e.on("choiceMade",(function(e){this.scrollTextStyle?document.getElementById(g).innerHTML+="
        🐙Player chose: >"+e+"":document.getElementById(g).innerHTML+=`

        ${o.parse(e)}

        `})),e.on("commandCall",(function(e){document.getElementById(g).innerHTML+=`
        🐣Command call: <<${e}>>`})),this.scrollTextStyle||(e.on("textResult",(function(e){document.getElementById(g).innerHTML+=`

        ${o.parse(e)}

        `,document.getElementById(u).innerHTML='

        .

        .

        .

        ',document.getElementById(u).className="story-playtest-bubble",document.getElementById(g).scrollTo({top:document.getElementById(g).scrollHeight,left:0,behavior:"smooth"})})),e.on("choiceUpdated",(function(e){document.getElementById(u).className="story-playtest-answer"}))),e.on("finished",(function(){n=!0,e.removeAllListeners()})),Array.isArray(t))a.load(t);else{if(!("nodes"in t))return;a.load(t.nodes)}this.loadYarnChapter(i),a.variables.data={},c.forEach((function(e){console.log(e),a.variables.set(e.key,e.value)}))},this.loadYarnChapter=e=>{n=!1,this.storyChapter=e,this.choices[this.storyChapter]=[],this.visitedChapters.push(e),c=a.run(e),d=self.goToNext(),r=d.text,this.changeTextScrollSpeed(100)},this.wasChoiceMade=(e,t=this.storyChapter)=>!!this.choices[t].includes(e),this.timesNodeWasVisited=e=>{let t=0;return this.visitedNodes.forEach((n,i)=>{n===e&&(t+=1)}),t},self.jsonCopy=e=>JSON.parse(JSON.stringify(e))}},uMdg:function(e,t,n){},wt9v:function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="wt9v"},zn8O:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));var i=function({app:t,createButton:n,createToggle:i,onYarnEditorOpen:o,onYarnSetLanguage:a}){const s=this;this.name="Transcribe",this.transcribeEnabled=e.observable(!1),a(e=>{console.log(e),spoken.recognition.lang=e.language}),this.speakText=function(){const e=t.editor.getSelectedText(),n=e||t.editor.getSession().getValue();spoken.voices().then(e=>{const i=t.settings.language().split("-")[0],o=e.filter(e=>!e.lang.indexOf(i));console.log(i,o),o.length?(console.log("Loaded voice",o[0]),spoken.say(n,o[0])):spoken.say(n)})},this.startCapture=function(){spoken.listen({continuous:!0}).then(e=>{if(console.log(e),t.editing())t.insertTextAtCursor(e+". "),document.getElementById("speakTextBtnBubble").title="Transcribe";else if("open"===e){console.log("try open...");var n=t.getFirstFoundNode(t.$searchField.val().toLowerCase()).title();console.log("try open:",n),t.openNodeByTitle(n)}else"clear"===e?(t.$searchField.val(""),t.updateSearch()):(t.$searchField.val(e),t.updateSearch());spoken.listen.stop().then(()=>{t.editing()&&(document.getElementById("speakTextBtnBubble").style.visibility="hidden"),this.continueCapture()})}).catch(e=>spoken.listen.stop().then(()=>this.continueCapture()))},this.continueCapture=function(){spoken.delay(500).then(()=>{spoken.recognition.continuous&&t.startCapture()})},this.toggleTranscribing=function(){const e=spoken.listen.available(),n=document.getElementById("speakTextBtnBubble");null!==n&&(n.style.visibility="hidden",e&&s.transcribeEnabled()?(spoken.listen.on.partial(e=>{t.editing()?(n.style.visibility="visible",n.title=`🗣️ ${e} 🦜`):t.$searchField.val(`🗣️ ${e} 🦜`)}),t.startCapture()):(n.style.visibility="hidden",spoken.recognition.continuous=!1,spoken.listen.stop()))},this.hearText=function(){spoken.listen.available()?(spoken.listen.on.partial(e=>{console.log(e),document.getElementById("speakTextBtnBubble").title=`🗣️ ${e} 🦜`}),spoken.listen().then(e=>{t.insertTextAtCursor(e+" "),document.getElementById("speakTextBtnBubble").title="Transcribe"}).catch(e=>console.warn(e.message))):Swal.fire({title:"Speech recognition not available!",icon:"error"})},o(()=>{n(s.name,{id:"hearTextBtnId",title:"Hear text",attachTo:"bbcodeToolbar",onClick:"hearText()",iconName:"voice",className:"bbcode-button bbcode-button-right hide-when-narrow"}),i(s.name,{id:"transcribeToggleBtnId",iconName:"microphone",attachTo:"editorFooter",className:"transcribe-button",title:"Transcribe",tooltipId:"speakTextBtnBubble",toggleValueKey:"toggleTranscribing",onToggle:"toggleTranscribing",enableKey:"transcribeEnabled"}),s.toggleTranscribing()})}}).call(this,n("Z1dp"))}},[["e6Wu",1,2]]]); \ No newline at end of file diff --git a/js/runtime.9bf617ddccfee721ee25.js b/js/runtime.e335dd34512b0477f4ea.js similarity index 100% rename from js/runtime.9bf617ddccfee721ee25.js rename to js/runtime.e335dd34512b0477f4ea.js diff --git a/js/vendor.9bf617ddccfee721ee25.js b/js/vendor.e335dd34512b0477f4ea.js similarity index 100% rename from js/vendor.9bf617ddccfee721ee25.js rename to js/vendor.e335dd34512b0477f4ea.js diff --git a/public/plugins/jsoneditor/jsoneditor.js b/public/plugins/jsoneditor/jsoneditor.js new file mode 100644 index 000000000..466a9a9ea --- /dev/null +++ b/public/plugins/jsoneditor/jsoneditor.js @@ -0,0 +1,101 @@ +export var JSONEditor = function({id}) { + this.tableAdd = ({key, value}) =>{ + var $clone = this.table.find('tr.hide').clone(true).removeClass('hide table-line'); + if(key && value) { + console.log("mutate", {key, value, html:$clone.html()}) + $clone.html(` + ${key} + ${value} + + x delete + + `) + $('.table-remove').on("click",function() { + $(this).parents('tr').detach(); + }); + + } + this.table.find('table').append($clone); + } + this.getValue = () => { + var $rows = this.table.find('tr:not(:hidden)'); + var headers = []; + var data = []; + + // Get the headers (add special header logic here) + $($rows.shift()).find('th:not(:empty):not([data-attr-ignore])').each(function() { + headers.push($(this).text().toLowerCase()); + }); + + // Turn all existing rows into a loopable array + $rows.each(function() { + var $td = $(this).find('td'); + var h = {}; + // Use the headers from earlier to name our hash keys + headers.forEach(function(header, i) { + h[header] = $td.eq(i).text(); // will adapt for inputs if text is empty + }); + + data.push(h); + }); + // Output the result + // var $EXPORT = $('#save'); + // $EXPORT.text(JSON.stringify(data)); + return data;; + } + + this.init = () => { + document.getElementById(id).innerHTML = ` +
        +
        + + + + + + + + + + + + + + +
        KeyValueRemove
        keyval + x delete +
        + + +
        +
        + ` + var $TABLE = $('#table'); + var $BTN = $('#save-btn'); + this.table = $TABLE; + this.rows = $TABLE.find('tr:not(:hidden)'); + var $EXPORT = $('#save-btn'); + $EXPORT.addClass("hide"); + + $('.table-add').on("click", this.tableAdd); + + $('.table-remove').on("click",function() { + console.log({removeThis: this}) + $(this).parents('tr').detach(); + }); + + // A few jQuery helpers for exporting only + jQuery.fn.pop = [].pop; + jQuery.fn.shift = [].shift; + $BTN.on("click",this.getValue); + } + this.init(); + + this.setValue =(newValue = []) =>{ + newValue.forEach(this.tableAdd); + } +} \ No newline at end of file diff --git a/public/plugins/jsoneditor/size-overrides.css b/public/plugins/jsoneditor/size-overrides.css index 4cf1d1456..bc3b8fd05 100644 --- a/public/plugins/jsoneditor/size-overrides.css +++ b/public/plugins/jsoneditor/size-overrides.css @@ -1,9 +1,3 @@ -div.jsoneditor-tree { - min-height: 50vh; - max-height: 70vh; - overflow: auto; -} - @media only screen and (max-width: 600px) { .swal2-popup{ padding: 2px !important; @@ -25,11 +19,67 @@ div.jsoneditor-tree { /* max-width: 100px;*/ /*}*/ } -.form-control > input { - max-width: 100px; + +.table { + width: 100%; +} +.table-editable { + width: 100%; + position: relative; } -.je-table{ + +.table-header { + position: sticky; + top: 0; + background-color: #007; + color: aqua; +} + +.table-footer { + position: sticky; + bottom: 0; + background-color: #007; + color: aqua; display: flex; - justify-content: center; - flex-wrap: wrap; + justify-content: space-between; +} +.table-editable .glyphicon { + font-size: 20px; +} + +.table-remove { + color: #700; + cursor: pointer; + text-align: center; } + +.cell { + width: 180px; + max-width: 180px; + text-align: left; + padding-left: 3px; + padding-right: 3px; +} +.table-remove:hover { + color: #f00; +} + +.table-up:hover, +.table-down:hover { + color: #00f; +} + +.table-add { + width: 120px; + color: #070; + cursor: pointer; + text-align: center; +} + +.table-add:hover { + color: #0b0; +} + +.hide { + display: none; +} \ No newline at end of file diff --git a/public/plugins/runner.js b/public/plugins/runner.js index 4424d06e6..be0684b7b 100644 --- a/public/plugins/runner.js +++ b/public/plugins/runner.js @@ -1,6 +1,6 @@ import { yarnRender } from './bondage/renderer'; import { inkRender } from './inkjs/ink-renderer'; -const { JSONEditor } = require('./jsoneditor/jsoneditor.min'); +const { JSONEditor } = require('./jsoneditor/jsoneditor'); export var Runner = function({ app, @@ -30,32 +30,9 @@ export var Runner = function({ onOpen: () => { // create the editor require('./jsoneditor/size-overrides.css'); - editor = new JSONEditor(document.getElementById('jsoneditor'), { - // theme: 'bootstrap2', - schema: { - type: 'array', - format: 'table', - title: 'Playtest values', - uniqueItems: true, - items: { - type: 'object', - title: 'Variable', - format: 'grid', - properties: { - key: { - type: 'string', - default: 'myVar', - }, - value: { - type: 'string', - default: 'true', - }, - }, - }, - }, - }); + editor = new JSONEditor({id: 'jsoneditor'}); const localVariables = getPluginStore(self.name); - + console.log({editor}) // set json editor.setValue( typeof localVariables.variables !== 'object' diff --git a/sw.js b/sw.js index 9ae2cdee0..9fe3a8cfb 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -!function(e){var t={};function s(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(n,r,function(t){return e[t]}.bind(null,r));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s="jlOC")}({"5tLK":function(e,t,s){"use strict";try{self["workbox:routing:5.1.3"]&&_()}catch(e){}},Bxln:function(e,t,s){"use strict";try{self["workbox:core:5.1.3"]&&_()}catch(e){}},aqiC:function(e,t,s){"use strict";try{self["workbox:strategies:5.1.3"]&&_()}catch(e){}},jlOC:function(e,t,s){"use strict";s.r(t);s("xwD5");const n=[],r={get:()=>n,add(e){n.push(...e)}};s("Bxln");const o={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},c=e=>[o.prefix,e,o.suffix].filter(e=>e&&e.length>0).join("-"),i=e=>e||c(o.precache),a=e=>e||c(o.runtime),h=e=>new URL(String(e),location.href).href.replace(new RegExp("^"+location.origin),""),u=(e,...t)=>{let s=e;return t.length>0&&(s+=" :: "+JSON.stringify(t)),s};class l extends Error{constructor(e,t){super(u(e,t)),this.name=e,this.details=t}}const f=new Set;const d=(e,t)=>e.filter(e=>t in e),p=async({request:e,mode:t,plugins:s=[]})=>{const n=d(s,"cacheKeyWillBeUsed");let r=e;for(const e of n)r=await e.cacheKeyWillBeUsed.call(e,{mode:t,request:r}),"string"==typeof r&&(r=new Request(r));return r},g=async({cacheName:e,request:t,event:s,matchOptions:n,plugins:r=[]})=>{const o=await self.caches.open(e),c=await p({plugins:r,request:t,mode:"read"});let i=await o.match(c,n);for(const t of r)if("cachedResponseWillBeUsed"in t){const r=t.cachedResponseWillBeUsed;i=await r.call(t,{cacheName:e,event:s,matchOptions:n,cachedResponse:i,request:c})}return i},w=async({cacheName:e,request:t,response:s,event:n,plugins:r=[],matchOptions:o})=>{const c=await p({plugins:r,request:t,mode:"write"});if(!s)throw new l("cache-put-with-no-response",{url:h(c.url)});const i=await(async({request:e,response:t,event:s,plugins:n=[]})=>{let r=t,o=!1;for(const t of n)if("cacheWillUpdate"in t){o=!0;const n=t.cacheWillUpdate;if(r=await n.call(t,{request:e,response:r,event:s}),!r)break}return o||(r=r&&200===r.status?r:void 0),r||null})({event:n,plugins:r,response:s,request:c});if(!i)return void 0;const a=await self.caches.open(e),u=d(r,"cacheDidUpdate"),w=u.length>0?await g({cacheName:e,matchOptions:o,request:c}):null;try{await a.put(c,i)}catch(e){throw"QuotaExceededError"===e.name&&await async function(){for(const e of f)await e()}(),e}for(const t of u)await t.cacheDidUpdate.call(t,{cacheName:e,event:n,oldResponse:w,newResponse:i,request:c})},y=g,m=async({request:e,fetchOptions:t,event:s,plugins:n=[]})=>{if("string"==typeof e&&(e=new Request(e)),s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const r=d(n,"fetchDidFail"),o=r.length>0?e.clone():null;try{for(const t of n)if("requestWillFetch"in t){const n=t.requestWillFetch,r=e.clone();e=await n.call(t,{request:r,event:s})}}catch(e){throw new l("plugin-error-request-will-fetch",{thrownError:e})}const c=e.clone();try{let r;r="navigate"===e.mode?await fetch(e):await fetch(e,t);for(const e of n)"fetchDidSucceed"in e&&(r=await e.fetchDidSucceed.call(e,{event:s,request:c,response:r}));return r}catch(e){0;for(const t of r)await t.fetchDidFail.call(t,{error:e,event:s,originalRequest:o.clone(),request:c.clone()});throw e}};let _;async function v(e,t){const s=e.clone(),n={headers:new Headers(s.headers),status:s.status,statusText:s.statusText},r=t?t(n):n,o=function(){if(void 0===_){const e=new Response("");if("body"in e)try{new Response(e.body),_=!0}catch(e){_=!1}_=!1}return _}()?s.body:await s.blob();return new Response(o,r)}function R(e){if(!e)throw new l("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:t,url:s}=e;if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:e});if(!t){const e=new URL(s,location.href);return{cacheKey:e.href,url:e.href}}const n=new URL(s,location.href),r=new URL(s,location.href);return n.searchParams.set("__WB_REVISION__",t),{cacheKey:n.href,url:r.href}}class q{constructor(e){this._cacheName=i(e),this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map}addToCacheList(e){const t=[];for(const s of e){"string"==typeof s?t.push(s):s&&void 0===s.revision&&t.push(s.url);const{cacheKey:e,url:n}=R(s),r="string"!=typeof s&&s.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==e)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:e});if("string"!=typeof s&&s.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==s.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(e,s.integrity)}if(this._urlsToCacheKeys.set(n,e),this._urlsToCacheModes.set(n,r),t.length>0){const e=`Workbox is precaching URLs without revision info: ${t.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}async install({event:e,plugins:t}={}){const s=[],n=[],r=await self.caches.open(this._cacheName),o=await r.keys(),c=new Set(o.map(e=>e.url));for(const[e,t]of this._urlsToCacheKeys)c.has(t)?n.push(e):s.push({cacheKey:t,url:e});const i=s.map(({cacheKey:s,url:n})=>{const r=this._cacheKeysToIntegrities.get(s),o=this._urlsToCacheModes.get(n);return this._addURLToCache({cacheKey:s,cacheMode:o,event:e,integrity:r,plugins:t,url:n})});return await Promise.all(i),{updatedURLs:s.map(e=>e.url),notUpdatedURLs:n}}async activate(){const e=await self.caches.open(this._cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),n=[];for(const r of t)s.has(r.url)||(await e.delete(r),n.push(r.url));return{deletedURLs:n}}async _addURLToCache({cacheKey:e,url:t,cacheMode:s,event:n,plugins:r,integrity:o}){const c=new Request(t,{integrity:o,cache:s,credentials:"same-origin"});let i,a=await m({event:n,plugins:r,request:c});for(const e of r||[])"cacheWillUpdate"in e&&(i=e);if(!(i?await i.cacheWillUpdate({event:n,request:c,response:a}):a.status<400))throw new l("bad-precaching-response",{url:t,status:a.status});a.redirected&&(a=await v(a)),await w({event:n,plugins:r,response:a,request:e===t?c:new Request(e),cacheName:this._cacheName,matchOptions:{ignoreSearch:!0}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this._cacheName)).match(s)}}createHandler(e=!0){return async({request:t})=>{try{const e=await this.matchPrecache(t);if(e)return e;throw new l("missing-precache-entry",{cacheName:this._cacheName,url:t instanceof Request?t.url:t})}catch(s){if(e)return fetch(t);throw s}}}createHandlerBoundToURL(e,t=!0){if(!this.getCacheKeyForURL(e))throw new l("non-precached-url",{url:e});const s=this.createHandler(t),n=new Request(e);return()=>s({request:n})}}let U;const L=()=>(U||(U=new q),U);const T=(e,t)=>{const s=L().getURLsToCacheKeys();for(const n of function*(e,{ignoreURLParametersMatching:t,directoryIndex:s,cleanURLs:n,urlManipulation:r}={}){const o=new URL(e,location.href);o.hash="",yield o.href;const c=function(e,t=[]){for(const s of[...e.searchParams.keys()])t.some(e=>e.test(s))&&e.searchParams.delete(s);return e}(o,t);if(yield c.href,s&&c.pathname.endsWith("/")){const e=new URL(c.href);e.pathname+=s,yield e.href}if(n){const e=new URL(c.href);e.pathname+=".html",yield e.href}if(r){const e=r({url:o});for(const t of e)yield t.href}}(e,t)){const e=s.get(n);if(e)return e}};let C=!1;function x(e){C||((({ignoreURLParametersMatching:e=[/^utm_/],directoryIndex:t="index.html",cleanURLs:s=!0,urlManipulation:n}={})=>{const r=i();self.addEventListener("fetch",o=>{const c=T(o.request.url,{cleanURLs:s,directoryIndex:t,ignoreURLParametersMatching:e,urlManipulation:n});if(!c)return void 0;let i=self.caches.open(r).then(e=>e.match(c)).then(e=>e||fetch(c));o.respondWith(i)})})(e),C=!0)}const b=e=>{const t=L(),s=r.get();e.waitUntil(t.install({event:e,plugins:s}).catch(e=>{throw e}))},K=e=>{const t=L();e.waitUntil(t.activate())};s("aqiC");const O={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};s("5tLK");const N=e=>e&&"object"==typeof e?e:{handle:e};class M{constructor(e,t,s="GET"){this.handler=N(t),this.match=e,this.method=s}}class P extends M{constructor(e,t,s){super(({url:t})=>{const s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)},t,s)}}class k{constructor(){this._routes=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const s=Promise.all(t.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const t=new Request(...e);return this.handleRequest({request:t})}));e.waitUntil(s),e.ports&&e.ports[0]&&s.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return void 0;const{params:n,route:r}=this.findMatchingRoute({url:s,request:e,event:t});let o=r&&r.handler;if(!o&&this._defaultHandler&&(o=this._defaultHandler),!o)return void 0;let c;try{c=o.handle({url:s,request:e,event:t,params:n})}catch(e){c=Promise.reject(e)}return c instanceof Promise&&this._catchHandler&&(c=c.catch(n=>this._catchHandler.handle({url:s,request:e,event:t}))),c}findMatchingRoute({url:e,request:t,event:s}){const n=this._routes.get(t.method)||[];for(const r of n){let n;const o=r.match({url:e,request:t,event:s});if(o)return n=o,(Array.isArray(o)&&0===o.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(n=void 0),{route:r,params:n}}return{}}setDefaultHandler(e){this._defaultHandler=N(e)}setCatchHandler(e){this._catchHandler=N(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new l("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)}}let S;const W=()=>(S||(S=new k,S.addFetchListener(),S.addCacheListener()),S);var E;console.log("Yarn's service worker is caching files"),function(e,t,s){let n;if("string"==typeof e){const r=new URL(e,location.href);0,n=new M(({url:e})=>e.href===r.href,t,s)}else if(e instanceof RegExp)n=new P(e,t,s);else if("function"==typeof e)n=new M(e,t,s);else{if(!(e instanceof M))throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=e}W().registerRoute(n)}(/\.\/YarnClassic\//,new class{constructor(e={}){if(this._cacheName=a(e.cacheName),e.plugins){const t=e.plugins.some(e=>!!e.cacheWillUpdate);this._plugins=t?e.plugins:[O,...e.plugins]}else this._plugins=[O];this._networkTimeoutSeconds=e.networkTimeoutSeconds||0,this._fetchOptions=e.fetchOptions,this._matchOptions=e.matchOptions}async handle({event:e,request:t}){const s=[];"string"==typeof t&&(t=new Request(t));const n=[];let r;if(this._networkTimeoutSeconds){const{id:o,promise:c}=this._getTimeoutPromise({request:t,event:e,logs:s});r=o,n.push(c)}const o=this._getNetworkPromise({timeoutId:r,request:t,event:e,logs:s});n.push(o);let c=await Promise.race(n);if(c||(c=await o),!c)throw new l("no-response",{url:t.url});return c}_getTimeoutPromise({request:e,logs:t,event:s}){let n;return{promise:new Promise(t=>{n=setTimeout(async()=>{t(await this._respondFromCache({request:e,event:s}))},1e3*this._networkTimeoutSeconds)}),id:n}}async _getNetworkPromise({timeoutId:e,request:t,logs:s,event:n}){let r,o;try{o=await m({request:t,event:n,fetchOptions:this._fetchOptions,plugins:this._plugins})}catch(e){r=e}if(e&&clearTimeout(e),r||!o)o=await this._respondFromCache({request:t,event:n});else{const e=o.clone(),s=w({cacheName:this._cacheName,request:t,response:e,event:n,plugins:this._plugins});if(n)try{n.waitUntil(s)}catch(e){0}}return o}_respondFromCache({event:e,request:t}){return y({cacheName:this._cacheName,request:t,event:e,matchOptions:this._matchOptions,plugins:this._plugins})}}),function(e){L().addToCacheList(e),e.length>0&&(self.addEventListener("install",b),self.addEventListener("activate",K))}([{'revision':'79454eda006618e99bb8b2de5cfb641b','url':'css/0.css'},{'revision':'cc26e986ac53238679cef6af5cbc5104','url':'fonts/context-menu-icons.eot'},{'revision':'66fe7d78e602880e529daf66c8cb85d3','url':'fonts/context-menu-icons.ttf'},{'revision':'4568f559933f6b3db786835cf61387b1','url':'fonts/context-menu-icons.woff'},{'revision':'3124260e1569c74431e23dd130111455','url':'fonts/context-menu-icons.woff2'},{'revision':'a267c0b23e4794a4d9f2092027ab0fc7','url':'fonts/droid-sans-mono.ttf'},{'revision':'0158a98eda5da93408305a8f817bd61e','url':'icon.ico'},{'revision':'54a04953b96717b70ace1f2bcae537c1','url':'icon_128x128.png'},{'revision':'bd585463236696d22e72c822e9e2c36e','url':'icon_192x192.png'},{'revision':'0158a98eda5da93408305a8f817bd61e','url':'icon_32x32.ico'},{'revision':'41a610c236dfc4ca3db11af9f1d1efd1','url':'icon_512x512.png'},{'revision':'4f50d85588e2e334596e0bcc71892e42','url':'icon_96x96.png'},{'revision':'08cc4e058bc65af2f7e50ddcec36a147','url':'index.html'},{'revision':'18a7e20d667348dde2baba76ebc93267','url':'js/main.9bf617ddccfee721ee25.js'},{'revision':'bac88d544bdbbe5a66ee018b2815af84','url':'js/runtime.9bf617ddccfee721ee25.js'},{'revision':'b9038b5e20d64a47cf6e8843150f3856','url':'manifest.json'},{'revision':'a267c0b23e4794a4d9f2092027ab0fc7','url':'public/droid-sans-mono.ttf'},{'revision':'0158a98eda5da93408305a8f817bd61e','url':'public/icon.ico'},{'revision':'73d45685f29fa05223dbb6cf7fb57097','url':'public/icon.png'},{'revision':'a6b5dbbf657b6b6bac1067ae1d3d4342','url':'public/icons.svg'},{'revision':'51e2de798b41db26b6a0ec187959d394','url':'public/images/dropbox.ico'},{'revision':'6c62f589f84498c29d24fb22633146a0','url':'public/images/inky-icon.png'},{'revision':'85f678b520893f6007833e0ae0a1f106','url':'public/images/pixel.png'},{'revision':'167ec6047e43038e9209db69a24ba97b','url':'public/images/renpy-128.png'},{'revision':'83e847f2aeb1d4f8f7f05cbb6be593c8','url':'public/images/twine-favicon-152.png'},{'revision':'80ef50c5d35ad4208def42493ef88153','url':'public/mode-ink.js'},{'revision':'7b22b65964ff8eb66dda7e1ee0f2c09e','url':'public/mode-yarn.js'},{'revision':'c9f414bca468fcb950fec09ccfaf2cf4','url':'public/plugins/bondage/renderer.js'},{'revision':'2490d7a5610e446d442b27b881457b7f','url':'public/plugins/index.js'},{'revision':'ac463da67318e812aa482c83d97e0f71','url':'public/plugins/inkjs/ink-renderer.js'},{'revision':'9ed8d74c2b19c786765517d3216d1be9','url':'public/plugins/jsoneditor/jsoneditor.min.js'},{'revision':'11c92b7ecb2fca6cd6fb1ba72290c191','url':'public/plugins/jsoneditor/size-overrides.css'},{'revision':'48c6dd9eec780d7498b1aa5941e18047','url':'public/plugins/runner.js'},{'revision':'2144b055ba41a7d38df1470e74ee42c1','url':'public/plugins/transcribe.js'},{'revision':'df3a64e933f73f88115992eedc6c80a6','url':'public/templates/node.html'},{'revision':'7174b16ad3a29e6059f0a0cd448f70df','url':'public/theme-ink.js'},{'revision':'2fe43fbb7c796eddba021471ef0262ea','url':'public/theme-yarn.js'},{'revision':'29861db0837e9e12ca7f8bc4c817fc19','url':'public/themes/blueprint.css'},{'revision':'5d979276428e7e5bf92a2f6699feb32e','url':'public/themes/classic.css'},{'revision':'c663316992808bbc41b57346d2d7bcf0','url':'public/themes/dracula.css'},{'revision':'de405ab3f613f5c1300291a0e43d15f1','url':'public/version.json'}]),x(E)},xwD5:function(e,t,s){"use strict";try{self["workbox:precaching:5.1.3"]&&_()}catch(e){}}}); \ No newline at end of file +!function(e){var t={};function s(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(n,r,function(t){return e[t]}.bind(null,r));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s="jlOC")}({"5tLK":function(e,t,s){"use strict";try{self["workbox:routing:5.1.3"]&&_()}catch(e){}},Bxln:function(e,t,s){"use strict";try{self["workbox:core:5.1.3"]&&_()}catch(e){}},aqiC:function(e,t,s){"use strict";try{self["workbox:strategies:5.1.3"]&&_()}catch(e){}},jlOC:function(e,t,s){"use strict";s.r(t);s("xwD5");const n=[],r={get:()=>n,add(e){n.push(...e)}};s("Bxln");const o={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},c=e=>[o.prefix,e,o.suffix].filter(e=>e&&e.length>0).join("-"),i=e=>e||c(o.precache),a=e=>e||c(o.runtime),h=e=>new URL(String(e),location.href).href.replace(new RegExp("^"+location.origin),""),u=(e,...t)=>{let s=e;return t.length>0&&(s+=" :: "+JSON.stringify(t)),s};class l extends Error{constructor(e,t){super(u(e,t)),this.name=e,this.details=t}}const f=new Set;const d=(e,t)=>e.filter(e=>t in e),p=async({request:e,mode:t,plugins:s=[]})=>{const n=d(s,"cacheKeyWillBeUsed");let r=e;for(const e of n)r=await e.cacheKeyWillBeUsed.call(e,{mode:t,request:r}),"string"==typeof r&&(r=new Request(r));return r},g=async({cacheName:e,request:t,event:s,matchOptions:n,plugins:r=[]})=>{const o=await self.caches.open(e),c=await p({plugins:r,request:t,mode:"read"});let i=await o.match(c,n);for(const t of r)if("cachedResponseWillBeUsed"in t){const r=t.cachedResponseWillBeUsed;i=await r.call(t,{cacheName:e,event:s,matchOptions:n,cachedResponse:i,request:c})}return i},w=async({cacheName:e,request:t,response:s,event:n,plugins:r=[],matchOptions:o})=>{const c=await p({plugins:r,request:t,mode:"write"});if(!s)throw new l("cache-put-with-no-response",{url:h(c.url)});const i=await(async({request:e,response:t,event:s,plugins:n=[]})=>{let r=t,o=!1;for(const t of n)if("cacheWillUpdate"in t){o=!0;const n=t.cacheWillUpdate;if(r=await n.call(t,{request:e,response:r,event:s}),!r)break}return o||(r=r&&200===r.status?r:void 0),r||null})({event:n,plugins:r,response:s,request:c});if(!i)return void 0;const a=await self.caches.open(e),u=d(r,"cacheDidUpdate"),w=u.length>0?await g({cacheName:e,matchOptions:o,request:c}):null;try{await a.put(c,i)}catch(e){throw"QuotaExceededError"===e.name&&await async function(){for(const e of f)await e()}(),e}for(const t of u)await t.cacheDidUpdate.call(t,{cacheName:e,event:n,oldResponse:w,newResponse:i,request:c})},y=g,m=async({request:e,fetchOptions:t,event:s,plugins:n=[]})=>{if("string"==typeof e&&(e=new Request(e)),s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const r=d(n,"fetchDidFail"),o=r.length>0?e.clone():null;try{for(const t of n)if("requestWillFetch"in t){const n=t.requestWillFetch,r=e.clone();e=await n.call(t,{request:r,event:s})}}catch(e){throw new l("plugin-error-request-will-fetch",{thrownError:e})}const c=e.clone();try{let r;r="navigate"===e.mode?await fetch(e):await fetch(e,t);for(const e of n)"fetchDidSucceed"in e&&(r=await e.fetchDidSucceed.call(e,{event:s,request:c,response:r}));return r}catch(e){0;for(const t of r)await t.fetchDidFail.call(t,{error:e,event:s,originalRequest:o.clone(),request:c.clone()});throw e}};let _;async function v(e,t){const s=e.clone(),n={headers:new Headers(s.headers),status:s.status,statusText:s.statusText},r=t?t(n):n,o=function(){if(void 0===_){const e=new Response("");if("body"in e)try{new Response(e.body),_=!0}catch(e){_=!1}_=!1}return _}()?s.body:await s.blob();return new Response(o,r)}function R(e){if(!e)throw new l("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:t,url:s}=e;if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:e});if(!t){const e=new URL(s,location.href);return{cacheKey:e.href,url:e.href}}const n=new URL(s,location.href),r=new URL(s,location.href);return n.searchParams.set("__WB_REVISION__",t),{cacheKey:n.href,url:r.href}}class q{constructor(e){this._cacheName=i(e),this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map}addToCacheList(e){const t=[];for(const s of e){"string"==typeof s?t.push(s):s&&void 0===s.revision&&t.push(s.url);const{cacheKey:e,url:n}=R(s),r="string"!=typeof s&&s.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==e)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:e});if("string"!=typeof s&&s.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==s.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(e,s.integrity)}if(this._urlsToCacheKeys.set(n,e),this._urlsToCacheModes.set(n,r),t.length>0){const e=`Workbox is precaching URLs without revision info: ${t.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}async install({event:e,plugins:t}={}){const s=[],n=[],r=await self.caches.open(this._cacheName),o=await r.keys(),c=new Set(o.map(e=>e.url));for(const[e,t]of this._urlsToCacheKeys)c.has(t)?n.push(e):s.push({cacheKey:t,url:e});const i=s.map(({cacheKey:s,url:n})=>{const r=this._cacheKeysToIntegrities.get(s),o=this._urlsToCacheModes.get(n);return this._addURLToCache({cacheKey:s,cacheMode:o,event:e,integrity:r,plugins:t,url:n})});return await Promise.all(i),{updatedURLs:s.map(e=>e.url),notUpdatedURLs:n}}async activate(){const e=await self.caches.open(this._cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),n=[];for(const r of t)s.has(r.url)||(await e.delete(r),n.push(r.url));return{deletedURLs:n}}async _addURLToCache({cacheKey:e,url:t,cacheMode:s,event:n,plugins:r,integrity:o}){const c=new Request(t,{integrity:o,cache:s,credentials:"same-origin"});let i,a=await m({event:n,plugins:r,request:c});for(const e of r||[])"cacheWillUpdate"in e&&(i=e);if(!(i?await i.cacheWillUpdate({event:n,request:c,response:a}):a.status<400))throw new l("bad-precaching-response",{url:t,status:a.status});a.redirected&&(a=await v(a)),await w({event:n,plugins:r,response:a,request:e===t?c:new Request(e),cacheName:this._cacheName,matchOptions:{ignoreSearch:!0}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this._cacheName)).match(s)}}createHandler(e=!0){return async({request:t})=>{try{const e=await this.matchPrecache(t);if(e)return e;throw new l("missing-precache-entry",{cacheName:this._cacheName,url:t instanceof Request?t.url:t})}catch(s){if(e)return fetch(t);throw s}}}createHandlerBoundToURL(e,t=!0){if(!this.getCacheKeyForURL(e))throw new l("non-precached-url",{url:e});const s=this.createHandler(t),n=new Request(e);return()=>s({request:n})}}let U;const L=()=>(U||(U=new q),U);const T=(e,t)=>{const s=L().getURLsToCacheKeys();for(const n of function*(e,{ignoreURLParametersMatching:t,directoryIndex:s,cleanURLs:n,urlManipulation:r}={}){const o=new URL(e,location.href);o.hash="",yield o.href;const c=function(e,t=[]){for(const s of[...e.searchParams.keys()])t.some(e=>e.test(s))&&e.searchParams.delete(s);return e}(o,t);if(yield c.href,s&&c.pathname.endsWith("/")){const e=new URL(c.href);e.pathname+=s,yield e.href}if(n){const e=new URL(c.href);e.pathname+=".html",yield e.href}if(r){const e=r({url:o});for(const t of e)yield t.href}}(e,t)){const e=s.get(n);if(e)return e}};let C=!1;function x(e){C||((({ignoreURLParametersMatching:e=[/^utm_/],directoryIndex:t="index.html",cleanURLs:s=!0,urlManipulation:n}={})=>{const r=i();self.addEventListener("fetch",o=>{const c=T(o.request.url,{cleanURLs:s,directoryIndex:t,ignoreURLParametersMatching:e,urlManipulation:n});if(!c)return void 0;let i=self.caches.open(r).then(e=>e.match(c)).then(e=>e||fetch(c));o.respondWith(i)})})(e),C=!0)}const b=e=>{const t=L(),s=r.get();e.waitUntil(t.install({event:e,plugins:s}).catch(e=>{throw e}))},K=e=>{const t=L();e.waitUntil(t.activate())};s("aqiC");const O={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};s("5tLK");const N=e=>e&&"object"==typeof e?e:{handle:e};class M{constructor(e,t,s="GET"){this.handler=N(t),this.match=e,this.method=s}}class P extends M{constructor(e,t,s){super(({url:t})=>{const s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)},t,s)}}class k{constructor(){this._routes=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const s=Promise.all(t.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const t=new Request(...e);return this.handleRequest({request:t})}));e.waitUntil(s),e.ports&&e.ports[0]&&s.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return void 0;const{params:n,route:r}=this.findMatchingRoute({url:s,request:e,event:t});let o=r&&r.handler;if(!o&&this._defaultHandler&&(o=this._defaultHandler),!o)return void 0;let c;try{c=o.handle({url:s,request:e,event:t,params:n})}catch(e){c=Promise.reject(e)}return c instanceof Promise&&this._catchHandler&&(c=c.catch(n=>this._catchHandler.handle({url:s,request:e,event:t}))),c}findMatchingRoute({url:e,request:t,event:s}){const n=this._routes.get(t.method)||[];for(const r of n){let n;const o=r.match({url:e,request:t,event:s});if(o)return n=o,(Array.isArray(o)&&0===o.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(n=void 0),{route:r,params:n}}return{}}setDefaultHandler(e){this._defaultHandler=N(e)}setCatchHandler(e){this._catchHandler=N(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new l("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)}}let S;const W=()=>(S||(S=new k,S.addFetchListener(),S.addCacheListener()),S);var E;console.log("Yarn's service worker is caching files"),function(e,t,s){let n;if("string"==typeof e){const r=new URL(e,location.href);0,n=new M(({url:e})=>e.href===r.href,t,s)}else if(e instanceof RegExp)n=new P(e,t,s);else if("function"==typeof e)n=new M(e,t,s);else{if(!(e instanceof M))throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=e}W().registerRoute(n)}(/\.\/YarnClassic\//,new class{constructor(e={}){if(this._cacheName=a(e.cacheName),e.plugins){const t=e.plugins.some(e=>!!e.cacheWillUpdate);this._plugins=t?e.plugins:[O,...e.plugins]}else this._plugins=[O];this._networkTimeoutSeconds=e.networkTimeoutSeconds||0,this._fetchOptions=e.fetchOptions,this._matchOptions=e.matchOptions}async handle({event:e,request:t}){const s=[];"string"==typeof t&&(t=new Request(t));const n=[];let r;if(this._networkTimeoutSeconds){const{id:o,promise:c}=this._getTimeoutPromise({request:t,event:e,logs:s});r=o,n.push(c)}const o=this._getNetworkPromise({timeoutId:r,request:t,event:e,logs:s});n.push(o);let c=await Promise.race(n);if(c||(c=await o),!c)throw new l("no-response",{url:t.url});return c}_getTimeoutPromise({request:e,logs:t,event:s}){let n;return{promise:new Promise(t=>{n=setTimeout(async()=>{t(await this._respondFromCache({request:e,event:s}))},1e3*this._networkTimeoutSeconds)}),id:n}}async _getNetworkPromise({timeoutId:e,request:t,logs:s,event:n}){let r,o;try{o=await m({request:t,event:n,fetchOptions:this._fetchOptions,plugins:this._plugins})}catch(e){r=e}if(e&&clearTimeout(e),r||!o)o=await this._respondFromCache({request:t,event:n});else{const e=o.clone(),s=w({cacheName:this._cacheName,request:t,response:e,event:n,plugins:this._plugins});if(n)try{n.waitUntil(s)}catch(e){0}}return o}_respondFromCache({event:e,request:t}){return y({cacheName:this._cacheName,request:t,event:e,matchOptions:this._matchOptions,plugins:this._plugins})}}),function(e){L().addToCacheList(e),e.length>0&&(self.addEventListener("install",b),self.addEventListener("activate",K))}([{'revision':'8910a1ad45d957d12833d0ea1746cf87','url':'css/0.css'},{'revision':'cc26e986ac53238679cef6af5cbc5104','url':'fonts/context-menu-icons.eot'},{'revision':'66fe7d78e602880e529daf66c8cb85d3','url':'fonts/context-menu-icons.ttf'},{'revision':'4568f559933f6b3db786835cf61387b1','url':'fonts/context-menu-icons.woff'},{'revision':'3124260e1569c74431e23dd130111455','url':'fonts/context-menu-icons.woff2'},{'revision':'a267c0b23e4794a4d9f2092027ab0fc7','url':'fonts/droid-sans-mono.ttf'},{'revision':'0158a98eda5da93408305a8f817bd61e','url':'icon.ico'},{'revision':'54a04953b96717b70ace1f2bcae537c1','url':'icon_128x128.png'},{'revision':'bd585463236696d22e72c822e9e2c36e','url':'icon_192x192.png'},{'revision':'0158a98eda5da93408305a8f817bd61e','url':'icon_32x32.ico'},{'revision':'41a610c236dfc4ca3db11af9f1d1efd1','url':'icon_512x512.png'},{'revision':'4f50d85588e2e334596e0bcc71892e42','url':'icon_96x96.png'},{'revision':'91991a122417ee4f52f7ac385f64d02c','url':'index.html'},{'revision':'a769ed67e8737a46e3fde5ccd829dce7','url':'js/main.e335dd34512b0477f4ea.js'},{'revision':'bac88d544bdbbe5a66ee018b2815af84','url':'js/runtime.e335dd34512b0477f4ea.js'},{'revision':'b9038b5e20d64a47cf6e8843150f3856','url':'manifest.json'},{'revision':'a267c0b23e4794a4d9f2092027ab0fc7','url':'public/droid-sans-mono.ttf'},{'revision':'0158a98eda5da93408305a8f817bd61e','url':'public/icon.ico'},{'revision':'73d45685f29fa05223dbb6cf7fb57097','url':'public/icon.png'},{'revision':'a6b5dbbf657b6b6bac1067ae1d3d4342','url':'public/icons.svg'},{'revision':'51e2de798b41db26b6a0ec187959d394','url':'public/images/dropbox.ico'},{'revision':'6c62f589f84498c29d24fb22633146a0','url':'public/images/inky-icon.png'},{'revision':'85f678b520893f6007833e0ae0a1f106','url':'public/images/pixel.png'},{'revision':'167ec6047e43038e9209db69a24ba97b','url':'public/images/renpy-128.png'},{'revision':'83e847f2aeb1d4f8f7f05cbb6be593c8','url':'public/images/twine-favicon-152.png'},{'revision':'80ef50c5d35ad4208def42493ef88153','url':'public/mode-ink.js'},{'revision':'7b22b65964ff8eb66dda7e1ee0f2c09e','url':'public/mode-yarn.js'},{'revision':'c9f414bca468fcb950fec09ccfaf2cf4','url':'public/plugins/bondage/renderer.js'},{'revision':'2490d7a5610e446d442b27b881457b7f','url':'public/plugins/index.js'},{'revision':'ac463da67318e812aa482c83d97e0f71','url':'public/plugins/inkjs/ink-renderer.js'},{'revision':'06a19bf308e7c0bca5ff043b8c6dcd17','url':'public/plugins/jsoneditor/jsoneditor.js'},{'revision':'9ed8d74c2b19c786765517d3216d1be9','url':'public/plugins/jsoneditor/jsoneditor.min.js'},{'revision':'31583e2c2d32d27701df21fee914c6a3','url':'public/plugins/jsoneditor/size-overrides.css'},{'revision':'72b2ef966edee9e2f1ff79cfc9cee6b7','url':'public/plugins/runner.js'},{'revision':'2144b055ba41a7d38df1470e74ee42c1','url':'public/plugins/transcribe.js'},{'revision':'df3a64e933f73f88115992eedc6c80a6','url':'public/templates/node.html'},{'revision':'7174b16ad3a29e6059f0a0cd448f70df','url':'public/theme-ink.js'},{'revision':'2fe43fbb7c796eddba021471ef0262ea','url':'public/theme-yarn.js'},{'revision':'29861db0837e9e12ca7f8bc4c817fc19','url':'public/themes/blueprint.css'},{'revision':'5d979276428e7e5bf92a2f6699feb32e','url':'public/themes/classic.css'},{'revision':'c663316992808bbc41b57346d2d7bcf0','url':'public/themes/dracula.css'},{'revision':'de405ab3f613f5c1300291a0e43d15f1','url':'public/version.json'}]),x(E)},xwD5:function(e,t,s){"use strict";try{self["workbox:precaching:5.1.3"]&&_()}catch(e){}}}); \ No newline at end of file