narrat 2.0.9 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/narrat.es.js +10 -18
- package/dist/narrat.es.js.map +1 -1
- package/dist/narrat.umd.js +22 -22
- package/dist/narrat.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/narrat.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var qG=Object.defineProperty;var VG=(sn,P,Dr)=>P in sn?qG(sn,P,{enumerable:!0,configurable:!0,writable:!0,value:Dr}):sn[P]=Dr;var Go=(sn,P,Dr)=>(VG(sn,typeof P!="symbol"?P+"":P,Dr),Dr);var __vite_style__=document.createElement("style");__vite_style__.innerHTML=`/*! @import *//*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com */*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.gap-4{gap:1rem}.border{border-width:1px}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.italic{font-style:italic}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--font-family: "Helvetica", sans-serif, "Arial", "sans-serif";--bg-color: #131720;--text-color: #d9e1f2;--primary: hsl(255, 30%, 55%);--focus: hsl(210, 90%, 50%);--secondary: #42b983;--border-color: hsla(0, 0%, 100%, .2);--light-1: hsl(210, 30%, 40%);--light-2: hsl(255, 30%, 50%);--light-background: linear-gradient(to right, var(--light-1), var(--light-2));--shadow-1: hsla(236, 50%, 50%, .3);--shadow-2: hsla(236, 50%, 50%, .4);--hud-background: rgba(0, 0, 0, .4);--hud-text-color: var(--text-color);--notifications-bg: darkslateblue;--skills-text-background: rgba(0, 0, 0, .5);--skills-text-color: var(--text-color);--skills-level-background: rgba(0, 0, 0, .5);--skills-level-color: orange;--skills-xp-bar-height: 40px;--skill-check-name-color: orange;--skill-check-difficulty: orange;--skill-check-success: green;--skill-check-failed: red;--skill-check-color: orange;--dialog-choice-color: orange;--dialog-choice-hover-color: var(--text-color);--inventory-text-background: rgba(0, 0, 0, .5);--inventory-text-color: var(--text-color);--inventory-amount-background: rgba(0, 0, 0, .5);--inventory-amount-color: orange;--quest-title-color: yellow;--completed-quest-title-color: grey;--objective-in-progress-color: white;--objective-completed-color: grey}body,*{font-family:var(--font-family)}.list-item{display:inline-block;margin-right:10px}.list-enter-active,.list-leave-active{transition:all .3s ease}#app{background-size:cover}.list-enter-from,.list-leave-to{opacity:0;transform:translate(300px)}.notification-item{display:inline-block;margin-right:10px}.notification-enter-active,.notification-leave-active{transition:all .3s ease}.notification-enter-from,.notification-leave-to{opacity:0;transform:translateY(-300px)}.fade-enter-active,.fade-leave-active{transition:opacity .3s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-in-enter-active{transition:opacity .1s ease}.fade-in-enter-from{opacity:0}body{padding:0;margin:0;font-family:Arial,sans-serif;background-color:#000}.select{background:var(--light-background);padding:10px}.option{background-color:var(--light-2);padding:5px;color:var(--text-color)}.button{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .5rem 2.4rem .2rem var(--shadow-1),inset -2px -4px #0006,inset 2px 2px #fff7;border-radius:10px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s;box-shadow:inset -2px -4px #0006,inset 2px 2px #fff7}.button.large{border-radius:20px}.menu-button{border-radius:5px}.button.main-menu-button{border-radius:20px}.button:focus,.button:hover{transform:translateY(-.2rem);box-shadow:0 0 1rem .2rem var(--shadow-2),inset -2px -4px #0006,inset 2px 2px #fff7}.disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.button.disabled{box-shadow:unset;color:gray;background:var(--border-color)}.input{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .4rem 2.4rem .2rem var(--shadow-1);border-radius:100px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s}.input:focus,.input:hover{transform:translateY(-.2rem);box-shadow:0 0 2.4rem .2rem var(--shadow-2)}a{color:pink;text-decoration:underline}th,td{padding:4px;border:1px solid var(--text-color);text-align:center}#game-holder{width:100vw;height:100vh;padding:0;margin:0;top:0;left:0;background-color:#000;display:flex;align-items:center;justify-content:center;min-height:-webkit-fill-available}.title{font-size:30px;font-weight:700;text-align:center}.container{padding:20px}h1,h2,h3,h4{font-weight:700}h1{font-size:30px}h2{font-size:26px}h3{font-size:24px}hr.solid{border:1px solid var(--text-color);margin-top:30px;margin-bottom:30px}.card-1{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;transition:all .3s cubic-bezier(.25,.8,.25,1)}.card-1:hover{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-2{box-shadow:0 3px 6px #00000029,0 3px 6px #0000003b}.card-3{box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b}.card-4{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-5{box-shadow:0 19px 38px #0000004d,0 15px 12px #00000038}.dialog-choice{transition:.2s}.dialog-choice:hover{transform:scale(1.05);transform-origin:center}.dialog-choice:not(:hover)>.skill-check-name,.passive-skill-check>.skill-check-name{color:var(--skill-check-name-color)}.dialog-choice:not(:hover)>.skill-check-difficulty,.passive-skill-check>.skill-check-difficulty{color:var(--skill-check-difficulty)}.skill-check-difficulty{font-weight:700}.dialog-choice:not(:hover)>.skill-check-success,.passive-skill-check>.skill-check-success{color:var(--skill-check-success)}.dialog-choice:not(:hover)>.skill-check-failed,.passive-skill-check>.skill-check-failed{color:var(--skill-check-failed)}.dialog-choice:not(:hover)>.skill-check,.passive-skill-check.skill-check{color:var(--skill-check-color)}.narrat-canvas{position:absolute;height:100%;top:0;left:0}#touchTrigger{pointer-events:none}.modal-mask{position:absolute;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;transition:opacity .3s ease;display:flex;flex-direction:column;flex-shrink:2 2;align-items:center;justify-content:center}.modal-container{min-width:300px;max-width:90vw;max-height:100%;overflow-y:hidden;margin:10px auto;padding:20px 30px;border-radius:5px;transition:all .3s ease;font-family:Helvetica,Arial,sans-serif;background:linear-gradient(to right,hsl(210,30%,20%),hsl(255,30%,25%));display:flex;flex-direction:column}.modal-header{position:relative}.modal-header h3{flex-shrink:0;margin-top:0;color:var(--secondary)}.modal-body{margin:20px 0;overflow-y:auto;flex-shrink:2}.modal-default-button{float:right}.modal-enter,.modal-leave-active{opacity:0}.modal-enter .modal-container,.modal-leave-active .modal-container{transform:scale(1.1)}.close-button{border:1px solid var(--text-color);border-radius:50px;font-size:30px;font-weight:700;position:absolute;right:-20px;top:-10px;width:50px;height:50px}.close-button:hover{background-color:var(--focus)}.debug-menu{z-index:9999}.debug-button{position:fixed;bottom:10px;right:10px;padding:5px}.error-message{color:#ff4500;margin-top:10px;margin-bottom:10px}.error-filename{color:gray;text-decoration:underline}.debug-menu-container{width:100%}.search-result{border:1px solid var(--text-color);padding:10px;font-weight:700;font-size:20px;width:100}.jump-menu-container{width:80%}.debug-info{position:fixed;background-color:#0009;border:1px dotted var(--text-color);top:0;left:0;padding:5px}.variables-viewer{height:100%}.volume-label{margin-right:10px;font-size:20px;font-weight:700}.volume-controls{font-size:25px;display:flex;align-items:center;justify-content:center;margin:0 20px}.volume-slider{width:200px;background-color:#00f}.hud{position:absolute;right:0;top:0;display:flex;flex-direction:row-reverse;z-index:3}.hud-stat{border:1px dotted white;background-color:var(--hud-background);color:var(--hud-text-color);padding:5px}.hud-icon{display:inline-block;height:1em}.hud-text{margin-left:5px}#loading-bar{position:relative;width:40vw;height:100px;border-radius:50px;background:black}#inner-loading-bar{height:100%;border-radius:50px 0 0 50px;background:var(--light-background)}#loading-text{z-index:99999;display:flex;align-items:center;justify-content:space-around;position:absolute;width:100%;height:100%;top:0}.notifications-holder{position:fixed;top:0;right:0;padding:10px;display:flex;flex-direction:column-reverse;align-items:center;pointer-events:none}.notification{margin-top:10px;margin-bottom:10px;border-radius:10px;padding:15px;background:var(--notifications-bg);width:40vh;text-align:center}.quit-button{margin:20px;text-align:center}.skills-modal{width:800px}.skills-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.skill-display{width:200px;height:300px;position:relative;background-size:cover}.skill-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--skills-text-color);background:var(--skills-text-background)}.skill-level{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--skills-level-color);width:var(--skills-xp-bar-height);height:var(--skills-xp-bar-height);background-color:var(--skills-level-background)}.skill-description-container{justify-content:space-between;align-items:stretch}.skill-left{flex-direction:column;border:1px dashed white;padding:10px;justify-content:center}.skill-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline}.skill-xp-container{position:absolute;top:0;left:0;height:var(--skills-xp-bar-height);width:calc(100% - var(--skills-xp-bar-height));background-color:#00000080}.skill-xp-bar{position:absolute;top:0;left:0;width:50%;height:100%;background-color:#0000fa80}.skill-xp-text{z-index:2}.inventory-modal{width:800px;min-height:50%}.inventory-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.item-display{width:200px;height:300px;position:relative;background-repeat:no-repeat;background-size:contain}.item-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--inventory-text-color);background:var(--inventory-text-background)}.item-amount{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--inventory-amount-color);width:40px;height:40px;background-color:var(--inventory-amount-background)}.item-description-container{justify-content:space-between;align-items:stretch}.item-left{border:1px dashed white;flex-direction:column;padding:10px;justify-content:center}.item-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline;padding:10px}.dialog-picture{position:absolute;width:80px;height:80px;border:2px solid white;border-radius:10px;background-color:gray;z-index:99}.dialog-picture img{width:100%;height:100%}.dialog-title{font-size:20px;font-weight:700}.dialog-text{font-size:16px}.dialog-box{color:var(--text-color);padding:10px 10px 10px 2em;margin-bottom:10px}.dialog-choice{color:var(--dialog-choice-color)}.dialog-choice:hover{color:var(--dialog-choice-hover-color);cursor:pointer}.buttons-container{width:100%;padding:10px;display:flex;justify-content:space-evenly;align-items:stretch;box-sizing:border-box}.interact-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:50px;color:var(--text-color);border:1px solid black;font-weight:700;font-size:24px;text-align:center;flex-grow:2;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.dialog-container{flex-shrink:2;min-height:100%;width:100%;background-color:(var(--bg-color));box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;overflow-x:hidden}.dialog{overflow-y:auto;overflow-x:hidden;position:relative;-ms-overflow-style:none;scrollbar-width:none}.dialog::-webkit-scrollbar{display:none}.dialog *{overflow-anchor:none}.anchor{overflow-anchor:auto;height:1px}.quests-modal{width:100%;min-height:50%}.quest-header{display:flex;flex-direction:row;align-items:center}.quest-title{font-size:1.5rem;font-weight:700;margin-bottom:.5rem}.quest-completed{color:var(--completed-quest-title-color)}.quest-in-progress{color:var(--quest-title-color)}.quest-state{font-size:1.25rem;font-weight:700;margin-bottom:.5rem}.quest-description{font-size:1.1rem;text-align:justify;font-style:italic;margin-bottom:.5rem}.quest-objectives-container{margin-left:10px}.quest-objective-completed{color:var(--objective-completed-color);text-decoration:line-through}.quest-objective-in-progress{color:var(--objective-in-progress-color)}.quest-objective-description{font-size:1rem;margin-bottom:.5rem}.menu-content{text-align:center}.menu-toggle-button{margin:0;padding:2px;border-radius:5px}.menu-toggle-button:not(:last-child){margin-right:10px}.menu-modal{width:500px}#app{background-color:var(--bg-color);width:100%;height:100%;position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;color:var(--text-color);box-sizing:border-box;overflow:hidden;transform-origin:center center}.game{background-color:var(--bg-color);position:relative;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;height:100%;box-sizing:border-box;overflow:hidden}.interact-button{height:50px;border:1px solid black;font-weight:700;font-size:20px;text-align:center;flex-grow:2;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.interact-button:not(:last-child){margin-right:10px}.background{margin:0}#background-canvas{height:100%}.menu-toggle{position:fixed;bottom:0px;right:15%;z-index:2}#game-title-container{margin-bottom:50px}#game-title-text{text-align:center;font-size:50px}.menu-button{font-size:25px}#game-header{position:relative;top:100px}
|
|
1
|
+
var FG=Object.defineProperty;var qG=(sn,P,Dr)=>P in sn?FG(sn,P,{enumerable:!0,configurable:!0,writable:!0,value:Dr}):sn[P]=Dr;var Go=(sn,P,Dr)=>(qG(sn,typeof P!="symbol"?P+"":P,Dr),Dr);var __vite_style__=document.createElement("style");__vite_style__.innerHTML=`/*! @import *//*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com */*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.gap-4{gap:1rem}.border{border-width:1px}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.italic{font-style:italic}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--font-family: "Helvetica", sans-serif, "Arial", "sans-serif";--bg-color: #131720;--text-color: #d9e1f2;--primary: hsl(255, 30%, 55%);--focus: hsl(210, 90%, 50%);--secondary: #42b983;--border-color: hsla(0, 0%, 100%, .2);--light-1: hsl(210, 30%, 40%);--light-2: hsl(255, 30%, 50%);--light-background: linear-gradient(to right, var(--light-1), var(--light-2));--shadow-1: hsla(236, 50%, 50%, .3);--shadow-2: hsla(236, 50%, 50%, .4);--hud-background: rgba(0, 0, 0, .4);--hud-text-color: var(--text-color);--notifications-bg: darkslateblue;--skills-text-background: rgba(0, 0, 0, .5);--skills-text-color: var(--text-color);--skills-level-background: rgba(0, 0, 0, .5);--skills-level-color: orange;--skills-xp-bar-height: 40px;--skill-check-name-color: orange;--skill-check-difficulty: orange;--skill-check-success: green;--skill-check-failed: red;--skill-check-color: orange;--dialog-choice-color: orange;--dialog-choice-hover-color: var(--text-color);--inventory-text-background: rgba(0, 0, 0, .5);--inventory-text-color: var(--text-color);--inventory-amount-background: rgba(0, 0, 0, .5);--inventory-amount-color: orange;--quest-title-color: yellow;--completed-quest-title-color: grey;--objective-in-progress-color: white;--objective-completed-color: grey}body,*{font-family:var(--font-family)}.list-item{display:inline-block;margin-right:10px}.list-enter-active,.list-leave-active{transition:all .3s ease}#app{background-size:cover}.list-enter-from,.list-leave-to{opacity:0;transform:translate(300px)}.notification-item{display:inline-block;margin-right:10px}.notification-enter-active,.notification-leave-active{transition:all .3s ease}.notification-enter-from,.notification-leave-to{opacity:0;transform:translateY(-300px)}.fade-enter-active,.fade-leave-active{transition:opacity .3s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-in-enter-active{transition:opacity .1s ease}.fade-in-enter-from{opacity:0}body{padding:0;margin:0;font-family:Arial,sans-serif;background-color:#000}.select{background:var(--light-background);padding:10px}.option{background-color:var(--light-2);padding:5px;color:var(--text-color)}.button{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .5rem 2.4rem .2rem var(--shadow-1),inset -2px -4px #0006,inset 2px 2px #fff7;border-radius:10px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s;box-shadow:inset -2px -4px #0006,inset 2px 2px #fff7}.button.large{border-radius:20px}.menu-button{border-radius:5px}.button.main-menu-button{border-radius:20px}.button:focus,.button:hover{transform:translateY(-.2rem);box-shadow:0 0 1rem .2rem var(--shadow-2),inset -2px -4px #0006,inset 2px 2px #fff7}.disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.button.disabled{box-shadow:unset;color:gray;background:var(--border-color)}.input{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .4rem 2.4rem .2rem var(--shadow-1);border-radius:100px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s}.input:focus,.input:hover{transform:translateY(-.2rem);box-shadow:0 0 2.4rem .2rem var(--shadow-2)}a{color:pink;text-decoration:underline}th,td{padding:4px;border:1px solid var(--text-color);text-align:center}#game-holder{width:100vw;height:100vh;padding:0;margin:0;top:0;left:0;background-color:#000;display:flex;align-items:center;justify-content:center;min-height:-webkit-fill-available}.title{font-size:30px;font-weight:700;text-align:center}.container{padding:20px}h1,h2,h3,h4{font-weight:700}h1{font-size:30px}h2{font-size:26px}h3{font-size:24px}hr.solid{border:1px solid var(--text-color);margin-top:30px;margin-bottom:30px}.card-1{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;transition:all .3s cubic-bezier(.25,.8,.25,1)}.card-1:hover{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-2{box-shadow:0 3px 6px #00000029,0 3px 6px #0000003b}.card-3{box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b}.card-4{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-5{box-shadow:0 19px 38px #0000004d,0 15px 12px #00000038}.dialog-choice{transition:.2s}.dialog-choice:hover{transform:scale(1.05);transform-origin:center}.dialog-choice:not(:hover)>.skill-check-name,.passive-skill-check>.skill-check-name{color:var(--skill-check-name-color)}.dialog-choice:not(:hover)>.skill-check-difficulty,.passive-skill-check>.skill-check-difficulty{color:var(--skill-check-difficulty)}.skill-check-difficulty{font-weight:700}.dialog-choice:not(:hover)>.skill-check-success,.passive-skill-check>.skill-check-success{color:var(--skill-check-success)}.dialog-choice:not(:hover)>.skill-check-failed,.passive-skill-check>.skill-check-failed{color:var(--skill-check-failed)}.dialog-choice:not(:hover)>.skill-check,.passive-skill-check.skill-check{color:var(--skill-check-color)}.narrat-canvas{position:absolute;height:100%;top:0;left:0}#touchTrigger{pointer-events:none}.modal-mask{position:absolute;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;transition:opacity .3s ease;display:flex;flex-direction:column;flex-shrink:2 2;align-items:center;justify-content:center}.modal-container{min-width:300px;max-width:90vw;max-height:100%;overflow-y:hidden;margin:10px auto;padding:20px 30px;border-radius:5px;transition:all .3s ease;font-family:Helvetica,Arial,sans-serif;background:linear-gradient(to right,hsl(210,30%,20%),hsl(255,30%,25%));display:flex;flex-direction:column}.modal-header{position:relative}.modal-header h3{flex-shrink:0;margin-top:0;color:var(--secondary)}.modal-body{margin:20px 0;overflow-y:auto;flex-shrink:2}.modal-default-button{float:right}.modal-enter,.modal-leave-active{opacity:0}.modal-enter .modal-container,.modal-leave-active .modal-container{transform:scale(1.1)}.close-button{border:1px solid var(--text-color);border-radius:50px;font-size:30px;font-weight:700;position:absolute;right:-20px;top:-10px;width:50px;height:50px}.close-button:hover{background-color:var(--focus)}.debug-menu{z-index:9999}.debug-button{position:fixed;bottom:10px;right:10px;padding:5px}.error-message{color:#ff4500;margin-top:10px;margin-bottom:10px}.error-filename{color:gray;text-decoration:underline}.debug-menu-container{width:100%}.search-result{border:1px solid var(--text-color);padding:10px;font-weight:700;font-size:20px;width:100}.jump-menu-container{width:80%}.debug-info{position:fixed;background-color:#0009;border:1px dotted var(--text-color);top:0;left:0;padding:5px}.variables-viewer{height:100%}.volume-label{margin-right:10px;font-size:20px;font-weight:700}.volume-controls{font-size:25px;display:flex;align-items:center;justify-content:center;margin:0 20px}.volume-slider{width:200px;background-color:#00f}.hud{position:absolute;right:0;top:0;display:flex;flex-direction:row-reverse;z-index:3}.hud-stat{border:1px dotted white;background-color:var(--hud-background);color:var(--hud-text-color);padding:5px}.hud-icon{display:inline-block;height:1em}.hud-text{margin-left:5px}#loading-bar{position:relative;width:40vw;height:100px;border-radius:50px;background:black}#inner-loading-bar{height:100%;border-radius:50px 0 0 50px;background:var(--light-background)}#loading-text{z-index:99999;display:flex;align-items:center;justify-content:space-around;position:absolute;width:100%;height:100%;top:0}.notifications-holder{position:fixed;top:0;right:0;padding:10px;display:flex;flex-direction:column-reverse;align-items:center;pointer-events:none}.notification{margin-top:10px;margin-bottom:10px;border-radius:10px;padding:15px;background:var(--notifications-bg);width:40vh;text-align:center}.quit-button{margin:20px;text-align:center}.skills-modal{width:800px}.skills-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.skill-display{width:200px;height:300px;position:relative;background-size:cover}.skill-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--skills-text-color);background:var(--skills-text-background)}.skill-level{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--skills-level-color);width:var(--skills-xp-bar-height);height:var(--skills-xp-bar-height);background-color:var(--skills-level-background)}.skill-description-container{justify-content:space-between;align-items:stretch}.skill-left{flex-direction:column;border:1px dashed white;padding:10px;justify-content:center}.skill-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline}.skill-xp-container{position:absolute;top:0;left:0;height:var(--skills-xp-bar-height);width:calc(100% - var(--skills-xp-bar-height));background-color:#00000080}.skill-xp-bar{position:absolute;top:0;left:0;width:50%;height:100%;background-color:#0000fa80}.skill-xp-text{z-index:2}.inventory-modal{width:800px;min-height:50%}.inventory-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.item-display{width:200px;height:300px;position:relative;background-repeat:no-repeat;background-size:contain}.item-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--inventory-text-color);background:var(--inventory-text-background)}.item-amount{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--inventory-amount-color);width:40px;height:40px;background-color:var(--inventory-amount-background)}.item-description-container{justify-content:space-between;align-items:stretch}.item-left{border:1px dashed white;flex-direction:column;padding:10px;justify-content:center}.item-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline;padding:10px}.dialog-picture{position:absolute;width:80px;height:80px;border:2px solid white;border-radius:10px;background-color:gray;z-index:99}.dialog-picture img{width:100%;height:100%}.dialog-title{font-size:20px;font-weight:700}.dialog-text{font-size:16px}.dialog-box{color:var(--text-color);padding:10px 10px 10px 2em;margin-bottom:10px}.dialog-choice{color:var(--dialog-choice-color)}.dialog-choice:hover{color:var(--dialog-choice-hover-color);cursor:pointer}.buttons-container{width:100%;padding:10px;display:flex;justify-content:space-evenly;align-items:stretch;box-sizing:border-box}.interact-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:50px;color:var(--text-color);border:1px solid black;font-weight:700;font-size:24px;text-align:center;flex-grow:2;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.dialog-container{flex-shrink:2;min-height:100%;width:100%;background-color:(var(--bg-color));box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;overflow-x:hidden}.dialog{overflow-y:auto;overflow-x:hidden;position:relative;-ms-overflow-style:none;scrollbar-width:none}.dialog::-webkit-scrollbar{display:none}.dialog *{overflow-anchor:none}.anchor{overflow-anchor:auto;height:1px}.quests-modal{width:100%;min-height:50%}.quest-header{display:flex;flex-direction:row;align-items:center}.quest-title{font-size:1.5rem;font-weight:700;margin-bottom:.5rem}.quest-completed{color:var(--completed-quest-title-color)}.quest-in-progress{color:var(--quest-title-color)}.quest-state{font-size:1.25rem;font-weight:700;margin-bottom:.5rem}.quest-description{font-size:1.1rem;text-align:justify;font-style:italic;margin-bottom:.5rem}.quest-objectives-container{margin-left:10px}.quest-objective-completed{color:var(--objective-completed-color);text-decoration:line-through}.quest-objective-in-progress{color:var(--objective-in-progress-color)}.quest-objective-description{font-size:1rem;margin-bottom:.5rem}.menu-content{text-align:center}.menu-toggle-button{margin:0;padding:2px;border-radius:5px}.menu-toggle-button:not(:last-child){margin-right:10px}.menu-modal{width:500px}#app{background-color:var(--bg-color);width:100%;height:100%;position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;color:var(--text-color);box-sizing:border-box;overflow:hidden;transform-origin:center center}.game{background-color:var(--bg-color);position:relative;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;height:100%;box-sizing:border-box;overflow:hidden}.interact-button{height:50px;border:1px solid black;font-weight:700;font-size:20px;text-align:center;flex-grow:2;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.interact-button:not(:last-child){margin-right:10px}.background{margin:0}#background-canvas{height:100%}.menu-toggle{position:fixed;bottom:0px;right:15%;z-index:2}#game-title-container{margin-bottom:50px}#game-title-text{text-align:center;font-size:50px}.menu-button{font-size:25px}#game-header{position:relative;top:100px}
|
|
2
2
|
(function(sn,P){typeof exports=="object"&&typeof module!="undefined"?P(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],P):(sn=typeof globalThis!="undefined"?globalThis:sn||self,P(sn.narrat={},sn.Vue))})(this,function(sn,P){"use strict";`;document.head.appendChild(__vite_style__);var Dr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function U8(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ag={exports:{}};/*!
|
|
3
3
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
4
4
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
5
5
|
* @license Licensed under MIT license
|
|
6
6
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
7
7
|
* @version v4.2.8+1e68dce6
|
|
8
|
-
*/(function(t,e){(function(n,r){t.exports=r()})(Dr,function(){function n(ye){var Ce=typeof ye;return ye!==null&&(Ce==="object"||Ce==="function")}function r(ye){return typeof ye=="function"}var o=void 0;Array.isArray?o=Array.isArray:o=function(ye){return Object.prototype.toString.call(ye)==="[object Array]"};var i=o,a=0,s=void 0,l=void 0,c=function(Ce,De){C[a]=Ce,C[a+1]=De,a+=2,a===2&&(l?l(A):_())};function f(ye){l=ye}function u(ye){c=ye}var d=typeof window!="undefined"?window:void 0,h=d||{},p=h.MutationObserver||h.WebKitMutationObserver,v=typeof self=="undefined"&&typeof process!="undefined"&&{}.toString.call(process)==="[object process]",g=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function m(){return function(){return process.nextTick(A)}}function y(){return typeof s!="undefined"?function(){s(A)}:k()}function b(){var ye=0,Ce=new p(A),De=document.createTextNode("");return Ce.observe(De,{characterData:!0}),function(){De.data=ye=++ye%2}}function w(){var ye=new MessageChannel;return ye.port1.onmessage=A,function(){return ye.port2.postMessage(0)}}function k(){var ye=setTimeout;return function(){return ye(A,1)}}var C=new Array(1e3);function A(){for(var ye=0;ye<a;ye+=2){var Ce=C[ye],De=C[ye+1];Ce(De),C[ye]=void 0,C[ye+1]=void 0}a=0}function T(){try{var ye=Function("return this")().require("vertx");return s=ye.runOnLoop||ye.runOnContext,y()}catch{return k()}}var _=void 0;v?_=m():p?_=b():g?_=w():d===void 0&&typeof U8=="function"?_=T():_=k();function M(ye,Ce){var De=this,ge=new this.constructor(S);ge[F]===void 0&&se(ge);var ze=De._state;if(ze){var Ke=arguments[ze-1];c(function(){return ke(ze,ge,Ke,De._result)})}else U(De,ge,ye,Ce);return ge}function $(ye){var Ce=this;if(ye&&typeof ye=="object"&&ye.constructor===Ce)return ye;var De=new Ce(S);return D(De,ye),De}var F=Math.random().toString(36).substring(2);function S(){}var j=void 0,z=1,Q=2;function B(){return new TypeError("You cannot resolve a promise with itself")}function K(){return new TypeError("A promises callback cannot return that same promise.")}function R(ye,Ce,De,ge){try{ye.call(Ce,De,ge)}catch(ze){return ze}}function N(ye,Ce,De){c(function(ge){var ze=!1,Ke=R(De,Ce,function(mt){ze||(ze=!0,Ce!==mt?D(ge,mt):x(ge,mt))},function(mt){ze||(ze=!0,I(ge,mt))},"Settle: "+(ge._label||" unknown promise"));!ze&&Ke&&(ze=!0,I(ge,Ke))},ye)}function H(ye,Ce){Ce._state===z?x(ye,Ce._result):Ce._state===Q?I(ye,Ce._result):U(Ce,void 0,function(De){return D(ye,De)},function(De){return I(ye,De)})}function q(ye,Ce,De){Ce.constructor===ye.constructor&&De===M&&Ce.constructor.resolve===$?H(ye,Ce):De===void 0?x(ye,Ce):r(De)?N(ye,Ce,De):x(ye,Ce)}function D(ye,Ce){if(ye===Ce)I(ye,B());else if(n(Ce)){var De=void 0;try{De=Ce.then}catch(ge){I(ye,ge);return}q(ye,Ce,De)}else x(ye,Ce)}function O(ye){ye._onerror&&ye._onerror(ye._result),ie(ye)}function x(ye,Ce){ye._state===j&&(ye._result=Ce,ye._state=z,ye._subscribers.length!==0&&c(ie,ye))}function I(ye,Ce){ye._state===j&&(ye._state=Q,ye._result=Ce,c(O,ye))}function U(ye,Ce,De,ge){var ze=ye._subscribers,Ke=ze.length;ye._onerror=null,ze[Ke]=Ce,ze[Ke+z]=De,ze[Ke+Q]=ge,Ke===0&&ye._state&&c(ie,ye)}function ie(ye){var Ce=ye._subscribers,De=ye._state;if(Ce.length!==0){for(var ge=void 0,ze=void 0,Ke=ye._result,mt=0;mt<Ce.length;mt+=3)ge=Ce[mt],ze=Ce[mt+De],ge?ke(De,ge,ze,Ke):ze(Ke);ye._subscribers.length=0}}function ke(ye,Ce,De,ge){var ze=r(De),Ke=void 0,mt=void 0,nn=!0;if(ze){try{Ke=De(ge)}catch(cn){nn=!1,mt=cn}if(Ce===Ke){I(Ce,K());return}}else Ke=ge;Ce._state!==j||(ze&&nn?D(Ce,Ke):nn===!1?I(Ce,mt):ye===z?x(Ce,Ke):ye===Q&&I(Ce,Ke))}function _e(ye,Ce){try{Ce(function(ge){D(ye,ge)},function(ge){I(ye,ge)})}catch(De){I(ye,De)}}var L=0;function J(){return L++}function se(ye){ye[F]=L++,ye._state=void 0,ye._result=void 0,ye._subscribers=[]}function ae(){return new Error("Array Methods must be provided an Array")}var ve=function(){function ye(Ce,De){this._instanceConstructor=Ce,this.promise=new Ce(S),this.promise[F]||se(this.promise),i(De)?(this.length=De.length,this._remaining=De.length,this._result=new Array(this.length),this.length===0?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(De),this._remaining===0&&x(this.promise,this._result))):I(this.promise,ae())}return ye.prototype._enumerate=function(De){for(var ge=0;this._state===j&&ge<De.length;ge++)this._eachEntry(De[ge],ge)},ye.prototype._eachEntry=function(De,ge){var ze=this._instanceConstructor,Ke=ze.resolve;if(Ke===$){var mt=void 0,nn=void 0,cn=!1;try{mt=De.then}catch(Z){cn=!0,nn=Z}if(mt===M&&De._state!==j)this._settledAt(De._state,ge,De._result);else if(typeof mt!="function")this._remaining--,this._result[ge]=De;else if(ze===qe){var Mn=new ze(S);cn?I(Mn,nn):q(Mn,De,mt),this._willSettleAt(Mn,ge)}else this._willSettleAt(new ze(function(Z){return Z(De)}),ge)}else this._willSettleAt(Ke(De),ge)},ye.prototype._settledAt=function(De,ge,ze){var Ke=this.promise;Ke._state===j&&(this._remaining--,De===Q?I(Ke,ze):this._result[ge]=ze),this._remaining===0&&x(Ke,this._result)},ye.prototype._willSettleAt=function(De,ge){var ze=this;U(De,void 0,function(Ke){return ze._settledAt(z,ge,Ke)},function(Ke){return ze._settledAt(Q,ge,Ke)})},ye}();function Se(ye){return new ve(this,ye).promise}function ue(ye){var Ce=this;return i(ye)?new Ce(function(De,ge){for(var ze=ye.length,Ke=0;Ke<ze;Ke++)Ce.resolve(ye[Ke]).then(De,ge)}):new Ce(function(De,ge){return ge(new TypeError("You must pass an array to race."))})}function Y(ye){var Ce=this,De=new Ce(S);return I(De,ye),De}function Ve(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ge(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var qe=function(){function ye(Ce){this[F]=J(),this._result=this._state=void 0,this._subscribers=[],S!==Ce&&(typeof Ce!="function"&&Ve(),this instanceof ye?_e(this,Ce):Ge())}return ye.prototype.catch=function(De){return this.then(null,De)},ye.prototype.finally=function(De){var ge=this,ze=ge.constructor;return r(De)?ge.then(function(Ke){return ze.resolve(De()).then(function(){return Ke})},function(Ke){return ze.resolve(De()).then(function(){throw Ke})}):ge.then(De,De)},ye}();qe.prototype.then=M,qe.all=Se,qe.race=ue,qe.resolve=$,qe.reject=Y,qe._setScheduler=f,qe._setAsap=u,qe._asap=c;function Ee(){var ye=void 0;if(typeof Dr!="undefined")ye=Dr;else if(typeof self!="undefined")ye=self;else try{ye=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var Ce=ye.Promise;if(Ce){var De=null;try{De=Object.prototype.toString.call(Ce.resolve())}catch{}if(De==="[object Promise]"&&!Ce.cast)return}ye.Promise=qe}return qe.polyfill=Ee,qe.Promise=qe,qe})})(Ag),Ag.exports.polyfill();var HG=(()=>`/*! @import *//*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com */*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.gap-4{gap:1rem}.border{border-width:1px}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.italic{font-style:italic}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--font-family: "Helvetica", sans-serif, "Arial", "sans-serif";--bg-color: #131720;--text-color: #d9e1f2;--primary: hsl(255, 30%, 55%);--focus: hsl(210, 90%, 50%);--secondary: #42b983;--border-color: hsla(0, 0%, 100%, .2);--light-1: hsl(210, 30%, 40%);--light-2: hsl(255, 30%, 50%);--light-background: linear-gradient(to right, var(--light-1), var(--light-2));--shadow-1: hsla(236, 50%, 50%, .3);--shadow-2: hsla(236, 50%, 50%, .4);--hud-background: rgba(0, 0, 0, .4);--hud-text-color: var(--text-color);--notifications-bg: darkslateblue;--skills-text-background: rgba(0, 0, 0, .5);--skills-text-color: var(--text-color);--skills-level-background: rgba(0, 0, 0, .5);--skills-level-color: orange;--skills-xp-bar-height: 40px;--skill-check-name-color: orange;--skill-check-difficulty: orange;--skill-check-success: green;--skill-check-failed: red;--skill-check-color: orange;--dialog-choice-color: orange;--dialog-choice-hover-color: var(--text-color);--inventory-text-background: rgba(0, 0, 0, .5);--inventory-text-color: var(--text-color);--inventory-amount-background: rgba(0, 0, 0, .5);--inventory-amount-color: orange;--quest-title-color: yellow;--completed-quest-title-color: grey;--objective-in-progress-color: white;--objective-completed-color: grey}body,*{font-family:var(--font-family)}.list-item{display:inline-block;margin-right:10px}.list-enter-active,.list-leave-active{transition:all .3s ease}#app{background-size:cover}.list-enter-from,.list-leave-to{opacity:0;transform:translate(300px)}.notification-item{display:inline-block;margin-right:10px}.notification-enter-active,.notification-leave-active{transition:all .3s ease}.notification-enter-from,.notification-leave-to{opacity:0;transform:translateY(-300px)}.fade-enter-active,.fade-leave-active{transition:opacity .3s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-in-enter-active{transition:opacity .1s ease}.fade-in-enter-from{opacity:0}body{padding:0;margin:0;font-family:Arial,sans-serif;background-color:#000}.select{background:var(--light-background);padding:10px}.option{background-color:var(--light-2);padding:5px;color:var(--text-color)}.button{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .5rem 2.4rem .2rem var(--shadow-1),inset -2px -4px #0006,inset 2px 2px #fff7;border-radius:10px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s;box-shadow:inset -2px -4px #0006,inset 2px 2px #fff7}.button.large{border-radius:20px}.menu-button{border-radius:5px}.button.main-menu-button{border-radius:20px}.button:focus,.button:hover{transform:translateY(-.2rem);box-shadow:0 0 1rem .2rem var(--shadow-2),inset -2px -4px #0006,inset 2px 2px #fff7}.disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.button.disabled{box-shadow:unset;color:gray;background:var(--border-color)}.input{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .4rem 2.4rem .2rem var(--shadow-1);border-radius:100px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s}.input:focus,.input:hover{transform:translateY(-.2rem);box-shadow:0 0 2.4rem .2rem var(--shadow-2)}a{color:pink;text-decoration:underline}th,td{padding:4px;border:1px solid var(--text-color);text-align:center}#game-holder{width:100vw;height:100vh;padding:0;margin:0;top:0;left:0;background-color:#000;display:flex;align-items:center;justify-content:center;min-height:-webkit-fill-available}.title{font-size:30px;font-weight:700;text-align:center}.container{padding:20px}h1,h2,h3,h4{font-weight:700}h1{font-size:30px}h2{font-size:26px}h3{font-size:24px}hr.solid{border:1px solid var(--text-color);margin-top:30px;margin-bottom:30px}.card-1{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;transition:all .3s cubic-bezier(.25,.8,.25,1)}.card-1:hover{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-2{box-shadow:0 3px 6px #00000029,0 3px 6px #0000003b}.card-3{box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b}.card-4{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-5{box-shadow:0 19px 38px #0000004d,0 15px 12px #00000038}.dialog-choice{transition:.2s}.dialog-choice:hover{transform:scale(1.05);transform-origin:center}.dialog-choice:not(:hover)>.skill-check-name,.passive-skill-check>.skill-check-name{color:var(--skill-check-name-color)}.dialog-choice:not(:hover)>.skill-check-difficulty,.passive-skill-check>.skill-check-difficulty{color:var(--skill-check-difficulty)}.skill-check-difficulty{font-weight:700}.dialog-choice:not(:hover)>.skill-check-success,.passive-skill-check>.skill-check-success{color:var(--skill-check-success)}.dialog-choice:not(:hover)>.skill-check-failed,.passive-skill-check>.skill-check-failed{color:var(--skill-check-failed)}.dialog-choice:not(:hover)>.skill-check,.passive-skill-check.skill-check{color:var(--skill-check-color)}.narrat-canvas{position:absolute;height:100%;top:0;left:0}#touchTrigger{pointer-events:none}
|
|
9
|
-
`)();const Eg=P.ref([]),Pg=P.ref(null),Mg=P.ref(null),Tg=P.ref(null),Jr=P.reactive({current:""}),kd=[],J8=P.ref(!1),xd=P.readonly(Eg),G8=P.readonly(Pg),K8=P.readonly(Mg),Q8=P.readonly(Tg),Y8=P.readonly(Jr),Ig=(t=G8.value)=>{Jr.current=t;const e=xd.value.findIndex(r=>r.name===t),n=xd.value.map(r=>r.name);for(let r=0;r<n.length;r++){if(r>0&&r<n.length-1){const o=n[r]+"Minus",i=n[r]+"Plus";Jr[o]=e<=r,Jr[i]=e>=r}Jr[n[r]]=n[r]===t}},Ng=(t=K8.value)=>{Jr.orientation=t,Jr.isLandscape=t==="landscape",Jr.isPortrait=t==="portrait"},Lg=(t=Q8.value||"light")=>{Jr.theme=t,Jr.isDark=t==="dark",Jr.isLight=t==="light"};function jd(t,e){if(typeof window=="undefined"||!window.matchMedia)return!1;if(typeof window!="undefined"&&!window.matchMedia)return console.error("Vue3 Mq: No MatchMedia support detected in this browser. Responsive breakpoints not available."),!1;{J8.value=!0;const n=window.matchMedia(t),r=({matches:o})=>{o&&e()};kd.push({mql:n,cb:r}),n.addEventListener&&typeof n.addEventListener=="function"?n.addEventListener("change",r):n.addListener(r),r(n)}}var _d=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",bootstrap5:{xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},bootstrap4:{xs:0,sm:576,md:768,lg:992,xl:1200},bootstrap3:{xs:0,sm:768,md:992,lg:1200},vuetify:{xs:0,sm:600,md:960,lg:1264,xl:1904},tailwind:{xs:0,sm:640,md:768,lg:1024,xl:1280,xxl:1536},devices:{phone:0,tablet:768,laptop:1370,desktop:1906}});const Rg=t=>{if(!t||typeof t!="object")return!1;const e=[];for(let n in t){const r=parseFloat(t[n]);n&&typeof n=="string"?/^[^a-z]/i.test(n)||/[^a-zA-Z0-9_]/.test(n)?console.warn(`Vue3 Mq: "${n}" is an invalid breakpoint key. Breakpoint keys must start with a letter and contain only alphanumeric characters and underscores. Skipping.`):!r&&r!==0||isNaN(r)||r<0?console.warn(`Vue3 Mq: "${n}: ${t[n]}" is not a valid breakpoint. Breakpoints should be a number of zero or above. Skipping.`):e.push({name:n,min:r}):console.warn(`Vue3 Mq: Invalid or missing breakpoint key (${JSON.stringify(n)}). Skipping.`)}return e.some(n=>n.min===0)||console.warn("Vue3 Mq: You have not declared a breakpoint with a minimum value of 0. There may be screen sizes to which Vue3Mq does not respond."),new Set(e.map(n=>n.min)).size<e.length&&console.warn("Vue3 Mq: Your breakpoint configuration contains duplicate values. Behaviour may be unpredictable."),e.length!==0&&e.sort((n,r)=>n.min-r.min)};function Dg({breakpoints:t,preset:e}){const n=(a=>{if(typeof a=="string"&&_d[a])return _d[a];{const s=Object.keys(_d);return console.error(`Vue3 Mq: "${a}" is not a valid preset. Available options are: ${s.join(", ")}`),!1}})(e),r=Rg(t);if(n===!1&&!r)throw new TypeError("Vue3 Mq: You must provide a valid preset, or valid breakpoint settings.");var o;o=r||Rg(n),Eg.value=o,function(){for(;kd.length>0;){const a=kd.shift();if(a&&typeof a=="object"){const{mql:s,cb:l}=a;s.addEventListener&&typeof s.addEventListener=="function"?s.removeEventListener("change",l):s.removeListener(l)}}}(),(()=>{const a=Object.keys(Jr);for(let s of a)delete Jr[s];Ig(),Ng(),Lg()})();const i=xd.value.reduce((a,s,l,c)=>{const f=`(min-width: ${s.min}px)`,u=l<c.length-1?`(max-width: ${c[l+1].min-1}px)`:null,d=f+(u?" and "+u:"");return Object.assign(a,{[s.name]:d})},{});for(const a in i)jd(i[a],()=>{Ig(a)});["portrait","landscape"].forEach(a=>{jd(`(orientation: ${a})`,()=>{Ng(a)})}),["light","dark"].forEach(a=>{jd(`(prefers-color-scheme: ${a})`,()=>{Lg(a)})})}var X8={install:(t,{preset:e="bootstrap5",breakpoints:n,defaultBreakpoint:r,defaultOrientation:o="landscape",defaultTheme:i}={})=>{try{const l=["landscape","portrait"].includes(s=o)===!1?(console.error(`Vue3 Mq: "${s}" is not a valid default orientation. Reverting to unset value.`),null):s,c=((f=null)=>["dark","light"].includes(f)===!1&&f!==null?(console.error(`Vue3 Mq: "${f}" is not a valid default theme. Reverting to unset value.`),null):f)(i);a=r,Pg.value=a,(f=>{Mg.value=f})(l),(f=>{Tg.value=f})(c),t.provide("mq",Y8),t.provide("updateBreakpoints",Dg),Dg({breakpoints:n,preset:e})}catch(l){console.error(l)}var a,s}};class zg{constructor(){Go(this,"debug");Go(this,"logger",{log:()=>{}})}setupDebugger(e){this.debug=e,e&&(this.logger.log=console.log.bind(window.console))}}const Bg=new zg,Co=Bg.logger;function Sd(t,e){return Date.now()-t+e}function Fg(t){const e=parseInt(t,10);let n=Math.floor(e/3600),r=Math.floor((e-n*3600)/60),o=e-n*3600-r*60;return n<10&&(n="0"+n),r<10&&(r="0"+r),o<10&&(o="0"+o),n+":"+r+":"+o}var
|
|
10
|
-
`)(),zr=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n};const Z8=P.defineComponent({props:{containerCssClass:String}}),eE={class:"modal-header"},tE=P.createTextVNode(" default header "),nE=P.createElementVNode("hr",{class:"solid"},null,-1),rE={class:"modal-body"},oE=P.createTextVNode(" default body "),iE={class:"modal-footer"};function aE(t,e,n,r,o,i){return P.openBlock(),P.createBlock(P.Transition,{name:"modal"},{default:P.withCtx(()=>[P.createElementVNode("div",{class:"modal-mask",onClick:e[2]||(e[2]=a=>t.$emit("close"))},[P.createElementVNode("div",{class:P.normalizeClass(["modal-container bg-gray-800 card-4",t.containerCssClass]),onClick:e[1]||(e[1]=a=>a.stopPropagation())},[P.createElementVNode("div",eE,[P.createElementVNode("button",{class:"close-button",onClick:e[0]||(e[0]=a=>t.$emit("close"))},"X"),P.renderSlot(t.$slots,"header",{},()=>[tE]),nE]),P.createElementVNode("div",rE,[P.renderSlot(t.$slots,"body",{},()=>[oE])]),P.createElementVNode("div",iE,[P.renderSlot(t.$slots,"footer")])],2)])]),_:3})}var tl=zr(Z8,[["render",aE]]);function xi(t){return Array.isArray?Array.isArray(t):Hg(t)==="[object Array]"}const sE=1/0;function lE(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-sE?"-0":e}function cE(t){return t==null?"":lE(t)}function Ko(t){return typeof t=="string"}function qg(t){return typeof t=="number"}function uE(t){return t===!0||t===!1||fE(t)&&Hg(t)=="[object Boolean]"}function Vg(t){return typeof t=="object"}function fE(t){return Vg(t)&&t!==null}function Gr(t){return t!=null}function Cd(t){return!t.trim().length}function Hg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const UG="Extended search is not available",dE="Incorrect 'index' type",hE=t=>`Invalid value for key ${t}`,pE=t=>`Pattern length exceeds max of ${t}.`,vE=t=>`Missing ${t} property in key`,mE=t=>`Property 'weight' in key '${t}' must be a positive integer`,Wg=Object.prototype.hasOwnProperty;class gE{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let o=Ug(r);n+=o.weight,this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ug(t){let e=null,n=null,r=null,o=1,i=null;if(Ko(t)||xi(t))r=t,e=Jg(t),n=$d(t);else{if(!Wg.call(t,"name"))throw new Error(vE("name"));const a=t.name;if(r=a,Wg.call(t,"weight")&&(o=t.weight,o<=0))throw new Error(mE(a));e=Jg(a),n=$d(a),i=t.getFn}return{path:e,id:n,weight:o,src:r,getFn:i}}function Jg(t){return xi(t)?t:t.split(".")}function $d(t){return xi(t)?t.join("."):t}function yE(t,e){let n=[],r=!1;const o=(i,a,s)=>{if(!!Gr(i))if(!a[s])n.push(i);else{let l=a[s];const c=i[l];if(!Gr(c))return;if(s===a.length-1&&(Ko(c)||qg(c)||uE(c)))n.push(cE(c));else if(xi(c)){r=!0;for(let f=0,u=c.length;f<u;f+=1)o(c[f],a,s+1)}else a.length&&o(c,a,s+1)}};return o(t,Ko(e)?e.split("."):e,0),r?n:n[0]}var Lt={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:yE,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const bE=/[^ ]+/g;function wE(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(o){const i=o.match(bE).length;if(n.has(i))return n.get(i);const a=1/Math.pow(i,.5*t),s=parseFloat(Math.round(a*r)/r);return n.set(i,s),s},clear(){n.clear()}}}class Od{constructor({getFn:e=Lt.getFn,fieldNormWeight:n=Lt.fieldNormWeight}={}){this.norm=wE(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ko(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();Ko(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!Gr(e)||Cd(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((o,i)=>{let a=o.getFn?o.getFn(e):this.getFn(e,o.path);if(!!Gr(a)){if(xi(a)){let s=[];const l=[{nestedArrIndex:-1,value:a}];for(;l.length;){const{nestedArrIndex:c,value:f}=l.pop();if(!!Gr(f))if(Ko(f)&&!Cd(f)){let u={v:f,i:c,n:this.norm.get(f)};s.push(u)}else xi(f)&&f.forEach((u,d)=>{l.push({nestedArrIndex:d,value:u})})}r.$[i]=s}else if(Ko(a)&&!Cd(a)){let s={v:a,n:this.norm.get(a)};r.$[i]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function Gg(t,e,{getFn:n=Lt.getFn,fieldNormWeight:r=Lt.fieldNormWeight}={}){const o=new Od({getFn:n,fieldNormWeight:r});return o.setKeys(t.map(Ug)),o.setSources(e),o.create(),o}function kE(t,{getFn:e=Lt.getFn,fieldNormWeight:n=Lt.fieldNormWeight}={}){const{keys:r,records:o}=t,i=new Od({getFn:e,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(o),i}function Ec(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:o=Lt.distance,ignoreLocation:i=Lt.ignoreLocation}={}){const a=e/t.length;if(i)return a;const s=Math.abs(r-n);return o?a+s/o:s?1:a}function xE(t=[],e=Lt.minMatchCharLength){let n=[],r=-1,o=-1,i=0;for(let a=t.length;i<a;i+=1){let s=t[i];s&&r===-1?r=i:!s&&r!==-1&&(o=i-1,o-r+1>=e&&n.push([r,o]),r=-1)}return t[i-1]&&i-r>=e&&n.push([r,i-1]),n}const xa=32;function jE(t,e,n,{location:r=Lt.location,distance:o=Lt.distance,threshold:i=Lt.threshold,findAllMatches:a=Lt.findAllMatches,minMatchCharLength:s=Lt.minMatchCharLength,includeMatches:l=Lt.includeMatches,ignoreLocation:c=Lt.ignoreLocation}={}){if(e.length>xa)throw new Error(pE(xa));const f=e.length,u=t.length,d=Math.max(0,Math.min(r,u));let h=i,p=d;const v=s>1||l,g=v?Array(u):[];let m;for(;(m=t.indexOf(e,p))>-1;){let A=Ec(e,{currentLocation:m,expectedLocation:d,distance:o,ignoreLocation:c});if(h=Math.min(A,h),p=m+f,v){let T=0;for(;T<f;)g[m+T]=1,T+=1}}p=-1;let y=[],b=1,w=f+u;const k=1<<f-1;for(let A=0;A<f;A+=1){let T=0,_=w;for(;T<_;)Ec(e,{errors:A,currentLocation:d+_,expectedLocation:d,distance:o,ignoreLocation:c})<=h?T=_:w=_,_=Math.floor((w-T)/2+T);w=_;let M=Math.max(1,d-_+1),$=a?u:Math.min(d+_,u)+f,F=Array($+2);F[$+1]=(1<<A)-1;for(let j=$;j>=M;j-=1){let z=j-1,Q=n[t.charAt(z)];if(v&&(g[z]=+!!Q),F[j]=(F[j+1]<<1|1)&Q,A&&(F[j]|=(y[j+1]|y[j])<<1|1|y[j+1]),F[j]&k&&(b=Ec(e,{errors:A,currentLocation:z,expectedLocation:d,distance:o,ignoreLocation:c}),b<=h)){if(h=b,p=z,p<=d)break;M=Math.max(1,2*d-p)}}if(Ec(e,{errors:A+1,currentLocation:d,expectedLocation:d,distance:o,ignoreLocation:c})>h)break;y=F}const C={isMatch:p>=0,score:Math.max(.001,b)};if(v){const A=xE(g,s);A.length?l&&(C.indices=A):C.isMatch=!1}return C}function _E(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const o=t.charAt(n);e[o]=(e[o]||0)|1<<r-n-1}return e}class Kg{constructor(e,{location:n=Lt.location,threshold:r=Lt.threshold,distance:o=Lt.distance,includeMatches:i=Lt.includeMatches,findAllMatches:a=Lt.findAllMatches,minMatchCharLength:s=Lt.minMatchCharLength,isCaseSensitive:l=Lt.isCaseSensitive,ignoreLocation:c=Lt.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:l,ignoreLocation:c},this.pattern=l?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const f=(d,h)=>{this.chunks.push({pattern:d,alphabet:_E(d),startIndex:h})},u=this.pattern.length;if(u>xa){let d=0;const h=u%xa,p=u-h;for(;d<p;)f(this.pattern.substr(d,xa),d),d+=xa;if(h){const v=u-xa;f(this.pattern.substr(v),v)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,includeMatches:r}=this.options;if(n||(e=e.toLowerCase()),this.pattern===e){let p={isMatch:!0,score:0};return r&&(p.indices=[[0,e.length-1]]),p}const{location:o,distance:i,threshold:a,findAllMatches:s,minMatchCharLength:l,ignoreLocation:c}=this.options;let f=[],u=0,d=!1;this.chunks.forEach(({pattern:p,alphabet:v,startIndex:g})=>{const{isMatch:m,score:y,indices:b}=jE(e,p,v,{location:o+g,distance:i,threshold:a,findAllMatches:s,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});m&&(d=!0),u+=y,m&&b&&(f=[...f,...b])});let h={isMatch:d,score:d?u/this.chunks.length:1};return d&&r&&(h.indices=f),h}}class qi{constructor(e){this.pattern=e}static isMultiMatch(e){return Qg(e,this.multiRegex)}static isSingleMatch(e){return Qg(e,this.singleRegex)}search(){}}function Qg(t,e){const n=t.match(e);return n?n[1]:null}class SE extends qi{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class CE extends qi{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class $E extends qi{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class OE extends qi{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class AE extends qi{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class EE extends qi{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class Yg extends qi{constructor(e,{location:n=Lt.location,threshold:r=Lt.threshold,distance:o=Lt.distance,includeMatches:i=Lt.includeMatches,findAllMatches:a=Lt.findAllMatches,minMatchCharLength:s=Lt.minMatchCharLength,isCaseSensitive:l=Lt.isCaseSensitive,ignoreLocation:c=Lt.ignoreLocation}={}){super(e),this._bitapSearch=new Kg(e,{location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Xg extends qi{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const o=[],i=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+i,o.push([r,n-1]);const a=!!o.length;return{isMatch:a,score:a?0:1,indices:o}}}const Ad=[SE,Xg,$E,OE,EE,AE,CE,Yg],Zg=Ad.length,PE=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,ME="|";function TE(t,e={}){return t.split(ME).map(n=>{let r=n.trim().split(PE).filter(i=>i&&!!i.trim()),o=[];for(let i=0,a=r.length;i<a;i+=1){const s=r[i];let l=!1,c=-1;for(;!l&&++c<Zg;){const f=Ad[c];let u=f.isMultiMatch(s);u&&(o.push(new f(u,e)),l=!0)}if(!l)for(c=-1;++c<Zg;){const f=Ad[c];let u=f.isSingleMatch(s);if(u){o.push(new f(u,e));break}}}return o})}const IE=new Set([Yg.type,Xg.type]);class NE{constructor(e,{isCaseSensitive:n=Lt.isCaseSensitive,includeMatches:r=Lt.includeMatches,minMatchCharLength:o=Lt.minMatchCharLength,ignoreLocation:i=Lt.ignoreLocation,findAllMatches:a=Lt.findAllMatches,location:s=Lt.location,threshold:l=Lt.threshold,distance:c=Lt.distance}={}){this.query=null,this.options={isCaseSensitive:n,includeMatches:r,minMatchCharLength:o,findAllMatches:a,ignoreLocation:i,location:s,threshold:l,distance:c},this.pattern=n?e:e.toLowerCase(),this.query=TE(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:o}=this.options;e=o?e:e.toLowerCase();let i=0,a=[],s=0;for(let l=0,c=n.length;l<c;l+=1){const f=n[l];a.length=0,i=0;for(let u=0,d=f.length;u<d;u+=1){const h=f[u],{isMatch:p,indices:v,score:g}=h.search(e);if(p){if(i+=1,s+=g,r){const m=h.constructor.type;IE.has(m)?a=[...a,...v]:a.push(v)}}else{s=0,i=0,a.length=0;break}}if(i){let u={isMatch:!0,score:s/i};return r&&(u.indices=a),u}}return{isMatch:!1,score:1}}}const Ed=[];function LE(...t){Ed.push(...t)}function Pd(t,e){for(let n=0,r=Ed.length;n<r;n+=1){let o=Ed[n];if(o.condition(t,e))return new o(t,e)}return new Kg(t,e)}const Pc={AND:"$and",OR:"$or"},Md={PATH:"$path",PATTERN:"$val"},Td=t=>!!(t[Pc.AND]||t[Pc.OR]),RE=t=>!!t[Md.PATH],DE=t=>!xi(t)&&Vg(t)&&!Td(t),e0=t=>({[Pc.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function t0(t,e,{auto:n=!0}={}){const r=o=>{let i=Object.keys(o);const a=RE(o);if(!a&&i.length>1&&!Td(o))return r(e0(o));if(DE(o)){const l=a?o[Md.PATH]:i[0],c=a?o[Md.PATTERN]:o[l];if(!Ko(c))throw new Error(hE(l));const f={keyId:$d(l),pattern:c};return n&&(f.searcher=Pd(c,e)),f}let s={children:[],operator:i[0]};return i.forEach(l=>{const c=o[l];xi(c)&&c.forEach(f=>{s.children.push(r(f))})}),s};return Td(t)||(t=e0(t)),r(t)}function zE(t,{ignoreFieldNorm:e=Lt.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:i,score:a})=>{const s=o?o.weight:null;r*=Math.pow(a===0&&s?Number.EPSILON:a,(s||1)*(e?1:i))}),n.score=r})}function BE(t,e){const n=t.matches;e.matches=[],Gr(n)&&n.forEach(r=>{if(!Gr(r.indices)||!r.indices.length)return;const{indices:o,value:i}=r;let a={indices:o,value:i};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),e.matches.push(a)})}function FE(t,e){e.score=t.score}function qE(t,e,{includeMatches:n=Lt.includeMatches,includeScore:r=Lt.includeScore}={}){const o=[];return n&&o.push(BE),r&&o.push(FE),t.map(i=>{const{idx:a}=i,s={item:e[a],refIndex:a};return o.length&&o.forEach(l=>{l(i,s)}),s})}class os{constructor(e,n={},r){this.options={...Lt,...n},this.options.useExtendedSearch,this._keyStore=new gE(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Od))throw new Error(dE);this._myIndex=n||Gg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){!Gr(e)||(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,o=this._docs.length;r<o;r+=1){const i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,o-=1,n.push(i))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:i,sortFn:a,ignoreFieldNorm:s}=this.options;let l=Ko(e)?Ko(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return zE(l,{ignoreFieldNorm:s}),i&&l.sort(a),qg(n)&&n>-1&&(l=l.slice(0,n)),qE(l,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(e){const n=Pd(e,this.options),{records:r}=this._myIndex,o=[];return r.forEach(({v:i,i:a,n:s})=>{if(!Gr(i))return;const{isMatch:l,score:c,indices:f}=n.searchIn(i);l&&o.push({item:i,idx:a,matches:[{score:c,value:i,norm:s,indices:f}]})}),o}_searchLogical(e){const n=t0(e,this.options),r=(s,l,c)=>{if(!s.children){const{keyId:u,searcher:d}=s,h=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(l,u),searcher:d});return h&&h.length?[{idx:c,item:l,matches:h}]:[]}const f=[];for(let u=0,d=s.children.length;u<d;u+=1){const h=s.children[u],p=r(h,l,c);if(p.length)f.push(...p);else if(s.operator===Pc.AND)return[]}return f},o=this._myIndex.records,i={},a=[];return o.forEach(({$:s,i:l})=>{if(Gr(s)){let c=r(n,s,l);c.length&&(i[l]||(i[l]={idx:l,item:s,matches:[]},a.push(i[l])),c.forEach(({matches:f})=>{i[l].matches.push(...f)}))}}),a}_searchObjectList(e){const n=Pd(e,this.options),{keys:r,records:o}=this._myIndex,i=[];return o.forEach(({$:a,i:s})=>{if(!Gr(a))return;let l=[];r.forEach((c,f)=>{l.push(...this._findMatches({key:c,value:a[f],searcher:n}))}),l.length&&i.push({idx:s,item:a,matches:l})}),i}_findMatches({key:e,value:n,searcher:r}){if(!Gr(n))return[];let o=[];if(xi(n))n.forEach(({v:i,i:a,n:s})=>{if(!Gr(i))return;const{isMatch:l,score:c,indices:f}=r.searchIn(i);l&&o.push({score:c,key:e,value:i,idx:a,norm:s,indices:f})});else{const{v:i,n:a}=n,{isMatch:s,score:l,indices:c}=r.searchIn(i);s&&o.push({score:l,key:e,value:i,norm:a,indices:c})}return o}}os.version="6.6.2",os.createIndex=Gg,os.parseIndex=kE,os.config=Lt,os.parseQuery=t0,LE(NE);var n0,r0,o0,i0,a0,s0,l0,c0,u0,f0,d0,h0,p0,v0,m0,g0,y0,b0,w0,k0,x0,j0,_0,S0,C0,$0,O0,A0,E0,P0,M0,T0,I0,N0,L0,R0,D0,z0,B0,F0,q0,V0,H0,W0,U0,J0,G0,K0,Q0,Y0,X0,Z0,ey,ty,ny,ry,oy,iy,ay,sy,ly,cy,uy,fy,dy,hy,py,vy,my,gy,yy,by,wy,ky,xy,jy,_y,Sy,Cy,$y,Oy,Ay,Ey,Py,My,Ty,Iy,Ny,Ly,Ry,Dy,zy,By,Fy,qy,Vy,Hy,Wy,Uy,Jy,Gy,Ky,Qy,Yy,Xy,Zy,e1,t1,n1,r1,o1,i1,a1,s1,l1,c1,u1,f1,d1,h1,p1,v1,m1,g1,y1,b1,w1,k1,x1,j1,_1,S1,C1,$1,O1,A1,E1,P1,M1,T1,I1,N1,L1,R1,D1,z1,B1,F1,q1,V1,H1,W1,U1,J1,G1,K1,Q1,Y1,X1,Z1,eb,tb,nb,rb,ob,ib,ab,sb,lb,cb,ub,fb,db,hb,pb,vb,mb,gb,yb,bb,wb,kb,xb,jb,_b,Sb,Cb,$b,Ob,Ab,Eb,Pb,Mb,Tb,Ib,Nb,Lb,Rb,Db,zb,Bb,Fb,qb,Vb,Hb,Wb,Ub,Jb,Gb,Kb,Qb,Yb,Xb,Zb,ew,tw,nw,rw,ow,iw,aw,sw,lw,cw,uw,fw,dw,hw,pw,vw,mw,gw,yw,bw,ww,kw,xw,jw,_w,Sw,Cw,$w,Ow,Aw,Ew,Pw,Mw,Tw,Iw,Nw,Lw,Rw,Dw,zw,Bw,Fw,qw,Vw,Hw,Ww,Uw,Jw,Gw,Kw,Qw,Yw,Xw,Zw,ek,tk,nk,rk,ok,ik,ak,sk,lk,ck,uk,fk,dk,hk;function Mc(t){var e=typeof Map=="function"?new Map:void 0;return(Mc=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,o)}function o(){return pk(n,arguments,Kt(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Tc(o,n)})(t)}function pk(t,e,n){return(pk=gk()?Reflect.construct.bind():function(r,o,i){var a=[null];a.push.apply(a,o);var s=new(Function.bind.apply(r,a));return i&&Tc(s,i.prototype),s}).apply(null,arguments)}function ne(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function pt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=typeof Symbol=="function"?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(M,$,F){return Object.defineProperty(M,$,{value:F,enumerable:!0,configurable:!0,writable:!0}),M[$]}try{s({},"")}catch{s=function($,F,S){return $[F]=S}}function l(M,$,F,S){var j=$&&$.prototype instanceof u?$:u,z=Object.create(j.prototype),Q=new A(S||[]);return z._invoke=function(B,K,R){var N="suspendedStart";return function(H,q){if(N==="executing")throw new Error("Generator is already running");if(N==="completed"){if(H==="throw")throw q;return _()}for(R.method=H,R.arg=q;;){var D=R.delegate;if(D){var O=w(D,R);if(O){if(O===f)continue;return O}}if(R.method==="next")R.sent=R._sent=R.arg;else if(R.method==="throw"){if(N==="suspendedStart")throw N="completed",R.arg;R.dispatchException(R.arg)}else R.method==="return"&&R.abrupt("return",R.arg);N="executing";var x=c(B,K,R);if(x.type==="normal"){if(N=R.done?"completed":"suspendedYield",x.arg===f)continue;return{value:x.arg,done:R.done}}x.type==="throw"&&(N="completed",R.method="throw",R.arg=x.arg)}}}(M,F,Q),z}function c(M,$,F){try{return{type:"normal",arg:M.call($,F)}}catch(S){return{type:"throw",arg:S}}}t.wrap=l;var f={};function u(){}function d(){}function h(){}var p={};s(p,o,function(){return this});var v=Object.getPrototypeOf,g=v&&v(v(T([])));g&&g!==e&&n.call(g,o)&&(p=g);var m=h.prototype=u.prototype=Object.create(p);function y(M){["next","throw","return"].forEach(function($){s(M,$,function(F){return this._invoke($,F)})})}function b(M,$){function F(j,z,Q,B){var K=c(M[j],M,z);if(K.type!=="throw"){var R=K.arg,N=R.value;return N&&it(N)=="object"&&n.call(N,"__await")?$.resolve(N.__await).then(function(H){F("next",H,Q,B)},function(H){F("throw",H,Q,B)}):$.resolve(N).then(function(H){R.value=H,Q(R)},function(H){return F("throw",H,Q,B)})}B(K.arg)}var S;this._invoke=function(j,z){function Q(){return new $(function(B,K){F(j,z,B,K)})}return S=S?S.then(Q,Q):Q()}}function w(M,$){var F=M.iterator[$.method];if(F===void 0){if($.delegate=null,$.method==="throw"){if(M.iterator.return&&($.method="return",$.arg=void 0,w(M,$),$.method==="throw"))return f;$.method="throw",$.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var S=c(F,M.iterator,$.arg);if(S.type==="throw")return $.method="throw",$.arg=S.arg,$.delegate=null,f;var j=S.arg;return j?j.done?($[M.resultName]=j.value,$.next=M.nextLoc,$.method!=="return"&&($.method="next",$.arg=void 0),$.delegate=null,f):j:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,f)}function k(M){var $={tryLoc:M[0]};1 in M&&($.catchLoc=M[1]),2 in M&&($.finallyLoc=M[2],$.afterLoc=M[3]),this.tryEntries.push($)}function C(M){var $=M.completion||{};$.type="normal",delete $.arg,M.completion=$}function A(M){this.tryEntries=[{tryLoc:"root"}],M.forEach(k,this),this.reset(!0)}function T(M){if(M){var $=M[o];if($)return $.call(M);if(typeof M.next=="function")return M;if(!isNaN(M.length)){var F=-1,S=function j(){for(;++F<M.length;)if(n.call(M,F))return j.value=M[F],j.done=!1,j;return j.value=void 0,j.done=!0,j};return S.next=S}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=h,s(m,"constructor",h),s(h,"constructor",d),d.displayName=s(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(M){var $=typeof M=="function"&&M.constructor;return!!$&&($===d||($.displayName||$.name)==="GeneratorFunction")},t.mark=function(M){return Object.setPrototypeOf?Object.setPrototypeOf(M,h):(M.__proto__=h,s(M,a,"GeneratorFunction")),M.prototype=Object.create(m),M},t.awrap=function(M){return{__await:M}},y(b.prototype),s(b.prototype,i,function(){return this}),t.AsyncIterator=b,t.async=function(M,$,F,S,j){j===void 0&&(j=Promise);var z=new b(l(M,$,F,S),j);return t.isGeneratorFunction($)?z:z.next().then(function(Q){return Q.done?Q.value:z.next()})},y(m),s(m,a,"Generator"),s(m,o,function(){return this}),s(m,"toString",function(){return"[object Generator]"}),t.keys=function(M){var $=[];for(var F in M)$.push(F);return $.reverse(),function S(){for(;$.length;){var j=$.pop();if(j in M)return S.value=j,S.done=!1,S}return S.done=!0,S}},t.values=T,A.prototype={constructor:A,reset:function(M){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!M)for(var $ in this)$.charAt(0)==="t"&&n.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=void 0)},stop:function(){this.done=!0;var M=this.tryEntries[0].completion;if(M.type==="throw")throw M.arg;return this.rval},dispatchException:function(M){if(this.done)throw M;var $=this;function F(K,R){return z.type="throw",z.arg=M,$.next=K,R&&($.method="next",$.arg=void 0),!!R}for(var S=this.tryEntries.length-1;S>=0;--S){var j=this.tryEntries[S],z=j.completion;if(j.tryLoc==="root")return F("end");if(j.tryLoc<=this.prev){var Q=n.call(j,"catchLoc"),B=n.call(j,"finallyLoc");if(Q&&B){if(this.prev<j.catchLoc)return F(j.catchLoc,!0);if(this.prev<j.finallyLoc)return F(j.finallyLoc)}else if(Q){if(this.prev<j.catchLoc)return F(j.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<j.finallyLoc)return F(j.finallyLoc)}}}},abrupt:function(M,$){for(var F=this.tryEntries.length-1;F>=0;--F){var S=this.tryEntries[F];if(S.tryLoc<=this.prev&&n.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var j=S;break}}j&&(M==="break"||M==="continue")&&j.tryLoc<=$&&$<=j.finallyLoc&&(j=null);var z=j?j.completion:{};return z.type=M,z.arg=$,j?(this.method="next",this.next=j.finallyLoc,f):this.complete(z)},complete:function(M,$){if(M.type==="throw")throw M.arg;return M.type==="break"||M.type==="continue"?this.next=M.arg:M.type==="return"?(this.rval=this.arg=M.arg,this.method="return",this.next="end"):M.type==="normal"&&$&&(this.next=$),f},finish:function(M){for(var $=this.tryEntries.length-1;$>=0;--$){var F=this.tryEntries[$];if(F.finallyLoc===M)return this.complete(F.completion,F.afterLoc),C(F),f}},catch:function(M){for(var $=this.tryEntries.length-1;$>=0;--$){var F=this.tryEntries[$];if(F.tryLoc===M){var S=F.completion;if(S.type==="throw"){var j=S.arg;C(F)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(M,$,F){return this.delegate={iterator:T(M),resultName:$,nextLoc:F},this.method==="next"&&(this.arg=void 0),f}},t}function vk(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,o)}function xn(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(l){vk(i,r,o,a,s,"next",l)}function s(l){vk(i,r,o,a,s,"throw",l)}a(void 0)})}}function le(t,e){var n=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Id(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
8
|
+
*/(function(t,e){(function(n,r){t.exports=r()})(Dr,function(){function n(ye){var Ce=typeof ye;return ye!==null&&(Ce==="object"||Ce==="function")}function r(ye){return typeof ye=="function"}var o=void 0;Array.isArray?o=Array.isArray:o=function(ye){return Object.prototype.toString.call(ye)==="[object Array]"};var i=o,a=0,s=void 0,l=void 0,c=function(Ce,De){C[a]=Ce,C[a+1]=De,a+=2,a===2&&(l?l(A):_())};function f(ye){l=ye}function u(ye){c=ye}var d=typeof window!="undefined"?window:void 0,h=d||{},p=h.MutationObserver||h.WebKitMutationObserver,v=typeof self=="undefined"&&typeof process!="undefined"&&{}.toString.call(process)==="[object process]",g=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function m(){return function(){return process.nextTick(A)}}function y(){return typeof s!="undefined"?function(){s(A)}:k()}function b(){var ye=0,Ce=new p(A),De=document.createTextNode("");return Ce.observe(De,{characterData:!0}),function(){De.data=ye=++ye%2}}function w(){var ye=new MessageChannel;return ye.port1.onmessage=A,function(){return ye.port2.postMessage(0)}}function k(){var ye=setTimeout;return function(){return ye(A,1)}}var C=new Array(1e3);function A(){for(var ye=0;ye<a;ye+=2){var Ce=C[ye],De=C[ye+1];Ce(De),C[ye]=void 0,C[ye+1]=void 0}a=0}function T(){try{var ye=Function("return this")().require("vertx");return s=ye.runOnLoop||ye.runOnContext,y()}catch{return k()}}var _=void 0;v?_=m():p?_=b():g?_=w():d===void 0&&typeof U8=="function"?_=T():_=k();function M(ye,Ce){var De=this,ge=new this.constructor(S);ge[F]===void 0&&se(ge);var ze=De._state;if(ze){var Ke=arguments[ze-1];c(function(){return ke(ze,ge,Ke,De._result)})}else U(De,ge,ye,Ce);return ge}function $(ye){var Ce=this;if(ye&&typeof ye=="object"&&ye.constructor===Ce)return ye;var De=new Ce(S);return D(De,ye),De}var F=Math.random().toString(36).substring(2);function S(){}var j=void 0,z=1,Q=2;function B(){return new TypeError("You cannot resolve a promise with itself")}function K(){return new TypeError("A promises callback cannot return that same promise.")}function R(ye,Ce,De,ge){try{ye.call(Ce,De,ge)}catch(ze){return ze}}function N(ye,Ce,De){c(function(ge){var ze=!1,Ke=R(De,Ce,function(mt){ze||(ze=!0,Ce!==mt?D(ge,mt):x(ge,mt))},function(mt){ze||(ze=!0,I(ge,mt))},"Settle: "+(ge._label||" unknown promise"));!ze&&Ke&&(ze=!0,I(ge,Ke))},ye)}function H(ye,Ce){Ce._state===z?x(ye,Ce._result):Ce._state===Q?I(ye,Ce._result):U(Ce,void 0,function(De){return D(ye,De)},function(De){return I(ye,De)})}function q(ye,Ce,De){Ce.constructor===ye.constructor&&De===M&&Ce.constructor.resolve===$?H(ye,Ce):De===void 0?x(ye,Ce):r(De)?N(ye,Ce,De):x(ye,Ce)}function D(ye,Ce){if(ye===Ce)I(ye,B());else if(n(Ce)){var De=void 0;try{De=Ce.then}catch(ge){I(ye,ge);return}q(ye,Ce,De)}else x(ye,Ce)}function O(ye){ye._onerror&&ye._onerror(ye._result),ie(ye)}function x(ye,Ce){ye._state===j&&(ye._result=Ce,ye._state=z,ye._subscribers.length!==0&&c(ie,ye))}function I(ye,Ce){ye._state===j&&(ye._state=Q,ye._result=Ce,c(O,ye))}function U(ye,Ce,De,ge){var ze=ye._subscribers,Ke=ze.length;ye._onerror=null,ze[Ke]=Ce,ze[Ke+z]=De,ze[Ke+Q]=ge,Ke===0&&ye._state&&c(ie,ye)}function ie(ye){var Ce=ye._subscribers,De=ye._state;if(Ce.length!==0){for(var ge=void 0,ze=void 0,Ke=ye._result,mt=0;mt<Ce.length;mt+=3)ge=Ce[mt],ze=Ce[mt+De],ge?ke(De,ge,ze,Ke):ze(Ke);ye._subscribers.length=0}}function ke(ye,Ce,De,ge){var ze=r(De),Ke=void 0,mt=void 0,nn=!0;if(ze){try{Ke=De(ge)}catch(cn){nn=!1,mt=cn}if(Ce===Ke){I(Ce,K());return}}else Ke=ge;Ce._state!==j||(ze&&nn?D(Ce,Ke):nn===!1?I(Ce,mt):ye===z?x(Ce,Ke):ye===Q&&I(Ce,Ke))}function _e(ye,Ce){try{Ce(function(ge){D(ye,ge)},function(ge){I(ye,ge)})}catch(De){I(ye,De)}}var L=0;function J(){return L++}function se(ye){ye[F]=L++,ye._state=void 0,ye._result=void 0,ye._subscribers=[]}function ae(){return new Error("Array Methods must be provided an Array")}var ve=function(){function ye(Ce,De){this._instanceConstructor=Ce,this.promise=new Ce(S),this.promise[F]||se(this.promise),i(De)?(this.length=De.length,this._remaining=De.length,this._result=new Array(this.length),this.length===0?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(De),this._remaining===0&&x(this.promise,this._result))):I(this.promise,ae())}return ye.prototype._enumerate=function(De){for(var ge=0;this._state===j&&ge<De.length;ge++)this._eachEntry(De[ge],ge)},ye.prototype._eachEntry=function(De,ge){var ze=this._instanceConstructor,Ke=ze.resolve;if(Ke===$){var mt=void 0,nn=void 0,cn=!1;try{mt=De.then}catch(Z){cn=!0,nn=Z}if(mt===M&&De._state!==j)this._settledAt(De._state,ge,De._result);else if(typeof mt!="function")this._remaining--,this._result[ge]=De;else if(ze===qe){var Mn=new ze(S);cn?I(Mn,nn):q(Mn,De,mt),this._willSettleAt(Mn,ge)}else this._willSettleAt(new ze(function(Z){return Z(De)}),ge)}else this._willSettleAt(Ke(De),ge)},ye.prototype._settledAt=function(De,ge,ze){var Ke=this.promise;Ke._state===j&&(this._remaining--,De===Q?I(Ke,ze):this._result[ge]=ze),this._remaining===0&&x(Ke,this._result)},ye.prototype._willSettleAt=function(De,ge){var ze=this;U(De,void 0,function(Ke){return ze._settledAt(z,ge,Ke)},function(Ke){return ze._settledAt(Q,ge,Ke)})},ye}();function Se(ye){return new ve(this,ye).promise}function ue(ye){var Ce=this;return i(ye)?new Ce(function(De,ge){for(var ze=ye.length,Ke=0;Ke<ze;Ke++)Ce.resolve(ye[Ke]).then(De,ge)}):new Ce(function(De,ge){return ge(new TypeError("You must pass an array to race."))})}function Y(ye){var Ce=this,De=new Ce(S);return I(De,ye),De}function Ve(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ge(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var qe=function(){function ye(Ce){this[F]=J(),this._result=this._state=void 0,this._subscribers=[],S!==Ce&&(typeof Ce!="function"&&Ve(),this instanceof ye?_e(this,Ce):Ge())}return ye.prototype.catch=function(De){return this.then(null,De)},ye.prototype.finally=function(De){var ge=this,ze=ge.constructor;return r(De)?ge.then(function(Ke){return ze.resolve(De()).then(function(){return Ke})},function(Ke){return ze.resolve(De()).then(function(){throw Ke})}):ge.then(De,De)},ye}();qe.prototype.then=M,qe.all=Se,qe.race=ue,qe.resolve=$,qe.reject=Y,qe._setScheduler=f,qe._setAsap=u,qe._asap=c;function Ee(){var ye=void 0;if(typeof Dr!="undefined")ye=Dr;else if(typeof self!="undefined")ye=self;else try{ye=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var Ce=ye.Promise;if(Ce){var De=null;try{De=Object.prototype.toString.call(Ce.resolve())}catch{}if(De==="[object Promise]"&&!Ce.cast)return}ye.Promise=qe}return qe.polyfill=Ee,qe.Promise=qe,qe})})(Ag),Ag.exports.polyfill();var VG=(()=>`/*! @import *//*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com */*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.gap-4{gap:1rem}.border{border-width:1px}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.italic{font-style:italic}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--font-family: "Helvetica", sans-serif, "Arial", "sans-serif";--bg-color: #131720;--text-color: #d9e1f2;--primary: hsl(255, 30%, 55%);--focus: hsl(210, 90%, 50%);--secondary: #42b983;--border-color: hsla(0, 0%, 100%, .2);--light-1: hsl(210, 30%, 40%);--light-2: hsl(255, 30%, 50%);--light-background: linear-gradient(to right, var(--light-1), var(--light-2));--shadow-1: hsla(236, 50%, 50%, .3);--shadow-2: hsla(236, 50%, 50%, .4);--hud-background: rgba(0, 0, 0, .4);--hud-text-color: var(--text-color);--notifications-bg: darkslateblue;--skills-text-background: rgba(0, 0, 0, .5);--skills-text-color: var(--text-color);--skills-level-background: rgba(0, 0, 0, .5);--skills-level-color: orange;--skills-xp-bar-height: 40px;--skill-check-name-color: orange;--skill-check-difficulty: orange;--skill-check-success: green;--skill-check-failed: red;--skill-check-color: orange;--dialog-choice-color: orange;--dialog-choice-hover-color: var(--text-color);--inventory-text-background: rgba(0, 0, 0, .5);--inventory-text-color: var(--text-color);--inventory-amount-background: rgba(0, 0, 0, .5);--inventory-amount-color: orange;--quest-title-color: yellow;--completed-quest-title-color: grey;--objective-in-progress-color: white;--objective-completed-color: grey}body,*{font-family:var(--font-family)}.list-item{display:inline-block;margin-right:10px}.list-enter-active,.list-leave-active{transition:all .3s ease}#app{background-size:cover}.list-enter-from,.list-leave-to{opacity:0;transform:translate(300px)}.notification-item{display:inline-block;margin-right:10px}.notification-enter-active,.notification-leave-active{transition:all .3s ease}.notification-enter-from,.notification-leave-to{opacity:0;transform:translateY(-300px)}.fade-enter-active,.fade-leave-active{transition:opacity .3s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-in-enter-active{transition:opacity .1s ease}.fade-in-enter-from{opacity:0}body{padding:0;margin:0;font-family:Arial,sans-serif;background-color:#000}.select{background:var(--light-background);padding:10px}.option{background-color:var(--light-2);padding:5px;color:var(--text-color)}.button{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .5rem 2.4rem .2rem var(--shadow-1),inset -2px -4px #0006,inset 2px 2px #fff7;border-radius:10px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s;box-shadow:inset -2px -4px #0006,inset 2px 2px #fff7}.button.large{border-radius:20px}.menu-button{border-radius:5px}.button.main-menu-button{border-radius:20px}.button:focus,.button:hover{transform:translateY(-.2rem);box-shadow:0 0 1rem .2rem var(--shadow-2),inset -2px -4px #0006,inset 2px 2px #fff7}.disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.button.disabled{box-shadow:unset;color:gray;background:var(--border-color)}.input{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .4rem 2.4rem .2rem var(--shadow-1);border-radius:100px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s}.input:focus,.input:hover{transform:translateY(-.2rem);box-shadow:0 0 2.4rem .2rem var(--shadow-2)}a{color:pink;text-decoration:underline}th,td{padding:4px;border:1px solid var(--text-color);text-align:center}#game-holder{width:100vw;height:100vh;padding:0;margin:0;top:0;left:0;background-color:#000;display:flex;align-items:center;justify-content:center;min-height:-webkit-fill-available}.title{font-size:30px;font-weight:700;text-align:center}.container{padding:20px}h1,h2,h3,h4{font-weight:700}h1{font-size:30px}h2{font-size:26px}h3{font-size:24px}hr.solid{border:1px solid var(--text-color);margin-top:30px;margin-bottom:30px}.card-1{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;transition:all .3s cubic-bezier(.25,.8,.25,1)}.card-1:hover{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-2{box-shadow:0 3px 6px #00000029,0 3px 6px #0000003b}.card-3{box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b}.card-4{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-5{box-shadow:0 19px 38px #0000004d,0 15px 12px #00000038}.dialog-choice{transition:.2s}.dialog-choice:hover{transform:scale(1.05);transform-origin:center}.dialog-choice:not(:hover)>.skill-check-name,.passive-skill-check>.skill-check-name{color:var(--skill-check-name-color)}.dialog-choice:not(:hover)>.skill-check-difficulty,.passive-skill-check>.skill-check-difficulty{color:var(--skill-check-difficulty)}.skill-check-difficulty{font-weight:700}.dialog-choice:not(:hover)>.skill-check-success,.passive-skill-check>.skill-check-success{color:var(--skill-check-success)}.dialog-choice:not(:hover)>.skill-check-failed,.passive-skill-check>.skill-check-failed{color:var(--skill-check-failed)}.dialog-choice:not(:hover)>.skill-check,.passive-skill-check.skill-check{color:var(--skill-check-color)}.narrat-canvas{position:absolute;height:100%;top:0;left:0}#touchTrigger{pointer-events:none}
|
|
9
|
+
`)();const Eg=P.ref([]),Pg=P.ref(null),Mg=P.ref(null),Tg=P.ref(null),Jr=P.reactive({current:""}),kd=[],J8=P.ref(!1),xd=P.readonly(Eg),G8=P.readonly(Pg),K8=P.readonly(Mg),Q8=P.readonly(Tg),Y8=P.readonly(Jr),Ig=(t=G8.value)=>{Jr.current=t;const e=xd.value.findIndex(r=>r.name===t),n=xd.value.map(r=>r.name);for(let r=0;r<n.length;r++){if(r>0&&r<n.length-1){const o=n[r]+"Minus",i=n[r]+"Plus";Jr[o]=e<=r,Jr[i]=e>=r}Jr[n[r]]=n[r]===t}},Ng=(t=K8.value)=>{Jr.orientation=t,Jr.isLandscape=t==="landscape",Jr.isPortrait=t==="portrait"},Lg=(t=Q8.value||"light")=>{Jr.theme=t,Jr.isDark=t==="dark",Jr.isLight=t==="light"};function jd(t,e){if(typeof window=="undefined"||!window.matchMedia)return!1;if(typeof window!="undefined"&&!window.matchMedia)return console.error("Vue3 Mq: No MatchMedia support detected in this browser. Responsive breakpoints not available."),!1;{J8.value=!0;const n=window.matchMedia(t),r=({matches:o})=>{o&&e()};kd.push({mql:n,cb:r}),n.addEventListener&&typeof n.addEventListener=="function"?n.addEventListener("change",r):n.addListener(r),r(n)}}var _d=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",bootstrap5:{xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},bootstrap4:{xs:0,sm:576,md:768,lg:992,xl:1200},bootstrap3:{xs:0,sm:768,md:992,lg:1200},vuetify:{xs:0,sm:600,md:960,lg:1264,xl:1904},tailwind:{xs:0,sm:640,md:768,lg:1024,xl:1280,xxl:1536},devices:{phone:0,tablet:768,laptop:1370,desktop:1906}});const Rg=t=>{if(!t||typeof t!="object")return!1;const e=[];for(let n in t){const r=parseFloat(t[n]);n&&typeof n=="string"?/^[^a-z]/i.test(n)||/[^a-zA-Z0-9_]/.test(n)?console.warn(`Vue3 Mq: "${n}" is an invalid breakpoint key. Breakpoint keys must start with a letter and contain only alphanumeric characters and underscores. Skipping.`):!r&&r!==0||isNaN(r)||r<0?console.warn(`Vue3 Mq: "${n}: ${t[n]}" is not a valid breakpoint. Breakpoints should be a number of zero or above. Skipping.`):e.push({name:n,min:r}):console.warn(`Vue3 Mq: Invalid or missing breakpoint key (${JSON.stringify(n)}). Skipping.`)}return e.some(n=>n.min===0)||console.warn("Vue3 Mq: You have not declared a breakpoint with a minimum value of 0. There may be screen sizes to which Vue3Mq does not respond."),new Set(e.map(n=>n.min)).size<e.length&&console.warn("Vue3 Mq: Your breakpoint configuration contains duplicate values. Behaviour may be unpredictable."),e.length!==0&&e.sort((n,r)=>n.min-r.min)};function Dg({breakpoints:t,preset:e}){const n=(a=>{if(typeof a=="string"&&_d[a])return _d[a];{const s=Object.keys(_d);return console.error(`Vue3 Mq: "${a}" is not a valid preset. Available options are: ${s.join(", ")}`),!1}})(e),r=Rg(t);if(n===!1&&!r)throw new TypeError("Vue3 Mq: You must provide a valid preset, or valid breakpoint settings.");var o;o=r||Rg(n),Eg.value=o,function(){for(;kd.length>0;){const a=kd.shift();if(a&&typeof a=="object"){const{mql:s,cb:l}=a;s.addEventListener&&typeof s.addEventListener=="function"?s.removeEventListener("change",l):s.removeListener(l)}}}(),(()=>{const a=Object.keys(Jr);for(let s of a)delete Jr[s];Ig(),Ng(),Lg()})();const i=xd.value.reduce((a,s,l,c)=>{const f=`(min-width: ${s.min}px)`,u=l<c.length-1?`(max-width: ${c[l+1].min-1}px)`:null,d=f+(u?" and "+u:"");return Object.assign(a,{[s.name]:d})},{});for(const a in i)jd(i[a],()=>{Ig(a)});["portrait","landscape"].forEach(a=>{jd(`(orientation: ${a})`,()=>{Ng(a)})}),["light","dark"].forEach(a=>{jd(`(prefers-color-scheme: ${a})`,()=>{Lg(a)})})}var X8={install:(t,{preset:e="bootstrap5",breakpoints:n,defaultBreakpoint:r,defaultOrientation:o="landscape",defaultTheme:i}={})=>{try{const l=["landscape","portrait"].includes(s=o)===!1?(console.error(`Vue3 Mq: "${s}" is not a valid default orientation. Reverting to unset value.`),null):s,c=((f=null)=>["dark","light"].includes(f)===!1&&f!==null?(console.error(`Vue3 Mq: "${f}" is not a valid default theme. Reverting to unset value.`),null):f)(i);a=r,Pg.value=a,(f=>{Mg.value=f})(l),(f=>{Tg.value=f})(c),t.provide("mq",Y8),t.provide("updateBreakpoints",Dg),Dg({breakpoints:n,preset:e})}catch(l){console.error(l)}var a,s}};class zg{constructor(){Go(this,"debug");Go(this,"logger",{log:()=>{}})}setupDebugger(e){this.debug=e,e&&(this.logger.log=console.log.bind(window.console))}}const Bg=new zg,Co=Bg.logger;function Sd(t,e){return Date.now()-t+e}function Fg(t){const e=parseInt(t,10);let n=Math.floor(e/3600),r=Math.floor((e-n*3600)/60),o=e-n*3600-r*60;return n<10&&(n="0"+n),r<10&&(r="0"+r),o<10&&(o="0"+o),n+":"+r+":"+o}var HG=(()=>`.modal-mask{position:absolute;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;transition:opacity .3s ease;display:flex;flex-direction:column;flex-shrink:2 2;align-items:center;justify-content:center}.modal-container{min-width:300px;max-width:90vw;max-height:100%;overflow-y:hidden;margin:10px auto;padding:20px 30px;border-radius:5px;transition:all .3s ease;font-family:Helvetica,Arial,sans-serif;background:linear-gradient(to right,hsl(210,30%,20%),hsl(255,30%,25%));display:flex;flex-direction:column}.modal-header{position:relative}.modal-header h3{flex-shrink:0;margin-top:0;color:var(--secondary)}.modal-body{margin:20px 0;overflow-y:auto;flex-shrink:2}.modal-default-button{float:right}.modal-enter,.modal-leave-active{opacity:0}.modal-enter .modal-container,.modal-leave-active .modal-container{transform:scale(1.1)}.close-button{border:1px solid var(--text-color);border-radius:50px;font-size:30px;font-weight:700;position:absolute;right:-20px;top:-10px;width:50px;height:50px}.close-button:hover{background-color:var(--focus)}
|
|
10
|
+
`)(),zr=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n};const Z8=P.defineComponent({props:{containerCssClass:String}}),eE={class:"modal-header"},tE=P.createTextVNode(" default header "),nE=P.createElementVNode("hr",{class:"solid"},null,-1),rE={class:"modal-body"},oE=P.createTextVNode(" default body "),iE={class:"modal-footer"};function aE(t,e,n,r,o,i){return P.openBlock(),P.createBlock(P.Transition,{name:"modal"},{default:P.withCtx(()=>[P.createElementVNode("div",{class:"modal-mask",onClick:e[2]||(e[2]=a=>t.$emit("close"))},[P.createElementVNode("div",{class:P.normalizeClass(["modal-container bg-gray-800 card-4",t.containerCssClass]),onClick:e[1]||(e[1]=a=>a.stopPropagation())},[P.createElementVNode("div",eE,[P.createElementVNode("button",{class:"close-button",onClick:e[0]||(e[0]=a=>t.$emit("close"))},"X"),P.renderSlot(t.$slots,"header",{},()=>[tE]),nE]),P.createElementVNode("div",rE,[P.renderSlot(t.$slots,"body",{},()=>[oE])]),P.createElementVNode("div",iE,[P.renderSlot(t.$slots,"footer")])],2)])]),_:3})}var tl=zr(Z8,[["render",aE]]);function xi(t){return Array.isArray?Array.isArray(t):Hg(t)==="[object Array]"}const sE=1/0;function lE(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-sE?"-0":e}function cE(t){return t==null?"":lE(t)}function Ko(t){return typeof t=="string"}function qg(t){return typeof t=="number"}function uE(t){return t===!0||t===!1||fE(t)&&Hg(t)=="[object Boolean]"}function Vg(t){return typeof t=="object"}function fE(t){return Vg(t)&&t!==null}function Gr(t){return t!=null}function Cd(t){return!t.trim().length}function Hg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const WG="Extended search is not available",dE="Incorrect 'index' type",hE=t=>`Invalid value for key ${t}`,pE=t=>`Pattern length exceeds max of ${t}.`,vE=t=>`Missing ${t} property in key`,mE=t=>`Property 'weight' in key '${t}' must be a positive integer`,Wg=Object.prototype.hasOwnProperty;class gE{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let o=Ug(r);n+=o.weight,this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ug(t){let e=null,n=null,r=null,o=1,i=null;if(Ko(t)||xi(t))r=t,e=Jg(t),n=$d(t);else{if(!Wg.call(t,"name"))throw new Error(vE("name"));const a=t.name;if(r=a,Wg.call(t,"weight")&&(o=t.weight,o<=0))throw new Error(mE(a));e=Jg(a),n=$d(a),i=t.getFn}return{path:e,id:n,weight:o,src:r,getFn:i}}function Jg(t){return xi(t)?t:t.split(".")}function $d(t){return xi(t)?t.join("."):t}function yE(t,e){let n=[],r=!1;const o=(i,a,s)=>{if(!!Gr(i))if(!a[s])n.push(i);else{let l=a[s];const c=i[l];if(!Gr(c))return;if(s===a.length-1&&(Ko(c)||qg(c)||uE(c)))n.push(cE(c));else if(xi(c)){r=!0;for(let f=0,u=c.length;f<u;f+=1)o(c[f],a,s+1)}else a.length&&o(c,a,s+1)}};return o(t,Ko(e)?e.split("."):e,0),r?n:n[0]}var Lt={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:yE,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const bE=/[^ ]+/g;function wE(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(o){const i=o.match(bE).length;if(n.has(i))return n.get(i);const a=1/Math.pow(i,.5*t),s=parseFloat(Math.round(a*r)/r);return n.set(i,s),s},clear(){n.clear()}}}class Od{constructor({getFn:e=Lt.getFn,fieldNormWeight:n=Lt.fieldNormWeight}={}){this.norm=wE(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ko(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();Ko(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!Gr(e)||Cd(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((o,i)=>{let a=o.getFn?o.getFn(e):this.getFn(e,o.path);if(!!Gr(a)){if(xi(a)){let s=[];const l=[{nestedArrIndex:-1,value:a}];for(;l.length;){const{nestedArrIndex:c,value:f}=l.pop();if(!!Gr(f))if(Ko(f)&&!Cd(f)){let u={v:f,i:c,n:this.norm.get(f)};s.push(u)}else xi(f)&&f.forEach((u,d)=>{l.push({nestedArrIndex:d,value:u})})}r.$[i]=s}else if(Ko(a)&&!Cd(a)){let s={v:a,n:this.norm.get(a)};r.$[i]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function Gg(t,e,{getFn:n=Lt.getFn,fieldNormWeight:r=Lt.fieldNormWeight}={}){const o=new Od({getFn:n,fieldNormWeight:r});return o.setKeys(t.map(Ug)),o.setSources(e),o.create(),o}function kE(t,{getFn:e=Lt.getFn,fieldNormWeight:n=Lt.fieldNormWeight}={}){const{keys:r,records:o}=t,i=new Od({getFn:e,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(o),i}function Ec(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:o=Lt.distance,ignoreLocation:i=Lt.ignoreLocation}={}){const a=e/t.length;if(i)return a;const s=Math.abs(r-n);return o?a+s/o:s?1:a}function xE(t=[],e=Lt.minMatchCharLength){let n=[],r=-1,o=-1,i=0;for(let a=t.length;i<a;i+=1){let s=t[i];s&&r===-1?r=i:!s&&r!==-1&&(o=i-1,o-r+1>=e&&n.push([r,o]),r=-1)}return t[i-1]&&i-r>=e&&n.push([r,i-1]),n}const xa=32;function jE(t,e,n,{location:r=Lt.location,distance:o=Lt.distance,threshold:i=Lt.threshold,findAllMatches:a=Lt.findAllMatches,minMatchCharLength:s=Lt.minMatchCharLength,includeMatches:l=Lt.includeMatches,ignoreLocation:c=Lt.ignoreLocation}={}){if(e.length>xa)throw new Error(pE(xa));const f=e.length,u=t.length,d=Math.max(0,Math.min(r,u));let h=i,p=d;const v=s>1||l,g=v?Array(u):[];let m;for(;(m=t.indexOf(e,p))>-1;){let A=Ec(e,{currentLocation:m,expectedLocation:d,distance:o,ignoreLocation:c});if(h=Math.min(A,h),p=m+f,v){let T=0;for(;T<f;)g[m+T]=1,T+=1}}p=-1;let y=[],b=1,w=f+u;const k=1<<f-1;for(let A=0;A<f;A+=1){let T=0,_=w;for(;T<_;)Ec(e,{errors:A,currentLocation:d+_,expectedLocation:d,distance:o,ignoreLocation:c})<=h?T=_:w=_,_=Math.floor((w-T)/2+T);w=_;let M=Math.max(1,d-_+1),$=a?u:Math.min(d+_,u)+f,F=Array($+2);F[$+1]=(1<<A)-1;for(let j=$;j>=M;j-=1){let z=j-1,Q=n[t.charAt(z)];if(v&&(g[z]=+!!Q),F[j]=(F[j+1]<<1|1)&Q,A&&(F[j]|=(y[j+1]|y[j])<<1|1|y[j+1]),F[j]&k&&(b=Ec(e,{errors:A,currentLocation:z,expectedLocation:d,distance:o,ignoreLocation:c}),b<=h)){if(h=b,p=z,p<=d)break;M=Math.max(1,2*d-p)}}if(Ec(e,{errors:A+1,currentLocation:d,expectedLocation:d,distance:o,ignoreLocation:c})>h)break;y=F}const C={isMatch:p>=0,score:Math.max(.001,b)};if(v){const A=xE(g,s);A.length?l&&(C.indices=A):C.isMatch=!1}return C}function _E(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const o=t.charAt(n);e[o]=(e[o]||0)|1<<r-n-1}return e}class Kg{constructor(e,{location:n=Lt.location,threshold:r=Lt.threshold,distance:o=Lt.distance,includeMatches:i=Lt.includeMatches,findAllMatches:a=Lt.findAllMatches,minMatchCharLength:s=Lt.minMatchCharLength,isCaseSensitive:l=Lt.isCaseSensitive,ignoreLocation:c=Lt.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:l,ignoreLocation:c},this.pattern=l?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const f=(d,h)=>{this.chunks.push({pattern:d,alphabet:_E(d),startIndex:h})},u=this.pattern.length;if(u>xa){let d=0;const h=u%xa,p=u-h;for(;d<p;)f(this.pattern.substr(d,xa),d),d+=xa;if(h){const v=u-xa;f(this.pattern.substr(v),v)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,includeMatches:r}=this.options;if(n||(e=e.toLowerCase()),this.pattern===e){let p={isMatch:!0,score:0};return r&&(p.indices=[[0,e.length-1]]),p}const{location:o,distance:i,threshold:a,findAllMatches:s,minMatchCharLength:l,ignoreLocation:c}=this.options;let f=[],u=0,d=!1;this.chunks.forEach(({pattern:p,alphabet:v,startIndex:g})=>{const{isMatch:m,score:y,indices:b}=jE(e,p,v,{location:o+g,distance:i,threshold:a,findAllMatches:s,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});m&&(d=!0),u+=y,m&&b&&(f=[...f,...b])});let h={isMatch:d,score:d?u/this.chunks.length:1};return d&&r&&(h.indices=f),h}}class qi{constructor(e){this.pattern=e}static isMultiMatch(e){return Qg(e,this.multiRegex)}static isSingleMatch(e){return Qg(e,this.singleRegex)}search(){}}function Qg(t,e){const n=t.match(e);return n?n[1]:null}class SE extends qi{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class CE extends qi{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class $E extends qi{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class OE extends qi{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class AE extends qi{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class EE extends qi{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class Yg extends qi{constructor(e,{location:n=Lt.location,threshold:r=Lt.threshold,distance:o=Lt.distance,includeMatches:i=Lt.includeMatches,findAllMatches:a=Lt.findAllMatches,minMatchCharLength:s=Lt.minMatchCharLength,isCaseSensitive:l=Lt.isCaseSensitive,ignoreLocation:c=Lt.ignoreLocation}={}){super(e),this._bitapSearch=new Kg(e,{location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Xg extends qi{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const o=[],i=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+i,o.push([r,n-1]);const a=!!o.length;return{isMatch:a,score:a?0:1,indices:o}}}const Ad=[SE,Xg,$E,OE,EE,AE,CE,Yg],Zg=Ad.length,PE=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,ME="|";function TE(t,e={}){return t.split(ME).map(n=>{let r=n.trim().split(PE).filter(i=>i&&!!i.trim()),o=[];for(let i=0,a=r.length;i<a;i+=1){const s=r[i];let l=!1,c=-1;for(;!l&&++c<Zg;){const f=Ad[c];let u=f.isMultiMatch(s);u&&(o.push(new f(u,e)),l=!0)}if(!l)for(c=-1;++c<Zg;){const f=Ad[c];let u=f.isSingleMatch(s);if(u){o.push(new f(u,e));break}}}return o})}const IE=new Set([Yg.type,Xg.type]);class NE{constructor(e,{isCaseSensitive:n=Lt.isCaseSensitive,includeMatches:r=Lt.includeMatches,minMatchCharLength:o=Lt.minMatchCharLength,ignoreLocation:i=Lt.ignoreLocation,findAllMatches:a=Lt.findAllMatches,location:s=Lt.location,threshold:l=Lt.threshold,distance:c=Lt.distance}={}){this.query=null,this.options={isCaseSensitive:n,includeMatches:r,minMatchCharLength:o,findAllMatches:a,ignoreLocation:i,location:s,threshold:l,distance:c},this.pattern=n?e:e.toLowerCase(),this.query=TE(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:o}=this.options;e=o?e:e.toLowerCase();let i=0,a=[],s=0;for(let l=0,c=n.length;l<c;l+=1){const f=n[l];a.length=0,i=0;for(let u=0,d=f.length;u<d;u+=1){const h=f[u],{isMatch:p,indices:v,score:g}=h.search(e);if(p){if(i+=1,s+=g,r){const m=h.constructor.type;IE.has(m)?a=[...a,...v]:a.push(v)}}else{s=0,i=0,a.length=0;break}}if(i){let u={isMatch:!0,score:s/i};return r&&(u.indices=a),u}}return{isMatch:!1,score:1}}}const Ed=[];function LE(...t){Ed.push(...t)}function Pd(t,e){for(let n=0,r=Ed.length;n<r;n+=1){let o=Ed[n];if(o.condition(t,e))return new o(t,e)}return new Kg(t,e)}const Pc={AND:"$and",OR:"$or"},Md={PATH:"$path",PATTERN:"$val"},Td=t=>!!(t[Pc.AND]||t[Pc.OR]),RE=t=>!!t[Md.PATH],DE=t=>!xi(t)&&Vg(t)&&!Td(t),e0=t=>({[Pc.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function t0(t,e,{auto:n=!0}={}){const r=o=>{let i=Object.keys(o);const a=RE(o);if(!a&&i.length>1&&!Td(o))return r(e0(o));if(DE(o)){const l=a?o[Md.PATH]:i[0],c=a?o[Md.PATTERN]:o[l];if(!Ko(c))throw new Error(hE(l));const f={keyId:$d(l),pattern:c};return n&&(f.searcher=Pd(c,e)),f}let s={children:[],operator:i[0]};return i.forEach(l=>{const c=o[l];xi(c)&&c.forEach(f=>{s.children.push(r(f))})}),s};return Td(t)||(t=e0(t)),r(t)}function zE(t,{ignoreFieldNorm:e=Lt.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:i,score:a})=>{const s=o?o.weight:null;r*=Math.pow(a===0&&s?Number.EPSILON:a,(s||1)*(e?1:i))}),n.score=r})}function BE(t,e){const n=t.matches;e.matches=[],Gr(n)&&n.forEach(r=>{if(!Gr(r.indices)||!r.indices.length)return;const{indices:o,value:i}=r;let a={indices:o,value:i};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),e.matches.push(a)})}function FE(t,e){e.score=t.score}function qE(t,e,{includeMatches:n=Lt.includeMatches,includeScore:r=Lt.includeScore}={}){const o=[];return n&&o.push(BE),r&&o.push(FE),t.map(i=>{const{idx:a}=i,s={item:e[a],refIndex:a};return o.length&&o.forEach(l=>{l(i,s)}),s})}class os{constructor(e,n={},r){this.options={...Lt,...n},this.options.useExtendedSearch,this._keyStore=new gE(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Od))throw new Error(dE);this._myIndex=n||Gg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){!Gr(e)||(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,o=this._docs.length;r<o;r+=1){const i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,o-=1,n.push(i))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:i,sortFn:a,ignoreFieldNorm:s}=this.options;let l=Ko(e)?Ko(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return zE(l,{ignoreFieldNorm:s}),i&&l.sort(a),qg(n)&&n>-1&&(l=l.slice(0,n)),qE(l,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(e){const n=Pd(e,this.options),{records:r}=this._myIndex,o=[];return r.forEach(({v:i,i:a,n:s})=>{if(!Gr(i))return;const{isMatch:l,score:c,indices:f}=n.searchIn(i);l&&o.push({item:i,idx:a,matches:[{score:c,value:i,norm:s,indices:f}]})}),o}_searchLogical(e){const n=t0(e,this.options),r=(s,l,c)=>{if(!s.children){const{keyId:u,searcher:d}=s,h=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(l,u),searcher:d});return h&&h.length?[{idx:c,item:l,matches:h}]:[]}const f=[];for(let u=0,d=s.children.length;u<d;u+=1){const h=s.children[u],p=r(h,l,c);if(p.length)f.push(...p);else if(s.operator===Pc.AND)return[]}return f},o=this._myIndex.records,i={},a=[];return o.forEach(({$:s,i:l})=>{if(Gr(s)){let c=r(n,s,l);c.length&&(i[l]||(i[l]={idx:l,item:s,matches:[]},a.push(i[l])),c.forEach(({matches:f})=>{i[l].matches.push(...f)}))}}),a}_searchObjectList(e){const n=Pd(e,this.options),{keys:r,records:o}=this._myIndex,i=[];return o.forEach(({$:a,i:s})=>{if(!Gr(a))return;let l=[];r.forEach((c,f)=>{l.push(...this._findMatches({key:c,value:a[f],searcher:n}))}),l.length&&i.push({idx:s,item:a,matches:l})}),i}_findMatches({key:e,value:n,searcher:r}){if(!Gr(n))return[];let o=[];if(xi(n))n.forEach(({v:i,i:a,n:s})=>{if(!Gr(i))return;const{isMatch:l,score:c,indices:f}=r.searchIn(i);l&&o.push({score:c,key:e,value:i,idx:a,norm:s,indices:f})});else{const{v:i,n:a}=n,{isMatch:s,score:l,indices:c}=r.searchIn(i);s&&o.push({score:l,key:e,value:i,norm:a,indices:c})}return o}}os.version="6.6.2",os.createIndex=Gg,os.parseIndex=kE,os.config=Lt,os.parseQuery=t0,LE(NE);var n0,r0,o0,i0,a0,s0,l0,c0,u0,f0,d0,h0,p0,v0,m0,g0,y0,b0,w0,k0,x0,j0,_0,S0,C0,$0,O0,A0,E0,P0,M0,T0,I0,N0,L0,R0,D0,z0,B0,F0,q0,V0,H0,W0,U0,J0,G0,K0,Q0,Y0,X0,Z0,ey,ty,ny,ry,oy,iy,ay,sy,ly,cy,uy,fy,dy,hy,py,vy,my,gy,yy,by,wy,ky,xy,jy,_y,Sy,Cy,$y,Oy,Ay,Ey,Py,My,Ty,Iy,Ny,Ly,Ry,Dy,zy,By,Fy,qy,Vy,Hy,Wy,Uy,Jy,Gy,Ky,Qy,Yy,Xy,Zy,e1,t1,n1,r1,o1,i1,a1,s1,l1,c1,u1,f1,d1,h1,p1,v1,m1,g1,y1,b1,w1,k1,x1,j1,_1,S1,C1,$1,O1,A1,E1,P1,M1,T1,I1,N1,L1,R1,D1,z1,B1,F1,q1,V1,H1,W1,U1,J1,G1,K1,Q1,Y1,X1,Z1,eb,tb,nb,rb,ob,ib,ab,sb,lb,cb,ub,fb,db,hb,pb,vb,mb,gb,yb,bb,wb,kb,xb,jb,_b,Sb,Cb,$b,Ob,Ab,Eb,Pb,Mb,Tb,Ib,Nb,Lb,Rb,Db,zb,Bb,Fb,qb,Vb,Hb,Wb,Ub,Jb,Gb,Kb,Qb,Yb,Xb,Zb,ew,tw,nw,rw,ow,iw,aw,sw,lw,cw,uw,fw,dw,hw,pw,vw,mw,gw,yw,bw,ww,kw,xw,jw,_w,Sw,Cw,$w,Ow,Aw,Ew,Pw,Mw,Tw,Iw,Nw,Lw,Rw,Dw,zw,Bw,Fw,qw,Vw,Hw,Ww,Uw,Jw,Gw,Kw,Qw,Yw,Xw,Zw,ek,tk,nk,rk,ok,ik,ak,sk,lk,ck,uk,fk,dk,hk;function Mc(t){var e=typeof Map=="function"?new Map:void 0;return(Mc=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,o)}function o(){return pk(n,arguments,Kt(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Tc(o,n)})(t)}function pk(t,e,n){return(pk=gk()?Reflect.construct.bind():function(r,o,i){var a=[null];a.push.apply(a,o);var s=new(Function.bind.apply(r,a));return i&&Tc(s,i.prototype),s}).apply(null,arguments)}function ne(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function pt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=typeof Symbol=="function"?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(M,$,F){return Object.defineProperty(M,$,{value:F,enumerable:!0,configurable:!0,writable:!0}),M[$]}try{s({},"")}catch{s=function($,F,S){return $[F]=S}}function l(M,$,F,S){var j=$&&$.prototype instanceof u?$:u,z=Object.create(j.prototype),Q=new A(S||[]);return z._invoke=function(B,K,R){var N="suspendedStart";return function(H,q){if(N==="executing")throw new Error("Generator is already running");if(N==="completed"){if(H==="throw")throw q;return _()}for(R.method=H,R.arg=q;;){var D=R.delegate;if(D){var O=w(D,R);if(O){if(O===f)continue;return O}}if(R.method==="next")R.sent=R._sent=R.arg;else if(R.method==="throw"){if(N==="suspendedStart")throw N="completed",R.arg;R.dispatchException(R.arg)}else R.method==="return"&&R.abrupt("return",R.arg);N="executing";var x=c(B,K,R);if(x.type==="normal"){if(N=R.done?"completed":"suspendedYield",x.arg===f)continue;return{value:x.arg,done:R.done}}x.type==="throw"&&(N="completed",R.method="throw",R.arg=x.arg)}}}(M,F,Q),z}function c(M,$,F){try{return{type:"normal",arg:M.call($,F)}}catch(S){return{type:"throw",arg:S}}}t.wrap=l;var f={};function u(){}function d(){}function h(){}var p={};s(p,o,function(){return this});var v=Object.getPrototypeOf,g=v&&v(v(T([])));g&&g!==e&&n.call(g,o)&&(p=g);var m=h.prototype=u.prototype=Object.create(p);function y(M){["next","throw","return"].forEach(function($){s(M,$,function(F){return this._invoke($,F)})})}function b(M,$){function F(j,z,Q,B){var K=c(M[j],M,z);if(K.type!=="throw"){var R=K.arg,N=R.value;return N&&it(N)=="object"&&n.call(N,"__await")?$.resolve(N.__await).then(function(H){F("next",H,Q,B)},function(H){F("throw",H,Q,B)}):$.resolve(N).then(function(H){R.value=H,Q(R)},function(H){return F("throw",H,Q,B)})}B(K.arg)}var S;this._invoke=function(j,z){function Q(){return new $(function(B,K){F(j,z,B,K)})}return S=S?S.then(Q,Q):Q()}}function w(M,$){var F=M.iterator[$.method];if(F===void 0){if($.delegate=null,$.method==="throw"){if(M.iterator.return&&($.method="return",$.arg=void 0,w(M,$),$.method==="throw"))return f;$.method="throw",$.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var S=c(F,M.iterator,$.arg);if(S.type==="throw")return $.method="throw",$.arg=S.arg,$.delegate=null,f;var j=S.arg;return j?j.done?($[M.resultName]=j.value,$.next=M.nextLoc,$.method!=="return"&&($.method="next",$.arg=void 0),$.delegate=null,f):j:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,f)}function k(M){var $={tryLoc:M[0]};1 in M&&($.catchLoc=M[1]),2 in M&&($.finallyLoc=M[2],$.afterLoc=M[3]),this.tryEntries.push($)}function C(M){var $=M.completion||{};$.type="normal",delete $.arg,M.completion=$}function A(M){this.tryEntries=[{tryLoc:"root"}],M.forEach(k,this),this.reset(!0)}function T(M){if(M){var $=M[o];if($)return $.call(M);if(typeof M.next=="function")return M;if(!isNaN(M.length)){var F=-1,S=function j(){for(;++F<M.length;)if(n.call(M,F))return j.value=M[F],j.done=!1,j;return j.value=void 0,j.done=!0,j};return S.next=S}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=h,s(m,"constructor",h),s(h,"constructor",d),d.displayName=s(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(M){var $=typeof M=="function"&&M.constructor;return!!$&&($===d||($.displayName||$.name)==="GeneratorFunction")},t.mark=function(M){return Object.setPrototypeOf?Object.setPrototypeOf(M,h):(M.__proto__=h,s(M,a,"GeneratorFunction")),M.prototype=Object.create(m),M},t.awrap=function(M){return{__await:M}},y(b.prototype),s(b.prototype,i,function(){return this}),t.AsyncIterator=b,t.async=function(M,$,F,S,j){j===void 0&&(j=Promise);var z=new b(l(M,$,F,S),j);return t.isGeneratorFunction($)?z:z.next().then(function(Q){return Q.done?Q.value:z.next()})},y(m),s(m,a,"Generator"),s(m,o,function(){return this}),s(m,"toString",function(){return"[object Generator]"}),t.keys=function(M){var $=[];for(var F in M)$.push(F);return $.reverse(),function S(){for(;$.length;){var j=$.pop();if(j in M)return S.value=j,S.done=!1,S}return S.done=!0,S}},t.values=T,A.prototype={constructor:A,reset:function(M){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!M)for(var $ in this)$.charAt(0)==="t"&&n.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=void 0)},stop:function(){this.done=!0;var M=this.tryEntries[0].completion;if(M.type==="throw")throw M.arg;return this.rval},dispatchException:function(M){if(this.done)throw M;var $=this;function F(K,R){return z.type="throw",z.arg=M,$.next=K,R&&($.method="next",$.arg=void 0),!!R}for(var S=this.tryEntries.length-1;S>=0;--S){var j=this.tryEntries[S],z=j.completion;if(j.tryLoc==="root")return F("end");if(j.tryLoc<=this.prev){var Q=n.call(j,"catchLoc"),B=n.call(j,"finallyLoc");if(Q&&B){if(this.prev<j.catchLoc)return F(j.catchLoc,!0);if(this.prev<j.finallyLoc)return F(j.finallyLoc)}else if(Q){if(this.prev<j.catchLoc)return F(j.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<j.finallyLoc)return F(j.finallyLoc)}}}},abrupt:function(M,$){for(var F=this.tryEntries.length-1;F>=0;--F){var S=this.tryEntries[F];if(S.tryLoc<=this.prev&&n.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var j=S;break}}j&&(M==="break"||M==="continue")&&j.tryLoc<=$&&$<=j.finallyLoc&&(j=null);var z=j?j.completion:{};return z.type=M,z.arg=$,j?(this.method="next",this.next=j.finallyLoc,f):this.complete(z)},complete:function(M,$){if(M.type==="throw")throw M.arg;return M.type==="break"||M.type==="continue"?this.next=M.arg:M.type==="return"?(this.rval=this.arg=M.arg,this.method="return",this.next="end"):M.type==="normal"&&$&&(this.next=$),f},finish:function(M){for(var $=this.tryEntries.length-1;$>=0;--$){var F=this.tryEntries[$];if(F.finallyLoc===M)return this.complete(F.completion,F.afterLoc),C(F),f}},catch:function(M){for(var $=this.tryEntries.length-1;$>=0;--$){var F=this.tryEntries[$];if(F.tryLoc===M){var S=F.completion;if(S.type==="throw"){var j=S.arg;C(F)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(M,$,F){return this.delegate={iterator:T(M),resultName:$,nextLoc:F},this.method==="next"&&(this.arg=void 0),f}},t}function vk(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,o)}function xn(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(l){vk(i,r,o,a,s,"next",l)}function s(l){vk(i,r,o,a,s,"throw",l)}a(void 0)})}}function le(t,e){var n=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Id(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
11
11
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){s=!0,i=l},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw i}}}}function rn(){return(rn=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=VE(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(this,arguments)}function VE(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=Kt(t))!==null;);return t}function _t(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var o=n==null?null:typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var i,a,s=[],l=!0,c=!1;try{for(o=o.call(n);!(l=(i=o.next()).done)&&(s.push(i.value),!r||s.length!==r);l=!0);}catch(f){c=!0,a=f}finally{try{l||o.return==null||o.return()}finally{if(c)throw a}}return s}}(t,e)||Id(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
12
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ie(t,e){if(typeof e!="function"&&e!==null)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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tc(t,e)}function Tc(t,e){return(Tc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n})(t,e)}function Ne(t){var e=gk();return function(){var n,r=Kt(t);if(e){var o=Kt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return mk(this,n)}}function mk(t,e){if(e&&(it(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vt(t)}function vt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gk(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Kt(t){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(t)}function yk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function at(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?yk(Object(n),!0).forEach(function(r){nl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yk(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vt(t){return function(e){if(Array.isArray(e))return Nd(e)}(t)||function(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||Id(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
13
13
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Id(t,e){if(t){if(typeof t=="string")return Nd(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nd(t,e):void 0}}function Nd(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function re(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bk(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function oe(t,e,n){return e&&bk(t.prototype,e),n&&bk(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function it(t){return(it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function Je(){}var wk=function(t){return t};function Vi(t,e){for(var n in e)t[n]=e[n];return t}function kk(t){return t()}function xk(){return Object.create(null)}function Tn(t){t.forEach(kk)}function $o(t){return typeof t=="function"}function er(t,e){return t!=t?e==e:t!==e||t&&it(t)==="object"||typeof t=="function"}function Zt(t,e){return t!=t?e==e:t!==e}function Oo(t,e,n,r){if(t){var o=jk(t,e,n,r);return t[0](o)}}function jk(t,e,n,r){return t[1]&&r?Vi(n.ctx.slice(),t[1](r(e))):n.ctx}function Ao(t,e,n,r){if(t[2]&&r){var o=t[2](r(n));if(e.dirty===void 0)return o;if(it(o)==="object"){for(var i=[],a=Math.max(e.dirty.length,o.length),s=0;s<a;s+=1)i[s]=e.dirty[s]|o[s];return i}return e.dirty|o}return e.dirty}function Eo(t,e,n,r,o,i){if(o){var a=jk(e,n,r,i);t.p(a,o)}}function Po(t){if(t.ctx.length>32){for(var e=[],n=t.ctx.length/32,r=0;r<n;r++)e[r]=-1;return e}return-1}function Xn(t){return t==null?"":t}function rl(t){return t&&$o(t.destroy)?t.destroy:Je}var Ic,_k=typeof window!="undefined",HE=_k?function(){return window.performance.now()}:function(){return Date.now()},Ld=_k?function(t){return requestAnimationFrame(t)}:Je,ol=new Set;function Sk(t){ol.forEach(function(e){e.c(t)||(ol.delete(e),e.f())}),ol.size!==0&&Ld(Sk)}function V(t,e){t.appendChild(e)}function Mt(t,e,n){var r=Rd(t);if(!r.getElementById(e)){var o=ee("style");o.id=e,o.textContent=n,Ck(r,o)}}function Rd(t){if(!t)return document;var e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function WE(t){var e=ee("style");return Ck(Rd(t),e),e.sheet}function Ck(t,e){V(t.head||t,e)}function he(t,e,n){t.insertBefore(e,n||null)}function fe(t){t.parentNode.removeChild(t)}function Br(t,e){for(var n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function ee(t){return document.createElement(t)}function ji(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function et(t){return document.createTextNode(t)}function je(){return et(" ")}function on(){return et("")}function Le(t,e,n,r){return t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n,r)}}function $k(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function E(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Ok(t,e){var n=Object.getOwnPropertyDescriptors(t.__proto__);for(var r in e)e[r]==null?t.removeAttribute(r):r==="style"?t.style.cssText=e[r]:r==="__value"?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:E(t,r,e[r])}function Nc(t,e){for(var n in e)E(t,n,e[n])}function Dd(t,e,n){e in t?t[e]=typeof t[e]=="boolean"&&n===""||n:E(t,e,n)}function UE(t){return Array.from(t.childNodes)}function Jt(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Hi(t,e){t.value=e==null?"":e}function Qo(t,e,n,r){n===null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function Ak(t,e){for(var n=0;n<t.options.length;n+=1){var r=t.options[n];if(r.__value===e)return void(r.selected=!0)}t.selectedIndex=-1}function JE(){if(Ic===void 0){Ic=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch{Ic=!0}}return Ic}function Ye(t,e,n){t.classList[n?"add":"remove"](e)}function Ek(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.bubbles,o=r!==void 0&&r,i=n.cancelable,a=i!==void 0&&i,s=document.createEvent("CustomEvent");return s.initCustomEvent(t,o,a,e),s}var il,GE=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];re(this,t),this.is_svg=!1,this.is_svg=e,this.e=this.n=null}return oe(t,[{key:"c",value:function(e){this.h(e)}},{key:"m",value:function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this.e||(this.is_svg?this.e=ji(n.nodeName):this.e=ee(n.nodeName),this.t=n,this.c(e)),this.i(r)}},{key:"h",value:function(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}},{key:"i",value:function(e){for(var n=0;n<this.n.length;n+=1)he(this.t,this.n[n],e)}},{key:"p",value:function(e){this.d(),this.h(e),this.i(this.a)}},{key:"d",value:function(){this.n.forEach(fe)}}]),t}(),Lc=new Map,zd=0;function KE(t){for(var e=5381,n=t.length;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function QE(t,e){var n={stylesheet:WE(e),rules:{}};return Lc.set(t,n),n}function Pk(t,e,n,r,o,i,a){for(var s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,l=16.666/r,c=`{
|
|
@@ -171,25 +171,25 @@ return query;
|
|
|
171
171
|
* pinia v2.0.14
|
|
172
172
|
* (c) 2022 Eduardo San Martin Morote
|
|
173
173
|
* @license MIT
|
|
174
|
-
*/let s8;const hd=t=>s8=t,l8=Symbol();function mg(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var yc;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(yc||(yc={}));function bH(){const t=P.effectScope(!0),e=t.run(()=>P.ref({}));let n=[],r=[];const o=P.markRaw({install(i){hd(o),o._a=i,i.provide(l8,o),i.config.globalProperties.$pinia=o,r.forEach(a=>n.push(a)),r=[]},use(i){return!this._a&&!yH?r.push(i):n.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return o}const c8=()=>{};function u8(t,e,n,r=c8){t.push(e);const o=()=>{const i=t.indexOf(e);i>-1&&(t.splice(i,1),r())};return!n&&P.getCurrentInstance()&&P.onUnmounted(o),o}function Qs(t,...e){t.slice().forEach(n=>{n(...e)})}function gg(t,e){for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],o=t[n];mg(o)&&mg(r)&&t.hasOwnProperty(n)&&!P.isRef(r)&&!P.isReactive(r)?t[n]=gg(o,r):t[n]=r}return t}const wH=Symbol();function kH(t){return!mg(t)||!t.hasOwnProperty(wH)}const{assign:Di}=Object;function xH(t){return!!(P.isRef(t)&&t.effect)}function jH(t,e,n,r){const{state:o,actions:i,getters:a}=e,s=n.state.value[t];let l;function c(){s||(n.state.value[t]=o?o():{});const f=P.toRefs(n.state.value[t]);return Di(f,i,Object.keys(a||{}).reduce((u,d)=>(u[d]=P.markRaw(P.computed(()=>{hd(n);const h=n._s.get(t);return a[d].call(h,h)})),u),{}))}return l=f8(t,c,e,n,r,!0),l.$reset=function(){const u=o?o():{};this.$patch(d=>{Di(d,u)})},l}function f8(t,e,n={},r,o,i){let a;const s=Di({actions:{}},n),l={deep:!0};let c,f,u=P.markRaw([]),d=P.markRaw([]),h;const p=r.state.value[t];!i&&!p&&(r.state.value[t]={}),P.ref({});let v;function g(A){let T;c=f=!1,typeof A=="function"?(A(r.state.value[t]),T={type:yc.patchFunction,storeId:t,events:h}):(gg(r.state.value[t],A),T={type:yc.patchObject,payload:A,storeId:t,events:h});const _=v=Symbol();P.nextTick().then(()=>{v===_&&(c=!0)}),f=!0,Qs(u,T,r.state.value[t])}const m=c8;function y(){a.stop(),u=[],d=[],r._s.delete(t)}function b(A,T){return function(){hd(r);const _=Array.from(arguments),M=[],$=[];function F(z){M.push(z)}function S(z){$.push(z)}Qs(d,{args:_,name:A,store:k,after:F,onError:S});let j;try{j=T.apply(this&&this.$id===t?this:k,_)}catch(z){throw Qs($,z),z}return j instanceof Promise?j.then(z=>(Qs(M,z),z)).catch(z=>(Qs($,z),Promise.reject(z))):(Qs(M,j),j)}}const w={_p:r,$id:t,$onAction:u8.bind(null,d),$patch:g,$reset:m,$subscribe(A,T={}){const _=u8(u,A,T.detached,()=>M()),M=a.run(()=>P.watch(()=>r.state.value[t],$=>{(T.flush==="sync"?f:c)&&A({storeId:t,type:yc.direct,events:h},$)},Di({},l,T)));return _},$dispose:y},k=P.reactive(Di({},w));r._s.set(t,k);const C=r._e.run(()=>(a=P.effectScope(),a.run(()=>e())));for(const A in C){const T=C[A];if(P.isRef(T)&&!xH(T)||P.isReactive(T))i||(p&&kH(T)&&(P.isRef(T)?T.value=p[A]:gg(T,p[A])),r.state.value[t][A]=T);else if(typeof T=="function"){const _=b(A,T);C[A]=_,s.actions[A]=T}}return Di(k,C),Di(P.toRaw(k),C),Object.defineProperty(k,"$state",{get:()=>r.state.value[t],set:A=>{g(T=>{Di(T,A)})}}),r._p.forEach(A=>{Di(k,a.run(()=>A({store:k,app:r._a,pinia:r,options:s})))}),p&&i&&n.hydrate&&n.hydrate(k.$state,p),c=!0,f=!0,k}function qo(t,e,n){let r,o;const i=typeof e=="function";typeof t=="string"?(r=t,o=i?n:e):(o=t,r=t.id);function a(s,l){const c=P.getCurrentInstance();return s=s||c&&P.inject(l8),s&&hd(s),s=s8,s._s.has(r)||(i?f8(r,e,o,s):jH(r,o,s)),s._s.get(r)}return a.$id=r,a}function bi(t,e){return Array.isArray(e)?e.reduce((n,r)=>(n[r]=function(){return t(this.$pinia)[r]},n),{}):Object.keys(e).reduce((n,r)=>(n[r]=function(){const o=t(this.$pinia),i=e[r];return typeof i=="function"?i.call(this,o):o[i]},n),{})}const ao=qo("audio",{state:()=>({}),actions:{stopMusic(){if(this.currentMusic){const t=this.currentMusic;this.currentMusic=void 0,p8(t)}},setMusic(t,e){this.currentMusic=t,this.musicHowlId=e},generateSaveData(){return{currentMusic:this.currentMusic}},loadSaveData(t){this.currentMusic=t.currentMusic},reset(){this.stopMusic()}}}),d8={};ga.Howler.volume(.5);let yg={};async function _H(t){Co.log("Loading audio");const e=[];ga.Howler.volume(t.audioOptions.volume);for(const n in t.music){const r={loop:!0,...t.music[n]};t.audio[n]=r,console.warn("Music config is deprecated, instead you can now add musics to the `audio` config as they behave the same as other sounds!")}for(const n in t.sound)t.audio[n]=t.sound[n];for(const n in t.audio){const r=t.audio[n];r.src||(r.src=r.path,r.path||console.error(`Audio config for ${n} doesn't have any \`src\` value to find the file`),console.warn("Using `path` for audio and musics is deprecated. Please replace `path` with `src` in your config file!")),e.push(SH(n,t.audio[n]))}return t.audioTriggers&&(yg=t.audioTriggers),Promise.all(e)}function bc(t){yg[t]&&h8(yg[t])}async function SH(t,e){return new Promise((n,r)=>{Co.log(`Loading audio ${e.src}`);const o=new ga.Howl({...e});o.load(),d8[t]=o,n()})}async function pd(t){const e=ao(),n=e.musicHowlId,r=Bt().audioOptions;if(e.currentMusic){const a=wc(e.currentMusic);n&&(a.fade(a.volume(),0,r.musicFadeOutTime*1e3,n),setTimeout(()=>{a.stop(n)},r.musicFadeOutTime*1e3))}let o,i;if(t){if(o=wc(t),!o)throw new Error(`Could not find music ${t}`);o.volume(0),i=o.play(),o.pause(),e.setMusic(t,i)}e.currentMusic&&await vg(r.musicFadeInDelay*1e3),o&&ao().musicHowlId===i&&(o.play(),o.fade(0,1,r.musicFadeInTime*1e3,i))}function h8(t){const e=wc(t);if(e)return e.play();hr(`Sound effect ${t} not found!`)}function wc(t){return d8[t]}function p8(t){if(t===ao().currentMusic)ao().stopMusic();else{const e=wc(t);e&&e.stop()}}function v8(t){const e=wc(t);e&&e.pause()}const m8="gameSave";function CH(t){localStorage.setItem(m8,JSON.stringify(t))}function $H(){return`${Date.now()-Math.floor(Math.random()*99999999)}`}function bg(t){return new Promise((e,n)=>{const r=new XMLHttpRequest;r.onload=function(){r.status>=200&&r.status<300?e(r.responseText):n(r.status)},r.open("GET",t),r.send()})}var OH=function(e){return AH(e)&&!EH(e)};function AH(t){return!!t&&typeof t=="object"}function EH(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||TH(t)}var PH=typeof Symbol=="function"&&Symbol.for,MH=PH?Symbol.for("react.element"):60103;function TH(t){return t.$$typeof===MH}function IH(t){return Array.isArray(t)?[]:{}}function kc(t,e){return e.clone!==!1&&e.isMergeableObject(t)?Ys(IH(t),t,e):t}function NH(t,e,n){return t.concat(e).map(function(r){return kc(r,n)})}function LH(t,e){if(!e.customMerge)return Ys;var n=e.customMerge(t);return typeof n=="function"?n:Ys}function RH(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return t.propertyIsEnumerable(e)}):[]}function g8(t){return Object.keys(t).concat(RH(t))}function y8(t,e){try{return e in t}catch{return!1}}function DH(t,e){return y8(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function zH(t,e,n){var r={};return n.isMergeableObject(t)&&g8(t).forEach(function(o){r[o]=kc(t[o],n)}),g8(e).forEach(function(o){DH(t,o)||(y8(t,o)&&n.isMergeableObject(e[o])?r[o]=LH(o,n)(t[o],e[o],n):r[o]=kc(e[o],n))}),r}function Ys(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||NH,n.isMergeableObject=n.isMergeableObject||OH,n.cloneUnlessOtherwiseSpecified=kc;var r=Array.isArray(e),o=Array.isArray(t),i=r===o;return i?r?n.arrayMerge(t,e,n):zH(t,e,n):kc(e,n)}Ys.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,o){return Ys(r,o,n)},{})};var BH=Ys,vd=BH;const zi=qo("hud",{state:()=>({hudStats:{}}),actions:{setupHudStats(t){for(const e in t)this.hudStats[e]={value:t[e].startingValue}},setStat(t,e){this.hudStats[t].value=e},addStat(t,e){this.hudStats[t].value+=e},getStat(t){return this.hudStats[t]},getStatValue(t){return this.hudStats[t].value},generateSaveData(){return{hudStats:this.hudStats}},loadSaveData(t){this.hudStats=vd(this.hudStats,t.hudStats)}}}),wi=qo("notifications",{state:()=>({notifications:{}}),actions:{async addNotification(t){const e=`${Date.now()}-${Math.random()*1e4}`;this.notifications[e]={text:t},Bt().notifications.alsoPrintInDialogue&&T8(`[NOTIFICATION] ${t}`),await vg(Bt().notifications.timeOnScreen*1e3),this.deleteNotification(e)},deleteNotification(t){delete this.notifications[t]}}}),_r=qo("inventory",{state:()=>({items:{},interactionTags:{}}),actions:{generateSaveData(){return{items:this.items,interactionTags:this.interactionTags}},loadSaveData(t){this.items={...this.items,...t.items},this.interactionTags={...t.interactionTags}},setupItems(t){Object.keys(t).forEach(e=>{this.items[e]={amount:0,id:e}})},hasItem(t,e){var n;return e||(e=1),((n=this.items[t])==null?void 0:n.amount)>=e},getExistingItem(t){return this.items[t]},getItemAmount(t){var e;return((e=this.getExistingItem(t))==null?void 0:e.amount)||0},add(t){const e=this.getExistingItem(t.id);e?e.amount+=t.amount:this.items[t.id]={...t},wi().addNotification(`Received item: ${a8(t.id).name} x ${t.amount}`)},enableInteraction(t){t||(t="default"),this.interactionTags[t]={blockedInteraction:!1}},disableInteraction(t){t||(t="default"),this.interactionTags[t]={blockedInteraction:!0}},onScriptStart(){const t=Bt().interactionTags;Object.keys(t).forEach(e=>{t[e].onlyInteractOutsideOfScripts&&this.disableInteraction(e)})},onScriptEnd(){const t=Bt().interactionTags;Object.keys(t).forEach(e=>{t[e].onlyInteractOutsideOfScripts&&this.enableInteraction(e)})},isInteractionTagBlocked(t){return t||(t="default"),this.interactionTags[t]?this.interactionTags[t].blockedInteraction:!1},remove(t){const e=this.getExistingItem(t.id);e&&(e.amount-=t.amount,wi().addNotification(`Lost item: ${a8(t.id).name} x ${t.amount}`),e.amount<=0&&this.deleteItem(t.id))},deleteItem(t){this.getExistingItem(t)&&(this.items[t].amount=0)}}}),FH=(t,e)=>{for(const n in t)if(!e(t[n]))return!1;return!0},b8=(t,e)=>{const n={};for(const r in t)e(t[r])&&(n[r]=t[r]);return n},Rr=qo("quests",{state:()=>({quests:{}}),actions:{getQuest(t){const e=this.quests[t];if(e)return e;{const n=`Quest ${t} doesn't exist!`;throw hr(n),new Error(n)}},getObjective(t,e){const n=this.getQuest(t);if(!n){const i=`Quest ${t} doesn't exist!`;throw hr(i),new Error(i)}const r=n.objectives[e];if(r)return r;const o=`Objective ${e} doesn't exist in quest ${t}!`;throw hr(o),new Error(o)},setupQuests(t){for(const e of Object.keys(t)){const n=t[e];this.quests[e]={id:e,state:"hidden",objectives:{}};for(const r of Object.keys(n.objectives)){const o=n.objectives[r];this.quests[e].objectives[r]={id:r,state:o.hidden?"hidden":"unlocked"}}}},startQuest(t){const e=this.getQuest(t);e?(e.state="unlocked",wi().addNotification(`Started quest: ${dd(t).title}`)):hr(`Quest ${t} doesn't exist!`)},startObjective(t,e){const n=this.getObjective(t,e);n?(n.state="unlocked",wi().addNotification(`New quest objective: ${pg(t,e).description}`)):hr(`Objective ${e} doesn't exist in quest ${t}!`)},completeObjective(t,e){const n=this.getObjective(t,e);n?(n.state="completed",wi().addNotification(`Completed quest objective: ${pg(t,e).description}`)):hr(`Objective ${e} doesn't exist in quest ${t}!`)},completeQuest(t,e){const n=this.getQuest(t);n?(n.state="completed",n.ending=e,wi().addNotification(`Completed quest: ${dd(t).title}`)):hr(`Quest ${t} doesn't exist!`)},isQuestCompleted(t){const e=this.getQuest(t);return e?FH(e.objectives,n=>n.state==="completed"):!1},isObjectiveCompleted(t,e){const n=this.getObjective(t,e);return n?n.state==="completed":!1},isQuestStarted(t){const e=this.getQuest(t);return e&&e.state==="unlocked"},isObjectiveStarted(t,e){return this.getObjective(t,e).state==="unlocked"},removeQuest(t){delete this.quests[t]},generateSaveData(){return{quests:{...this.quests}}},loadSaveData(t){this.quests=t.quests}}}),Bi=qo("screens",{state:()=>({currentScreen:"default",buttons:{}}),actions:{setScreen(t){this.currentScreen=t},setButtons(t){for(const e in t)this.buttons[e]={enabled:t[e].enabled}},changeButton(t,e){this.buttons[t].enabled=e},generateSaveData(){return{currentScreen:this.currentScreen,buttons:this.buttons}},loadSaveData(t){this.currentScreen=t.currentScreen,this.buttons=vd(this.buttons,t.buttons)}}});function wg(t,e){const n=e.split(".");let r=t;const o=n.length-1;let i=n[0],a=0;for(a=0;a<o;a++)i=n[a],r[i]||(r[i]={}),r=r[i];return i=n[a],[r,i]}function qH(t,e){const n=e.split(".");let r=t;const o=n.length-1;let i=n[0],a=0;for(a=0;a<o;a++)i=n[a],r[i]||(r[i]={}),r=r[i];return i=n[a],typeof r[i]=="undefined"&&(r[i]=null),[r,i]}function w8(t,e,n){const[r,o]=wg(t,e);r[o]=n}function k8(t,e,n){const[r,o]=wg(t,e),i=r[o]||0;r[o]=n+i}function Xs(){const t=fn(),e=Sr(),n=Bi(),r=_r(),o=fn().currentScope,i={data:t.data,skills:e.skills,buttons:n.buttons,items:r.items,quests:Rr().quests,stats:zi().hudStats,scope:o};return new Proxy(i,{get:(s,l,c)=>{const f=fn().currentScope;return typeof f[l]!="undefined"?f[l]:Reflect.get(s,l,c)},set:(s,l,c,f)=>{const u=fn().currentScope;return typeof u[l]!="undefined"?(u[l]=c,u[l]):Reflect.set(s,l,c,f)}})}const x8=new zg;x8.setupDebugger(!1);const jo=x8.logger;function VH(t,e,n){const r={fileName:n,currentLine:0,error:(a,s)=>t(r,a,s),processCommandsFunction:kg,indentSize:0};r.indentSize=XH(r,e);const o=KH(r,e);r.currentLine=0,jo.log(o);const i={};for(const a of o){a.code.search(":")===-1&&r.error(a.line,"First indentation level should only be used to specify labels");const l=a.code.replace(":","").split(/ +/g),c=l[0],f=l.slice(1);a.branch||r.error(a.line,"This line should have a branch but doesn't"),i[c]={branch:kg(r,a.branch,void 0),args:f}}return i}function kg(t,e,n){const r=t.currentLine,o={processCommandsFunction:kg,parserContext:t,lines:e,currentLine:0,line:e[0]},i=[];if(!e){let a=0;return n&&(a=n.line),t.error(a,"Processing of command failed because the current branch has no lines inside"),[]}for(;o.currentLine<e.length;){const a=e[o.currentLine];o.line=a;const s=j8(t,a,a.expression),l=or.commands[s.command.operator];let c=l==null?void 0:l.parser;c||(c=or.commands.text.parser),jo.log(or.commands.text);const{newLine:f}=c(o,s);o.currentLine=f,t.currentLine=r+f,i.push(s)}return i}function j8(t,e,n){jo.log(n),typeof n[0]!="string"&&t.error(e.line,"Expression operator should be a string");const r={code:e.code,fileName:t.fileName,line:e.line,command:{staticOptions:{},commandType:n[0],operator:n[0],args:n.slice(1).map(a=>HH(t,e,a)),options:{}}},o=n[0];if(!or.commands[o]){const a=["else","success","failure"];!ZH(o)&&!a.includes(o)&&t.error(e.line,`Unknown command ${o}`)}return r}function HH(t,e,n){return Array.isArray(n)?j8(t,e,n):n}function WH(t){return t==="true"?!0:t==="false"?!1:isNaN(Number(t))?t:Number(t)}function UH(t,e){e.charAt(e.length-1)===":"&&(e=e.substr(0,e.length-1));const n=JH(e),[r]=S8(t,n);return r}function JH(t){const e=/(["'])(?:\\\1|.)*?\1/g,n=[];let r;for(;(r=e.exec(t))!=null;)n.push(r);let o=0,i=[];for(const a of n){const s=a.index;if(s>o){const c=t.substr(o,s-o),f=_8(c);i=[...i,...f]}const l=a[0].replace(/\\/g,"");i.push(`$$"${l.substring(1,l.length-1)}`),o=s+a[0].length}return i=[...i,..._8(t.substr(o))],i.push(")"),i}function _8(t){t=t.replace(/: *$/g,"");let e=t.split(" ").filter(n=>n);return e=e.reduce((n,r)=>[...n,...r.split(/(\(|\))/g)].filter(o=>o&&o),[]),e.map(n=>WH(n))}function S8(t,e){jo.log("===============");let n=[],r=0,o=C8(e)+r,i=xg(e)+r;for(jo.log(`Parsing expression: ${e}`),jo.log(`Parenthesis start index: ${o} - end: ${i}`);o!==-1&&i>o;){n=[...n,...e.slice(r,o)];const l=e.slice(o+1);jo.log(`Found a sub expression. Before: ${n} - After: ${l}`),r=o;const[c,f]=S8(t,l),u=r+f;n.push(c),r=u+1;const d=e.slice(r);jo.log(`Sub expression came back: ${c} - rest of string: ${d}`),o=C8(d),o!==-1&&(o+=r),i=xg(d),i!==-1&&(i+=r)}i!==-1&&jo.log("Found parenthesis end before new opening parenthesis, close this expression");const a=xg(e.slice(r))+r;if(a===-1)return t.error(t.currentLine,'Expression is not closed (missing ")" closing parenthesis)'),[n,a];const s=e.slice(r,a);return jo.log(`End of expression: ${a} - ${s}`),jo.log("==================="),n=[...n,...s],GH(t,n),[n,a+1]}function GH(t,e){e.length<1&&t.error(t.currentLine,"Expression is empty")}function C8(t){return t.findIndex(e=>e==="(")}function xg(t){return t.findIndex(e=>e===")")}function KH(t,e){const n=e.split(/\r?\n|$/).map(o=>{const i=o.search(/ *\/\//g);return i!==-1?o.substr(0,i):o});return $8(t,n,0,0).lines}function $8(t,e,n,r){let o=!0,i=n;const a=[];for(;o&&!(i>=e.length);){let s=e[i];if(s.search(/^\s*$/)!==-1)i++;else{const l=YH(t,s);if(s=s.substring(l*t.indentSize),QH(t,l,i),l<r)o=!1;else if(l>r){(a.length===0||l-r!==1)&&t.error(i,"Wrong double indentation");const c=$8(t,e,i,l);a[a.length-1].branch=c.lines,i=c.endLine}else{const c=UH(t,s),f={code:s,indentation:l,line:i,expression:c};a.push(f),i++,t.currentLine=i}}}return{lines:a,endLine:i}}function QH(t,e,n){e%1!==0&&t.error(n,`Indentation level of ${e} incorrect. Expected indentation of ${t.indentSize} spaces for this file.`)}function YH(t,e){return e.search(/[^ ]/)/t.indentSize}function XH(t,e){const n=/\n( *)/,r=e.match(n);return!r||r.length<2?(t.error(0,"Can't detect indentation level. Make sure you indent with at least 2 spaces and consistently"),0):(jo.log(r),r[1].length)}const fn=qo("vm",{state:()=>({stack:[],data:{},lastLabel:"main",script:{},labelStack:["main"],currentScope:{},commandsWaitingForPlayerAnswer:[]}),actions:{generateSaveData(){return{lastLabel:this.lastLabel,data:this.data}},loadSaveData(t){this.lastLabel=t.lastLabel,this.data=t.data},resetScope(){this.currentScope={}},setReturnValue(t){this.currentFrame.returnValue=t},waitForPlayerAnswer(t){this.commandsWaitingForPlayerAnswer.push(t)},popAnswerQueue(){return this.commandsWaitingForPlayerAnswer.pop()},removeFromScope(t){for(const e of t)delete this.currentScope[e]},addScopedVariable(t,e){this.currentScope[t]=e,this.currentFrame&&(this.currentFrame.scope[t]=e)},extendScope(t){Object.assign(this.currentScope,t)},async loadScripts(t){const e=[];for(const a of t)e.push(bg(a));const n=await Promise.all(e),r=Date.now();let o={};for(const a in n){const s=n[a];o={...o,...VH((l,c,f)=>uW(l,c,f),s,t[a])}}const i=Date.now();Co.log(`script parsed in ${i-r} ms`),this.setScript(o)},start(){this.setStack({currentIndex:0,branchData:{branch:this.script.main.branch},label:"main"}),this.setStack({currentIndex:0,branchData:{branch:this.script.main.branch},label:"main"})},setLastLabel(t){this.lastLabel=t},reset(){this.stack=[],this.data={},this.setStack({currentIndex:0,branchData:{branch:this.script.main.branch},label:"main"})},setScript(t){this.script=t},overrideData(t){this.data=t},setStack(t){this.resetScope(),this.stack=[];const e=this.stackOptionsToStack(t);this.lastLabel=t.label,this.stack.push(e)},stackOptionsToStack(t){const e={...t,scope:{},returnValue:null};if(t.scope&&(e.scope=t.scope),t.args&&t.branchData.args)for(const[n,r]of t.branchData.args.entries())t.args.length>n&&(e.scope[r]=t.args[n]);return this.extendScope(e.scope||{}),e},setData(t,e){const n=Xs();w8(n,t,e)},addInstruction(t,e){const n=Xs();k8(n,t,e)},addFrame(t){if(!t.label)if(this.currentFrame)t.label=this.currentFrame.label;else throw new Error("Tried to add a new frame but no label was passed and there is no current frame label");const e=this.stackOptionsToStack(t);this.stack.push(e)},async addAndRunFrame(t){await this.addFrame(t),await this.runFrame()},async runFrame(){const t=this.currentFrame;if(!t)throw new Error("Tried to run a frame but there is no current frame");for(t.currentIndex=0;this.currentLine;)await this.runLineOnly(),t.currentIndex++;const e=t.scope;this.removeFromScope(Object.keys(e));const{returnValue:n,onComplete:r}=t;this.stack.splice(this.stack.length-1,1),r&&r(n)},async runGame(){await this.runFrame(),this.stack.length===0&&this.reachedEndOfScript()},async nextLineOnly(){return this.stack.length===0?!1:this.currentFrame&&this.currentFrame.currentIndex<this.currentFrame.branchData.branch.length-1?(this.currentFrame.currentIndex++,!0):!1},async nextLine(){if(this.stack.length===0){this.reachedEndOfScript();return}if(this.currentFrame&&this.currentFrame.currentIndex<this.currentFrame.branchData.branch.length-1)this.currentFrame.currentIndex++;else return this.previousFrame();if(this.stack.length===0)this.reachedEndOfScript();else return this.runLine();this.currentFrame.currentIndex++},async previousFrame(){if(!this.currentFrame)throw new Error("Tried to go back to previous frame but there is no current frame");const t=this.currentFrame.scope;this.removeFromScope(Object.keys(t));const{returnValue:e,onComplete:n}=this.currentFrame;if(this.stack.splice(this.stack.length-1,1),n)n(e);else return this.nextLine()},reachedEndOfScript(){_r().onScriptEnd(),Sn().options.debug&&so().addDialog({speaker:"game",text:"[DEBUG] Game Script is finished. This is the end of the game flow. This message only appears in debug mode."})},async runLineOnly(){const t=this.currentLine;if(!t){hr("There is no line of script to run.");return}_r().onScriptStart(),await N8(t)},async runLine(){await this.runLineOnly(),this.nextLine()},runLabelFunction(t,...e){return new Promise((n,r)=>{const o=this.script[t];o||console.error(`Label ${t} doesn't exist`);const i={currentIndex:0,branchData:o,label:t,args:e,onComplete:a=>{n(a)}};this.addAndRunFrame(i)})},runCustomFrame(t){this.addAndRunFrame(t)},runLabel(t,...e){const n=this.script[t];n||console.error(`Label ${n} doesn't exist`),this.setLastLabel(t),this.setStack({currentIndex:0,branchData:n,args:e,label:t}),this.runGame()}},getters:{currentFrame(t){return t.stack[t.stack.length-1]},currentLine(){const t=this.currentFrame;if(this.currentFrame&&t.branchData.branch.length>t.currentIndex)return t.branchData.branch[t.currentIndex]},commandWaitingForAnswer(){if(this.commandsWaitingForPlayerAnswer.length>0)return this.commandsWaitingForPlayerAnswer[0]}}});function O8(t){return fn(),Sr(),t.replace(/%{[^}]*}/g,e=>{const n=e.substr(2,e.length-3),r=Xs(),[o,i]=wg(r,n);return o[i]})}const A8=/\$\$"/,ZH=t=>typeof t=="string"&&t.search(A8)===0,so=qo("dialog",{state:()=>({dialog:[]}),actions:{generateSaveData(){return{dialog:this.dialog}},loadSaveData(t){this.dialog=t.dialog},addDialog(t){var e;this.dialog.push({...t,interactive:(e=t.interactive)!=null?e:!1,id:$H(),text:O8(t.text)})},clearDialog(){this.dialog.splice(0,this.dialog.length)},reset(){this.dialog=[]}},getters:{currentDialog(){return this.dialog[this.dialog.length-1]}}});function eW(t,e){return t-e*Bt().skillChecks.skillMultiplier}function E8(t,e){const n=eW(t,e),r=Bt().skillChecks;let o=!1,i=0,a=r.difficultyText[0][1];for(;!o;)r.difficultyText.length>i&&n>=r.difficultyText[i][0]?a=r.difficultyText[i][1]:o=!0,i++;return a}function tW({skill:t,skillCheckId:e,value:n}){const r=Sr(),o=r.getSkillCheck(e),i=i8(t),a=r.skills[t].level,s=E8(n,a);let l=!0,c=`<span class='skill-check'>[<span class='skill-check-name'>${i.name}</span> - `;return o.happened?o.succeeded?c="":(l=!1,c+=` <span class='skill-check-difficulty'>${s}</span> - <span class='skill-check-failed'>FAILED</span>]</span>`):c+=` <span class='skill-check-difficulty'>${s}</span>]</span>`,{difficultyText:c,allowed:l}}function nW(t,e){const n=Sr(),r=i8(e.skill),o=E8(e.value,n.skills[e.skill].level);return`<span class='passive-skill-check skill-check'>[<span class='skill-check-name'>${r.name}</span> - <span class='skill-check-difficulty'>${o}</span> - ${t?'<span class="skill-check-success">Success</span>':'<span class="skill-check-failed">Failure</span>'}]</span>`}function rW(t){const{skillChecks:e}=Bt(),n=Sr(),r=Math.floor(Math.random()*e.rollRange),o=n.skills[t].level*e.skillMultiplier,i=r+o;return Co.log(`[SKILL CHECK] Roll: ${i}. (Base roll: ${r}, modifier: ${o} - Skill level: ${n.skills[t].level})`),{roll:i,unmodifiedRoll:r}}function oW(t){const{skills:e,skillChecks:n}=Bt();let r=!0;const{roll:o}=rW(t.skill);o<=n.failureChance-1&&(r=!1);const i=e[t.skill];return o<t.value&&(r=!1),Co.log(`[SKILL CHECK ${i.name}]: ${r?"\u2705":"\u274C"}`,`(${t.id}) - ${o}/${t.value}`),bc(r?"onSkillCheckSuccess":"onSkillCheckFailure"),r}function P8(t){const e=Sr(),n=e.getSkillCheck(t.id);if(n&&n.happened)return n;const r=oW(t);return T8(nW(r,t)),r?e.passSkillCheck(t.id,t.hideAfterRoll):e.failSkillCheck(t.id,t.hideAfterRoll),e.getSkillCheck(t.id)}function iW(t){const e=t.options,n=t.staticOptions,r=!!e.condition;if(Co.log(r),r)return n.success;if(!r&&n.failure)return n.failure}function M8(t){return typeof t=="object"}function T8(t){const e={speaker:"game",text:t,interactive:!1};so().addDialog(e)}async function I8(t){so().addDialog(t)}function aW(t,e){if(e<t.length)return t[e]}class sW{constructor(){Go(this,"plugins",[]);Go(this,"commands",{})}addCommand(e){this.commands[e.keyword]=e}addPlugin(e){if(this.plugins.push(e),e.customCommands)for(const n of e.customCommands)this.addCommand(n)}callHook(e,...n){for(const r of this.plugins)typeof r[e]=="function"&&r[e](...n)}}const or=new sW;async function N8(t,e){const n=fn();try{return await jg(t,e)}catch(r){console.error(r),console.error(t),hr(`Narrat script runtime error at <span class="error-filename">${t.fileName}:${t.line+1}</span>
|
|
174
|
+
*/let s8;const hd=t=>s8=t,l8=Symbol();function mg(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var yc;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(yc||(yc={}));function bH(){const t=P.effectScope(!0),e=t.run(()=>P.ref({}));let n=[],r=[];const o=P.markRaw({install(i){hd(o),o._a=i,i.provide(l8,o),i.config.globalProperties.$pinia=o,r.forEach(a=>n.push(a)),r=[]},use(i){return!this._a&&!yH?r.push(i):n.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return o}const c8=()=>{};function u8(t,e,n,r=c8){t.push(e);const o=()=>{const i=t.indexOf(e);i>-1&&(t.splice(i,1),r())};return!n&&P.getCurrentInstance()&&P.onUnmounted(o),o}function Qs(t,...e){t.slice().forEach(n=>{n(...e)})}function gg(t,e){for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],o=t[n];mg(o)&&mg(r)&&t.hasOwnProperty(n)&&!P.isRef(r)&&!P.isReactive(r)?t[n]=gg(o,r):t[n]=r}return t}const wH=Symbol();function kH(t){return!mg(t)||!t.hasOwnProperty(wH)}const{assign:Di}=Object;function xH(t){return!!(P.isRef(t)&&t.effect)}function jH(t,e,n,r){const{state:o,actions:i,getters:a}=e,s=n.state.value[t];let l;function c(){s||(n.state.value[t]=o?o():{});const f=P.toRefs(n.state.value[t]);return Di(f,i,Object.keys(a||{}).reduce((u,d)=>(u[d]=P.markRaw(P.computed(()=>{hd(n);const h=n._s.get(t);return a[d].call(h,h)})),u),{}))}return l=f8(t,c,e,n,r,!0),l.$reset=function(){const u=o?o():{};this.$patch(d=>{Di(d,u)})},l}function f8(t,e,n={},r,o,i){let a;const s=Di({actions:{}},n),l={deep:!0};let c,f,u=P.markRaw([]),d=P.markRaw([]),h;const p=r.state.value[t];!i&&!p&&(r.state.value[t]={}),P.ref({});let v;function g(A){let T;c=f=!1,typeof A=="function"?(A(r.state.value[t]),T={type:yc.patchFunction,storeId:t,events:h}):(gg(r.state.value[t],A),T={type:yc.patchObject,payload:A,storeId:t,events:h});const _=v=Symbol();P.nextTick().then(()=>{v===_&&(c=!0)}),f=!0,Qs(u,T,r.state.value[t])}const m=c8;function y(){a.stop(),u=[],d=[],r._s.delete(t)}function b(A,T){return function(){hd(r);const _=Array.from(arguments),M=[],$=[];function F(z){M.push(z)}function S(z){$.push(z)}Qs(d,{args:_,name:A,store:k,after:F,onError:S});let j;try{j=T.apply(this&&this.$id===t?this:k,_)}catch(z){throw Qs($,z),z}return j instanceof Promise?j.then(z=>(Qs(M,z),z)).catch(z=>(Qs($,z),Promise.reject(z))):(Qs(M,j),j)}}const w={_p:r,$id:t,$onAction:u8.bind(null,d),$patch:g,$reset:m,$subscribe(A,T={}){const _=u8(u,A,T.detached,()=>M()),M=a.run(()=>P.watch(()=>r.state.value[t],$=>{(T.flush==="sync"?f:c)&&A({storeId:t,type:yc.direct,events:h},$)},Di({},l,T)));return _},$dispose:y},k=P.reactive(Di({},w));r._s.set(t,k);const C=r._e.run(()=>(a=P.effectScope(),a.run(()=>e())));for(const A in C){const T=C[A];if(P.isRef(T)&&!xH(T)||P.isReactive(T))i||(p&&kH(T)&&(P.isRef(T)?T.value=p[A]:gg(T,p[A])),r.state.value[t][A]=T);else if(typeof T=="function"){const _=b(A,T);C[A]=_,s.actions[A]=T}}return Di(k,C),Di(P.toRaw(k),C),Object.defineProperty(k,"$state",{get:()=>r.state.value[t],set:A=>{g(T=>{Di(T,A)})}}),r._p.forEach(A=>{Di(k,a.run(()=>A({store:k,app:r._a,pinia:r,options:s})))}),p&&i&&n.hydrate&&n.hydrate(k.$state,p),c=!0,f=!0,k}function qo(t,e,n){let r,o;const i=typeof e=="function";typeof t=="string"?(r=t,o=i?n:e):(o=t,r=t.id);function a(s,l){const c=P.getCurrentInstance();return s=s||c&&P.inject(l8),s&&hd(s),s=s8,s._s.has(r)||(i?f8(r,e,o,s):jH(r,o,s)),s._s.get(r)}return a.$id=r,a}function bi(t,e){return Array.isArray(e)?e.reduce((n,r)=>(n[r]=function(){return t(this.$pinia)[r]},n),{}):Object.keys(e).reduce((n,r)=>(n[r]=function(){const o=t(this.$pinia),i=e[r];return typeof i=="function"?i.call(this,o):o[i]},n),{})}const ao=qo("audio",{state:()=>({}),actions:{stopMusic(){if(this.currentMusic){const t=this.currentMusic;this.currentMusic=void 0,p8(t)}},setMusic(t,e){this.currentMusic=t,this.musicHowlId=e},generateSaveData(){return{currentMusic:this.currentMusic}},loadSaveData(t){this.currentMusic=t.currentMusic},reset(){this.stopMusic()}}}),d8={};ga.Howler.volume(.5);let yg={};async function _H(t){Co.log("Loading audio");const e=[];ga.Howler.volume(t.audioOptions.volume);for(const n in t.music){const r={loop:!0,...t.music[n]};t.audio[n]=r,console.warn("Music config is deprecated, instead you can now add musics to the `audio` config as they behave the same as other sounds!")}for(const n in t.sound)t.audio[n]=t.sound[n];for(const n in t.audio){const r=t.audio[n];r.src||(r.src=r.path,r.path||console.error(`Audio config for ${n} doesn't have any \`src\` value to find the file`),console.warn("Using `path` for audio and musics is deprecated. Please replace `path` with `src` in your config file!")),e.push(SH(n,t.audio[n]))}return t.audioTriggers&&(yg=t.audioTriggers),Promise.all(e)}function bc(t){yg[t]&&h8(yg[t])}async function SH(t,e){return new Promise((n,r)=>{Co.log(`Loading audio ${e.src}`);const o=new ga.Howl({...e});o.load(),d8[t]=o,n()})}async function pd(t){const e=ao(),n=e.musicHowlId,r=Bt().audioOptions;if(e.currentMusic){const a=wc(e.currentMusic);n&&(a.fade(a.volume(),0,r.musicFadeOutTime*1e3,n),setTimeout(()=>{a.stop(n)},r.musicFadeOutTime*1e3))}let o,i;if(t){if(o=wc(t),!o)throw new Error(`Could not find music ${t}`);o.volume(0),i=o.play(),o.pause(),e.setMusic(t,i)}e.currentMusic&&await vg(r.musicFadeInDelay*1e3),o&&ao().musicHowlId===i&&(o.play(),o.fade(0,1,r.musicFadeInTime*1e3,i))}function h8(t){const e=wc(t);if(e)return e.play();hr(`Sound effect ${t} not found!`)}function wc(t){return d8[t]}function p8(t){if(t===ao().currentMusic)ao().stopMusic();else{const e=wc(t);e&&e.stop()}}function v8(t){const e=wc(t);e&&e.pause()}const m8="gameSave";function CH(t){localStorage.setItem(m8,JSON.stringify(t))}function $H(){return`${Date.now()-Math.floor(Math.random()*99999999)}`}function bg(t){return new Promise((e,n)=>{const r=new XMLHttpRequest;r.onload=function(){r.status>=200&&r.status<300?e(r.responseText):n(r.status)},r.open("GET",t),r.send()})}var OH=function(e){return AH(e)&&!EH(e)};function AH(t){return!!t&&typeof t=="object"}function EH(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||TH(t)}var PH=typeof Symbol=="function"&&Symbol.for,MH=PH?Symbol.for("react.element"):60103;function TH(t){return t.$$typeof===MH}function IH(t){return Array.isArray(t)?[]:{}}function kc(t,e){return e.clone!==!1&&e.isMergeableObject(t)?Ys(IH(t),t,e):t}function NH(t,e,n){return t.concat(e).map(function(r){return kc(r,n)})}function LH(t,e){if(!e.customMerge)return Ys;var n=e.customMerge(t);return typeof n=="function"?n:Ys}function RH(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return t.propertyIsEnumerable(e)}):[]}function g8(t){return Object.keys(t).concat(RH(t))}function y8(t,e){try{return e in t}catch{return!1}}function DH(t,e){return y8(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function zH(t,e,n){var r={};return n.isMergeableObject(t)&&g8(t).forEach(function(o){r[o]=kc(t[o],n)}),g8(e).forEach(function(o){DH(t,o)||(y8(t,o)&&n.isMergeableObject(e[o])?r[o]=LH(o,n)(t[o],e[o],n):r[o]=kc(e[o],n))}),r}function Ys(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||NH,n.isMergeableObject=n.isMergeableObject||OH,n.cloneUnlessOtherwiseSpecified=kc;var r=Array.isArray(e),o=Array.isArray(t),i=r===o;return i?r?n.arrayMerge(t,e,n):zH(t,e,n):kc(e,n)}Ys.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,o){return Ys(r,o,n)},{})};var BH=Ys,vd=BH;const zi=qo("hud",{state:()=>({hudStats:{}}),actions:{setupHudStats(t){for(const e in t)this.hudStats[e]={value:t[e].startingValue}},setStat(t,e){this.hudStats[t].value=e},addStat(t,e){this.hudStats[t].value+=e},getStat(t){return this.hudStats[t]},getStatValue(t){return this.hudStats[t].value},generateSaveData(){return{hudStats:this.hudStats}},loadSaveData(t){this.hudStats=vd(this.hudStats,t.hudStats)}}}),wi=qo("notifications",{state:()=>({notifications:{}}),actions:{async addNotification(t){const e=`${Date.now()}-${Math.random()*1e4}`;this.notifications[e]={text:t},Bt().notifications.alsoPrintInDialogue&&M8(`[NOTIFICATION] ${t}`),await vg(Bt().notifications.timeOnScreen*1e3),this.deleteNotification(e)},deleteNotification(t){delete this.notifications[t]}}}),_r=qo("inventory",{state:()=>({items:{},interactionTags:{}}),actions:{generateSaveData(){return{items:this.items,interactionTags:this.interactionTags}},loadSaveData(t){this.items={...this.items,...t.items},this.interactionTags={...t.interactionTags}},setupItems(t){Object.keys(t).forEach(e=>{this.items[e]={amount:0,id:e}})},hasItem(t,e){var n;return e||(e=1),((n=this.items[t])==null?void 0:n.amount)>=e},getExistingItem(t){return this.items[t]},getItemAmount(t){var e;return((e=this.getExistingItem(t))==null?void 0:e.amount)||0},add(t){const e=this.getExistingItem(t.id);e?e.amount+=t.amount:this.items[t.id]={...t},wi().addNotification(`Received item: ${a8(t.id).name} x ${t.amount}`)},enableInteraction(t){t||(t="default"),this.interactionTags[t]={blockedInteraction:!1}},disableInteraction(t){t||(t="default"),this.interactionTags[t]={blockedInteraction:!0}},onScriptStart(){const t=Bt().interactionTags;Object.keys(t).forEach(e=>{t[e].onlyInteractOutsideOfScripts&&this.disableInteraction(e)})},onScriptEnd(){const t=Bt().interactionTags;Object.keys(t).forEach(e=>{t[e].onlyInteractOutsideOfScripts&&this.enableInteraction(e)})},isInteractionTagBlocked(t){return t||(t="default"),this.interactionTags[t]?this.interactionTags[t].blockedInteraction:!1},remove(t){const e=this.getExistingItem(t.id);e&&(e.amount-=t.amount,wi().addNotification(`Lost item: ${a8(t.id).name} x ${t.amount}`),e.amount<=0&&this.deleteItem(t.id))},deleteItem(t){this.getExistingItem(t)&&(this.items[t].amount=0)}}}),Rr=qo("quests",{state:()=>({quests:{}}),actions:{getQuest(t){const e=this.quests[t];if(e)return e;{const n=`Quest ${t} doesn't exist!`;throw hr(n),new Error(n)}},getObjective(t,e){const n=this.getQuest(t);if(!n){const i=`Quest ${t} doesn't exist!`;throw hr(i),new Error(i)}const r=n.objectives[e];if(r)return r;const o=`Objective ${e} doesn't exist in quest ${t}!`;throw hr(o),new Error(o)},setupQuests(t){for(const e of Object.keys(t)){const n=t[e];this.quests[e]={id:e,state:"hidden",objectives:{}};for(const r of Object.keys(n.objectives)){const o=n.objectives[r];this.quests[e].objectives[r]={id:r,state:o.hidden?"hidden":"unlocked"}}}},startQuest(t){const e=this.getQuest(t);e?(e.state="unlocked",wi().addNotification(`Started quest: ${dd(t).title}`)):hr(`Quest ${t} doesn't exist!`)},startObjective(t,e){const n=this.getObjective(t,e);n?(n.state="unlocked",wi().addNotification(`New quest objective: ${pg(t,e).description}`)):hr(`Objective ${e} doesn't exist in quest ${t}!`)},completeObjective(t,e){const n=this.getObjective(t,e);n?(n.state="completed",wi().addNotification(`Completed quest objective: ${pg(t,e).description}`)):hr(`Objective ${e} doesn't exist in quest ${t}!`)},completeQuest(t,e){const n=this.getQuest(t);n?(n.state="completed",n.ending=e,wi().addNotification(`Completed quest: ${dd(t).title}`)):hr(`Quest ${t} doesn't exist!`)},isQuestCompleted(t){const e=this.getQuest(t);return e?e.state==="completed":!1},isObjectiveCompleted(t,e){const n=this.getObjective(t,e);return n?n.state==="completed":!1},isQuestStarted(t){const e=this.getQuest(t);return e&&e.state==="unlocked"},isObjectiveStarted(t,e){return this.getObjective(t,e).state==="unlocked"},removeQuest(t){delete this.quests[t]},generateSaveData(){return{quests:{...this.quests}}},loadSaveData(t){this.quests=t.quests}}}),Bi=qo("screens",{state:()=>({currentScreen:"default",buttons:{}}),actions:{setScreen(t){this.currentScreen=t},setButtons(t){for(const e in t)this.buttons[e]={enabled:t[e].enabled}},changeButton(t,e){this.buttons[t].enabled=e},generateSaveData(){return{currentScreen:this.currentScreen,buttons:this.buttons}},loadSaveData(t){this.currentScreen=t.currentScreen,this.buttons=vd(this.buttons,t.buttons)}}});function wg(t,e){const n=e.split(".");let r=t;const o=n.length-1;let i=n[0],a=0;for(a=0;a<o;a++)i=n[a],r[i]||(r[i]={}),r=r[i];return i=n[a],[r,i]}function FH(t,e){const n=e.split(".");let r=t;const o=n.length-1;let i=n[0],a=0;for(a=0;a<o;a++)i=n[a],r[i]||(r[i]={}),r=r[i];return i=n[a],typeof r[i]=="undefined"&&(r[i]=null),[r,i]}function b8(t,e,n){const[r,o]=wg(t,e);r[o]=n}function w8(t,e,n){const[r,o]=wg(t,e),i=r[o]||0;r[o]=n+i}function Xs(){const t=fn(),e=Sr(),n=Bi(),r=_r(),o=fn().currentScope,i={data:t.data,skills:e.skills,buttons:n.buttons,items:r.items,quests:Rr().quests,stats:zi().hudStats,scope:o};return new Proxy(i,{get:(s,l,c)=>{const f=fn().currentScope;return typeof f[l]!="undefined"?f[l]:Reflect.get(s,l,c)},set:(s,l,c,f)=>{const u=fn().currentScope;return typeof u[l]!="undefined"?(u[l]=c,u[l]):Reflect.set(s,l,c,f)}})}const k8=new zg;k8.setupDebugger(!1);const jo=k8.logger;function qH(t,e,n){const r={fileName:n,currentLine:0,error:(a,s)=>t(r,a,s),processCommandsFunction:kg,indentSize:0};r.indentSize=YH(r,e);const o=GH(r,e);r.currentLine=0,jo.log(o);const i={};for(const a of o){a.code.search(":")===-1&&r.error(a.line,"First indentation level should only be used to specify labels");const l=a.code.replace(":","").split(/ +/g),c=l[0],f=l.slice(1);a.branch||r.error(a.line,"This line should have a branch but doesn't"),i[c]={branch:kg(r,a.branch,void 0),args:f}}return i}function kg(t,e,n){const r=t.currentLine,o={processCommandsFunction:kg,parserContext:t,lines:e,currentLine:0,line:e[0]},i=[];if(!e){let a=0;return n&&(a=n.line),t.error(a,"Processing of command failed because the current branch has no lines inside"),[]}for(;o.currentLine<e.length;){const a=e[o.currentLine];o.line=a;const s=x8(t,a,a.expression),l=or.commands[s.command.operator];let c=l==null?void 0:l.parser;c||(c=or.commands.text.parser),jo.log(or.commands.text);const{newLine:f}=c(o,s);o.currentLine=f,t.currentLine=r+f,i.push(s)}return i}function x8(t,e,n){jo.log(n),typeof n[0]!="string"&&t.error(e.line,"Expression operator should be a string");const r={code:e.code,fileName:t.fileName,line:e.line,command:{staticOptions:{},commandType:n[0],operator:n[0],args:n.slice(1).map(a=>VH(t,e,a)),options:{}}},o=n[0];if(!or.commands[o]){const a=["else","success","failure"];!XH(o)&&!a.includes(o)&&t.error(e.line,`Unknown command ${o}`)}return r}function VH(t,e,n){return Array.isArray(n)?x8(t,e,n):n}function HH(t){return t==="true"?!0:t==="false"?!1:isNaN(Number(t))?t:Number(t)}function WH(t,e){e.charAt(e.length-1)===":"&&(e=e.substr(0,e.length-1));const n=UH(e),[r]=_8(t,n);return r}function UH(t){const e=/(["'])(?:\\\1|.)*?\1/g,n=[];let r;for(;(r=e.exec(t))!=null;)n.push(r);let o=0,i=[];for(const a of n){const s=a.index;if(s>o){const c=t.substr(o,s-o),f=j8(c);i=[...i,...f]}const l=a[0].replace(/\\/g,"");i.push(`$$"${l.substring(1,l.length-1)}`),o=s+a[0].length}return i=[...i,...j8(t.substr(o))],i.push(")"),i}function j8(t){t=t.replace(/: *$/g,"");let e=t.split(" ").filter(n=>n);return e=e.reduce((n,r)=>[...n,...r.split(/(\(|\))/g)].filter(o=>o&&o),[]),e.map(n=>HH(n))}function _8(t,e){jo.log("===============");let n=[],r=0,o=S8(e)+r,i=xg(e)+r;for(jo.log(`Parsing expression: ${e}`),jo.log(`Parenthesis start index: ${o} - end: ${i}`);o!==-1&&i>o;){n=[...n,...e.slice(r,o)];const l=e.slice(o+1);jo.log(`Found a sub expression. Before: ${n} - After: ${l}`),r=o;const[c,f]=_8(t,l),u=r+f;n.push(c),r=u+1;const d=e.slice(r);jo.log(`Sub expression came back: ${c} - rest of string: ${d}`),o=S8(d),o!==-1&&(o+=r),i=xg(d),i!==-1&&(i+=r)}i!==-1&&jo.log("Found parenthesis end before new opening parenthesis, close this expression");const a=xg(e.slice(r))+r;if(a===-1)return t.error(t.currentLine,'Expression is not closed (missing ")" closing parenthesis)'),[n,a];const s=e.slice(r,a);return jo.log(`End of expression: ${a} - ${s}`),jo.log("==================="),n=[...n,...s],JH(t,n),[n,a+1]}function JH(t,e){e.length<1&&t.error(t.currentLine,"Expression is empty")}function S8(t){return t.findIndex(e=>e==="(")}function xg(t){return t.findIndex(e=>e===")")}function GH(t,e){const n=e.split(/\r?\n|$/).map(o=>{const i=o.search(/ *\/\//g);return i!==-1?o.substr(0,i):o});return C8(t,n,0,0).lines}function C8(t,e,n,r){let o=!0,i=n;const a=[];for(;o&&!(i>=e.length);){let s=e[i];if(s.search(/^\s*$/)!==-1)i++;else{const l=QH(t,s);if(s=s.substring(l*t.indentSize),KH(t,l,i),l<r)o=!1;else if(l>r){(a.length===0||l-r!==1)&&t.error(i,"Wrong double indentation");const c=C8(t,e,i,l);a[a.length-1].branch=c.lines,i=c.endLine}else{const c=WH(t,s),f={code:s,indentation:l,line:i,expression:c};a.push(f),i++,t.currentLine=i}}}return{lines:a,endLine:i}}function KH(t,e,n){e%1!==0&&t.error(n,`Indentation level of ${e} incorrect. Expected indentation of ${t.indentSize} spaces for this file.`)}function QH(t,e){return e.search(/[^ ]/)/t.indentSize}function YH(t,e){const n=/\n( *)/,r=e.match(n);return!r||r.length<2?(t.error(0,"Can't detect indentation level. Make sure you indent with at least 2 spaces and consistently"),0):(jo.log(r),r[1].length)}const fn=qo("vm",{state:()=>({stack:[],data:{},lastLabel:"main",script:{},labelStack:["main"],currentScope:{},commandsWaitingForPlayerAnswer:[]}),actions:{generateSaveData(){return{lastLabel:this.lastLabel,data:this.data}},loadSaveData(t){this.lastLabel=t.lastLabel,this.data=t.data},resetScope(){this.currentScope={}},setReturnValue(t){this.currentFrame.returnValue=t},waitForPlayerAnswer(t){this.commandsWaitingForPlayerAnswer.push(t)},popAnswerQueue(){return this.commandsWaitingForPlayerAnswer.pop()},removeFromScope(t){for(const e of t)delete this.currentScope[e]},addScopedVariable(t,e){this.currentScope[t]=e,this.currentFrame&&(this.currentFrame.scope[t]=e)},extendScope(t){Object.assign(this.currentScope,t)},async loadScripts(t){const e=[];for(const a of t)e.push(bg(a));const n=await Promise.all(e),r=Date.now();let o={};for(const a in n){const s=n[a];o={...o,...qH((l,c,f)=>cW(l,c,f),s,t[a])}}const i=Date.now();Co.log(`script parsed in ${i-r} ms`),this.setScript(o)},start(){this.setStack({currentIndex:0,branchData:{branch:this.script.main.branch},label:"main"}),this.setStack({currentIndex:0,branchData:{branch:this.script.main.branch},label:"main"})},setLastLabel(t){this.lastLabel=t},reset(){this.stack=[],this.data={},this.setStack({currentIndex:0,branchData:{branch:this.script.main.branch},label:"main"})},setScript(t){this.script=t},overrideData(t){this.data=t},setStack(t){this.resetScope(),this.stack=[];const e=this.stackOptionsToStack(t);this.lastLabel=t.label,this.stack.push(e)},stackOptionsToStack(t){const e={...t,scope:{},returnValue:null};if(t.scope&&(e.scope=t.scope),t.args&&t.branchData.args)for(const[n,r]of t.branchData.args.entries())t.args.length>n&&(e.scope[r]=t.args[n]);return this.extendScope(e.scope||{}),e},setData(t,e){const n=Xs();b8(n,t,e)},addInstruction(t,e){const n=Xs();w8(n,t,e)},addFrame(t){if(!t.label)if(this.currentFrame)t.label=this.currentFrame.label;else throw new Error("Tried to add a new frame but no label was passed and there is no current frame label");const e=this.stackOptionsToStack(t);this.stack.push(e)},async addAndRunFrame(t){await this.addFrame(t),await this.runFrame()},async runFrame(){const t=this.currentFrame;if(!t)throw new Error("Tried to run a frame but there is no current frame");for(t.currentIndex=0;this.currentLine;)await this.runLineOnly(),t.currentIndex++;const e=t.scope;this.removeFromScope(Object.keys(e));const{returnValue:n,onComplete:r}=t;this.stack.splice(this.stack.length-1,1),r&&r(n)},async runGame(){await this.runFrame(),this.stack.length===0&&this.reachedEndOfScript()},async nextLineOnly(){return this.stack.length===0?!1:this.currentFrame&&this.currentFrame.currentIndex<this.currentFrame.branchData.branch.length-1?(this.currentFrame.currentIndex++,!0):!1},async nextLine(){if(this.stack.length===0){this.reachedEndOfScript();return}if(this.currentFrame&&this.currentFrame.currentIndex<this.currentFrame.branchData.branch.length-1)this.currentFrame.currentIndex++;else return this.previousFrame();if(this.stack.length===0)this.reachedEndOfScript();else return this.runLine();this.currentFrame.currentIndex++},async previousFrame(){if(!this.currentFrame)throw new Error("Tried to go back to previous frame but there is no current frame");const t=this.currentFrame.scope;this.removeFromScope(Object.keys(t));const{returnValue:e,onComplete:n}=this.currentFrame;if(this.stack.splice(this.stack.length-1,1),n)n(e);else return this.nextLine()},reachedEndOfScript(){_r().onScriptEnd(),Sn().options.debug&&so().addDialog({speaker:"game",text:"[DEBUG] Game Script is finished. This is the end of the game flow. This message only appears in debug mode."})},async runLineOnly(){const t=this.currentLine;if(!t){hr("There is no line of script to run.");return}_r().onScriptStart(),await I8(t)},async runLine(){await this.runLineOnly(),this.nextLine()},runLabelFunction(t,...e){return new Promise((n,r)=>{const o=this.script[t];o||console.error(`Label ${t} doesn't exist`);const i={currentIndex:0,branchData:o,label:t,args:e,onComplete:a=>{n(a)}};this.addAndRunFrame(i)})},runCustomFrame(t){this.addAndRunFrame(t)},runLabel(t,...e){const n=this.script[t];n||console.error(`Label ${n} doesn't exist`),this.setLastLabel(t),this.setStack({currentIndex:0,branchData:n,args:e,label:t}),this.runGame()}},getters:{currentFrame(t){return t.stack[t.stack.length-1]},currentLine(){const t=this.currentFrame;if(this.currentFrame&&t.branchData.branch.length>t.currentIndex)return t.branchData.branch[t.currentIndex]},commandWaitingForAnswer(){if(this.commandsWaitingForPlayerAnswer.length>0)return this.commandsWaitingForPlayerAnswer[0]}}});function $8(t){return fn(),Sr(),t.replace(/%{[^}]*}/g,e=>{const n=e.substr(2,e.length-3),r=Xs(),[o,i]=wg(r,n);return o[i]})}const O8=/\$\$"/,XH=t=>typeof t=="string"&&t.search(O8)===0,so=qo("dialog",{state:()=>({dialog:[]}),actions:{generateSaveData(){return{dialog:this.dialog}},loadSaveData(t){this.dialog=t.dialog},addDialog(t){var e;this.dialog.push({...t,interactive:(e=t.interactive)!=null?e:!1,id:$H(),text:$8(t.text)})},clearDialog(){this.dialog.splice(0,this.dialog.length)},reset(){this.dialog=[]}},getters:{currentDialog(){return this.dialog[this.dialog.length-1]}}});function ZH(t,e){return t-e*Bt().skillChecks.skillMultiplier}function A8(t,e){const n=ZH(t,e),r=Bt().skillChecks;let o=!1,i=0,a=r.difficultyText[0][1];for(;!o;)r.difficultyText.length>i&&n>=r.difficultyText[i][0]?a=r.difficultyText[i][1]:o=!0,i++;return a}function eW({skill:t,skillCheckId:e,value:n}){const r=Sr(),o=r.getSkillCheck(e),i=i8(t),a=r.skills[t].level,s=A8(n,a);let l=!0,c=`<span class='skill-check'>[<span class='skill-check-name'>${i.name}</span> - `;return o.happened?o.succeeded?c="":(l=!1,c+=` <span class='skill-check-difficulty'>${s}</span> - <span class='skill-check-failed'>FAILED</span>]</span>`):c+=` <span class='skill-check-difficulty'>${s}</span>]</span>`,{difficultyText:c,allowed:l}}function tW(t,e){const n=Sr(),r=i8(e.skill),o=A8(e.value,n.skills[e.skill].level);return`<span class='passive-skill-check skill-check'>[<span class='skill-check-name'>${r.name}</span> - <span class='skill-check-difficulty'>${o}</span> - ${t?'<span class="skill-check-success">Success</span>':'<span class="skill-check-failed">Failure</span>'}]</span>`}function nW(t){const{skillChecks:e}=Bt(),n=Sr(),r=Math.floor(Math.random()*e.rollRange),o=n.skills[t].level*e.skillMultiplier,i=r+o;return Co.log(`[SKILL CHECK] Roll: ${i}. (Base roll: ${r}, modifier: ${o} - Skill level: ${n.skills[t].level})`),{roll:i,unmodifiedRoll:r}}function rW(t){const{skills:e,skillChecks:n}=Bt();let r=!0;const{roll:o}=nW(t.skill);o<=n.failureChance-1&&(r=!1);const i=e[t.skill];return o<t.value&&(r=!1),Co.log(`[SKILL CHECK ${i.name}]: ${r?"\u2705":"\u274C"}`,`(${t.id}) - ${o}/${t.value}`),bc(r?"onSkillCheckSuccess":"onSkillCheckFailure"),r}function E8(t){const e=Sr(),n=e.getSkillCheck(t.id);if(n&&n.happened)return n;const r=rW(t);return M8(tW(r,t)),r?e.passSkillCheck(t.id,t.hideAfterRoll):e.failSkillCheck(t.id,t.hideAfterRoll),e.getSkillCheck(t.id)}function oW(t){const e=t.options,n=t.staticOptions,r=!!e.condition;if(Co.log(r),r)return n.success;if(!r&&n.failure)return n.failure}function P8(t){return typeof t=="object"}function M8(t){const e={speaker:"game",text:t,interactive:!1};so().addDialog(e)}async function T8(t){so().addDialog(t)}function iW(t,e){if(e<t.length)return t[e]}class aW{constructor(){Go(this,"plugins",[]);Go(this,"commands",{})}addCommand(e){this.commands[e.keyword]=e}addPlugin(e){if(this.plugins.push(e),e.customCommands)for(const n of e.customCommands)this.addCommand(n)}callHook(e,...n){for(const r of this.plugins)typeof r[e]=="function"&&r[e](...n)}}const or=new aW;async function I8(t,e){const n=fn();try{return await jg(t,e)}catch(r){console.error(r),console.error(t),hr(`Narrat script runtime error at <span class="error-filename">${t.fileName}:${t.line+1}</span>
|
|
175
175
|
<b>${r}</b>
|
|
176
176
|
Script: ${t.code}
|
|
177
|
-
Label: ${n.currentFrame.label}`)}}async function
|
|
178
|
-
<br />`),e.createError(`\u274C ${t}`)}const Sr=qo("skills",{state:()=>({skillChecks:{},skills:{}}),actions:{setupSkillCheck(t,e){this.skillChecks[e]=t},passSkillCheck(t,e){this.skillChecks[t].happened=!0,this.skillChecks[t].succeeded=!0,e&&(this.skillChecks[t].hidden=!0)},failSkillCheck(t,e){this.skillChecks[t].happened=!0,this.skillChecks[t].succeeded=!1,e&&(this.skillChecks[t].hidden=!0)},generateSaveData(){return{skillChecks:this.skillChecks,skills:this.skills}},getSkillCheck(t){return this.skillChecks[t]||this.setupSkillCheck(this.createSkillCheckState(),t),this.skillChecks[t]},createSkillCheckState(){return{happened:!1,succeeded:!1,hidden:!1}},loadSaveData(t){this.skillChecks=vd(this.skillChecks,t.skillChecks),this.skills=vd(this.skills,t.skills)},setupSkills(t){for(const e in t)this.skills[e]={id:e,level:t[e].startingLevel||0,xp:0}},addXp(t,e){const n=this.skills[t];n||hr(`Skill ${t} doesn't exist`),n.xp+=e,n.xp>=Bt().skillOptions.xpPerLevel&&(n.xp=0,n.level++,this.levelledUp(t))},incrementSkill(t,e){this.skills[t].level+=e,this.levelledUp(t)},levelledUp(t){const e=Bt().skills[t].name,n=this.skills[t].level;wi().addNotification(`Your skill in ${e} is now level ${n}`)}}});var
|
|
179
|
-
`)();let
|
|
180
|
-
`)();const
|
|
181
|
-
`)();const
|
|
182
|
-
`)();const
|
|
183
|
-
`)();const
|
|
184
|
-
`)();const
|
|
185
|
-
`)();const
|
|
186
|
-
`)();const
|
|
187
|
-
`)();const
|
|
188
|
-
`)();const
|
|
189
|
-
`)();const
|
|
190
|
-
`)();const
|
|
191
|
-
`)();const
|
|
192
|
-
`)();const
|
|
177
|
+
Label: ${n.currentFrame.label}`)}}async function sW(t,e){const n=t.command,r=or.commands[n.commandType];if(r){const o={args:[],options:{},operator:n.operator,staticOptions:n.staticOptions,code:t.code,commandType:n.commandType,fileName:t.fileName,line:t.line},i=r.argTypes;o.options={};for(const[a,s]of n.args.entries()){let l;if(P8(s))l=await jg(s,e);else if(typeof s=="string")if(s.search(O8)===0)l=s.substring(3);else if(s.search(/\$/)===0){const c=Xs(),f=FH(c,s.substring(1));if(f){const[u,d]=f;l=u[d]}else l=s}else l=s;else l=s;if(o.args.push(l),Array.isArray(i)&&i.length>a){const c=i[a];l!==null&&(o.options[c.name]=l)}}return o}else throw new Error(`${n.commandType} is not a valid command`)}async function jg(t,e){const n=await sW(t,e),r=or.commands[n.commandType];if(r)return await r.run(n,e);throw new Error(`${n.commandType} is not a valid command`)}async function lW(t){bc("onPlayerAnswered");const e=fn(),n=e.popAnswerQueue(),r=e.currentLine;try{if(n){const o=or.commands[n.commandType];if(o)return await o.processPlayerAnswer(n,t)}}catch(o){console.error(o),hr(`Error after player answer at ${r.fileName}:${r.line+1} (${r.code}<br /> - Error: ${o}`)}}const xc=qo("rendering",{state:()=>({screenHeight:window.innerHeight,screenWidth:window.innerWidth,canvasWidth:window.innerWidth,canvasHeight:window.innerHeight,renderRatio:1,topOffset:0,leftOffset:0,layoutMode:"horizontal"}),actions:{updateScreenSize(t,e,n){this.screenHeight=e,this.screenWidth=t,this.renderRatio=1,this.topOffset=0,this.leftOffset=0,t<Bt().layout.verticalLayoutThreshold?this.layoutMode="vertical":this.layoutMode="horizontal"}}}),Sn=qo("main",{state:()=>({ready:!1,playing:!1,errors:[],playTime:{start:0,previousPlaytime:0},options:{logging:!1,debug:!1},flowState:"menu",modal:!1,paused:!1}),actions:{async setup(t,e){e.audioOptions.defaultMusic&&pd(e.audioOptions.defaultMusic),await fn().loadScripts(t),Bi().setButtons(e.buttons),Sr().setupSkills(e.skills),zi().setupHudStats(e.hudStats),_r().setupItems(e.items),Rr().setupQuests(e.quests)},startMachine(){ao().stopMusic(),fn().start(),this.ready=!0,this.startPlaying(),or.callHook("onGameStart"),this.setFlowState("playing")},async startGame(){this.startMachine(),await fn().runGame(),await this.saveGame()},async loadGame(t){if(this.startMachine(),t){const e=JSON.parse(t);this.setLoadedData(e),e.audio.currentMusic&&pd(e.audio.currentMusic),fn().runLabel(e.vm.lastLabel)}},playerAnswered(t){lW(t)},menuReturn(){this.reset(),ao().stopMusic(),this.setFlowState("menu"),Bt().audioOptions.defaultMusic&&pd(Bt().audioOptions.defaultMusic)},createError(t){this.errors.push({text:t})},clearErrors(){this.errors=[]},setFlowState(t){this.flowState=t},openModal(t){this.modal=t},closeModal(){this.modal=!1},toggleMenu(){this.modal?this.modal=!1:this.modal="menu"},pause(){this.paused=!0},unpause(){this.paused=!1},setOptions(t){this.options=t},startPlaying(){this.playing=!0,this.playTime.start=Date.now()},reset(){this.ready=!1,this.errors=[],this.modal=!1,this.paused=!1,fn().reset(),ao().reset(),this.playing=!1,this.ready=!0},generateSaveData(){return{playTime:Sd(this.playTime.start,this.playTime.previousPlaytime)}},loadSaveData(t){this.playTime.previousPlaytime=t.playTime},saveGame(){const t=Bi(),e=Sr(),n=so(),r=fn(),o=Sn(),i=zi(),a=ao(),s=_r(),l={version:"1.0.0",screen:t.generateSaveData(),skills:e.generateSaveData(),dialog:n.generateSaveData(),vm:r.generateSaveData(),main:o.generateSaveData(),hud:i.generateSaveData(),audio:a.generateSaveData(),inventory:s.generateSaveData(),quests:Rr().generateSaveData()};CH(l)},setLoadedData(t){const e=Bi(),n=Sr(),r=so(),o=fn(),i=Sn(),a=zi(),s=ao(),l=_r();e.loadSaveData(t.screen),n.loadSaveData(t.skills),r.loadSaveData(t.dialog),o.loadSaveData(t.vm),i.loadSaveData(t.main),a.loadSaveData(t.hud),s.loadSaveData(t.audio),l.loadSaveData(t.inventory),Rr().loadSaveData(t.quests)},getAllStates(){return{main:this,screens:Bi(),skills:Sr(),dialog:so(),vm:fn(),hud:zi(),audio:ao(),rendering:xc(),notifications:wi(),inventory:_r(),quests:Rr()}},overrideStates(t){const e=this.getAllStates();for(const n in t){const r=t[n];Object.assign(e[n],r)}}}});function cW(t,e,n){console.error(`Parser error: ${t.fileName}:${t.currentLine}`,n);const r=`[Parser Error] in <span class="error-filename">${t.fileName}:${e+1}</span> - <b>${n}</b>`;hr(r)}function hr(t){const e=Sn();console.error(t),t=t.replace(/[\r\n]/g,`
|
|
178
|
+
<br />`),e.createError(`\u274C ${t}`)}const Sr=qo("skills",{state:()=>({skillChecks:{},skills:{}}),actions:{setupSkillCheck(t,e){this.skillChecks[e]=t},passSkillCheck(t,e){this.skillChecks[t].happened=!0,this.skillChecks[t].succeeded=!0,e&&(this.skillChecks[t].hidden=!0)},failSkillCheck(t,e){this.skillChecks[t].happened=!0,this.skillChecks[t].succeeded=!1,e&&(this.skillChecks[t].hidden=!0)},generateSaveData(){return{skillChecks:this.skillChecks,skills:this.skills}},getSkillCheck(t){return this.skillChecks[t]||this.setupSkillCheck(this.createSkillCheckState(),t),this.skillChecks[t]},createSkillCheckState(){return{happened:!1,succeeded:!1,hidden:!1}},loadSaveData(t){this.skillChecks=vd(this.skillChecks,t.skillChecks),this.skills=vd(this.skills,t.skills)},setupSkills(t){for(const e in t)this.skills[e]={id:e,level:t[e].startingLevel||0,xp:0}},addXp(t,e){const n=this.skills[t];n||hr(`Skill ${t} doesn't exist`),n.xp+=e,n.xp>=Bt().skillOptions.xpPerLevel&&(n.xp=0,n.level++,this.levelledUp(t))},incrementSkill(t,e){this.skills[t].level+=e,this.levelledUp(t)},levelledUp(t){const e=Bt().skills[t].name,n=this.skills[t].level;wi().addNotification(`Your skill in ${e} is now level ${n}`)}}});var QG=(()=>`.debug-menu{z-index:9999}.debug-button{position:fixed;bottom:10px;right:10px;padding:5px}.error-message{color:#ff4500;margin-top:10px;margin-bottom:10px}.error-filename{color:gray;text-decoration:underline}.debug-menu-container{width:100%}.search-result{border:1px solid var(--text-color);padding:10px;font-weight:700;font-size:20px;width:100}.jump-menu-container{width:80%}.debug-info{position:fixed;background-color:#0009;border:1px dotted var(--text-color);top:0;left:0;padding:5px}.variables-viewer{height:100%}
|
|
179
|
+
`)();let N8;const uW=P.defineComponent({components:{Modal:tl},setup(){const t=Sr(),e=P.computed(()=>t.skills),n=P.computed(()=>t.skillChecks);return{skills:e,skillChecks:n}},data(){return{showDebug:!1,jumping:!1,searchString:"",matches:[],matchCursor:0}},mounted(){window.addEventListener("keydown",t=>{if(this.jumping||(t.key==="d"&&this.toggle(),t.key==="j"&&this.jump()),t.key==="ArrowDown"&&(t.preventDefault(),this.matches.length>this.matchCursor+1?this.matchCursor+=1:this.matchCursor=0),t.key==="ArrowUp"&&(t.preventDefault(),this.matchCursor>0?this.matchCursor-=1:this.matchCursor=this.matches.length-1),t.key==="Escape"&&(this.finishJumping(),this.showDebug=!1),this.jumping&&t.key==="Enter"&&this.matchCursor<this.matches.length){const e=this.matches[this.matchCursor];fn().runLabel(e),this.finishJumping()}})},methods:{finishJumping(){this.jumping=!1,this.matches=[],this.searchString=""},labelSelected(t){const e=t.target.value;fn().runLabel(e),this.close()},close(){this.showDebug=!1},closeErrors(){Sn().clearErrors()},open(){this.showDebug=!0;const t=fn(),e=Sn(),n=Rr(),r=_r(),o=Sr();this.$nextTick(()=>{new ZA({target:this.$refs.variablesViewer,props:{content:{text:void 0,json:{data:this.variables,quests:n.quests,items:r.items,skills:o.skills,skillChecks:o.skillChecks}},onChange:i=>{t.overrideData(i.json.data),n.quests=i.json.quests,r.items=i.json.items,o.skills=i.json.skills,o.skillChecks=i.json.skillChecks}}}),new ZA({target:this.$refs.stateViewer,props:{content:{text:void 0,json:e.getAllStates()},onChange:i=>{e.overrideStates(i.json)}}})})},toggle(){this.showDebug?this.showDebug=!1:this.jumping?this.finishJumping():this.open()},jump(){N8=new os(this.labels,{includeScore:!0}),this.jumping=!0,setTimeout(()=>{this.$nextTick(()=>{this.$refs.search.focus()})},10),this.matchCursor=0,this.matches=this.labels},getMatchResultStyle(t){if(t===this.matchCursor)return{background:"var(--light-background)"}},onSearchInput(){const t=this.searchString;console.log(t);const e=N8.search(t);this.matches=e.map(n=>n.item),this.matches.length>0&&this.matchCursor>this.matches.length-1&&(this.matchCursor=this.matches.length-1)},save(){Sn().saveGame()},wordCount(){const e=Object.values(this.script).reduce((n,r)=>(Co.log(n),n+this.countWordsInScriptBranch(r.branch)),0);alert(`You have ${e} words`)},countWordsInScriptLine(t){if(t.command.commandType==="talk"&&typeof t.command.args[2]=="string")return this.countWordsInString(t.command.args[2]);if(t.command.commandType==="text")return this.countWordsInString(t.code);if(t.command.commandType==="choice"){const e=t.command.staticOptions;let n=this.countWordsInScriptLine(e.prompt);return n+=e.choices.reduce((o,i)=>o+this.countWordsInString(i.prompt.code),0),e.choices.reduce((o,i)=>i.branch?o+this.countWordsInScriptBranch(i.branch):o,n)}if(t.command.commandType==="if"){const e=t.command.staticOptions;return[e.success,e.failure].reduce((r,o)=>o?r+this.countWordsInScriptBranch(o):r,0)}return 0},countWordsInString(t){return t.split(" ").length},countWordsInScriptBranch(t){return t.reduce((e,n)=>n?e+this.countWordsInScriptLine(n):e,0)},getPlayTimeString(){const t=Sd(this.playTime.start,this.playTime.previousPlaytime);return Fg(t/1e3)}},computed:{...bi(fn,["script","data"]),...bi(Sn,["playTime","errors","playing","flowState"]),labels(){const t=this.script;return Object.keys(t).sort()},variables(){return this.data}}}),fW={class:"debug-menu"},dW={key:0,class:"debug-info"},hW=[P.createElementVNode("h3",null,"Debug mode is ON",-1),P.createElementVNode("ul",null,[P.createElementVNode("li",null,[P.createElementVNode("b",null,"j"),P.createTextVNode(": Quick Label Jump")]),P.createElementVNode("li",null,[P.createElementVNode("b",null,"d"),P.createTextVNode(": Debug Menu")]),P.createElementVNode("li",null,[P.createElementVNode("b",null,"Escape"),P.createTextVNode(": Toggle Menu")])],-1)],pW=P.createElementVNode("h3",{class:"title"},"Jump to label",-1),vW={key:0,class:"search-results"},mW={key:1},gW=[P.createElementVNode("h3",null,"No matches found",-1)],yW=P.createElementVNode("h3",{class:"title"},"Error(s)",-1),bW=P.createTextVNode(" There are errors in your dialogue scripts. Open the developer console for more details. "),wW=["innerHTML"],kW=P.createElementVNode("h3",{class:"title"},"Debug Menu!",-1),xW={class:"container"},jW=P.createTextVNode(" Hello this is the debug menu. "),_W=P.createElementVNode("option",{class:"option",selected:"",disabled:""},"Jump to a label",-1),SW=["value"],CW={class:"grid grid-cols-3 gap-4"},$W=P.createElementVNode("h2",null,"Variables Editor",-1),OW={ref:"variablesViewer"},AW=P.createElementVNode("h2",null,"Skill Checks",-1),EW={class:"table-auto"},PW=P.createElementVNode("thead",null,[P.createElementVNode("tr",null,[P.createElementVNode("th",null,"Skill Check"),P.createElementVNode("th",null,"Happened"),P.createElementVNode("th",null,"Succeeded")])],-1),MW=P.createElementVNode("h2",null,"App State editor (entire app and engine",-1),TW=P.createElementVNode("h3",{style:{color:"pink"}}," Use for debugging, editing some of those things can cause issues ",-1),IW={ref:"stateViewer"};function NW(t,e,n,r,o,i){const a=P.resolveComponent("modal");return P.openBlock(),P.createElementBlock("div",fW,[P.createElementVNode("button",{onClick:e[0]||(e[0]=(...s)=>t.open&&t.open(...s)),class:"button debug-button"},"Debug Menu"),!t.playing&&t.flowState==="menu"?(P.openBlock(),P.createElementBlock("div",dW,hW)):P.createCommentVNode("",!0),t.jumping?(P.openBlock(),P.createBlock(a,{key:1,onClose:t.finishJumping,containerCssClass:"jump-menu-container"},{header:P.withCtx(()=>[pW]),body:P.withCtx(()=>[P.withDirectives(P.createElementVNode("input",{type:"text",class:"label-input input",ref:"search","onUpdate:modelValue":e[1]||(e[1]=s=>t.searchString=s),onInput:e[2]||(e[2]=(...s)=>t.onSearchInput&&t.onSearchInput(...s))},null,544),[[P.vModelText,t.searchString]]),t.matches.length>0?(P.openBlock(),P.createElementBlock("div",vW,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.matches,(s,l)=>(P.openBlock(),P.createElementBlock("div",{class:"search-result",style:P.normalizeStyle(t.getMatchResultStyle(l)),key:l},P.toDisplayString(s),5))),128))])):(P.openBlock(),P.createElementBlock("div",mW,gW))]),_:1},8,["onClose"])):P.createCommentVNode("",!0),t.errors.length>0?(P.openBlock(),P.createBlock(a,{key:2,onClose:t.closeErrors,containerCssClass:"debug-menu-container"},{header:P.withCtx(()=>[yW]),body:P.withCtx(()=>[bW,P.createElementVNode("ul",null,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.errors,(s,l)=>(P.openBlock(),P.createElementBlock("li",{key:l,class:"error-message list-disc",innerHTML:s.text},null,8,wW))),128))])]),_:1},8,["onClose"])):P.createCommentVNode("",!0),t.showDebug?(P.openBlock(),P.createBlock(a,{key:3,onClose:t.close,containerCssClass:"debug-menu-container"},{header:P.withCtx(()=>[kW]),body:P.withCtx(()=>[P.createElementVNode("div",xW,[jW,P.createElementVNode("select",{class:"select",name:"label-selector",onChange:e[3]||(e[3]=s=>t.labelSelected(s))},[_W,(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.labels,s=>(P.openBlock(),P.createElementBlock("option",{class:"option",value:s,key:s},P.toDisplayString(s),9,SW))),128))],32),P.createElementVNode("div",CW,[P.createElementVNode("button",{onClick:e[4]||(e[4]=(...s)=>t.wordCount&&t.wordCount(...s)),class:"button"},"Word Count"),P.createElementVNode("button",{onClick:e[5]||(e[5]=(...s)=>t.save&&t.save(...s)),class:"button"},"Save Game")]),P.createElementVNode("h3",null,"Play time: "+P.toDisplayString(t.getPlayTimeString()),1),$W,P.createElementVNode("div",OW,null,512),AW,P.createElementVNode("table",EW,[PW,P.createElementVNode("tbody",null,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.skillChecks,(s,l)=>(P.openBlock(),P.createElementBlock("tr",{key:l},[P.createElementVNode("td",null,P.toDisplayString(l),1),P.createElementVNode("td",null,P.toDisplayString(s.happened?"\u2705":"\u274C"),1),P.createElementVNode("td",null,P.toDisplayString(s.happened?s.succeeded?"\u2705":"\u274C":"NA"),1)]))),128))])]),MW,TW,P.createElementVNode("div",IW,null,512)])]),_:1},8,["onClose"])):P.createCommentVNode("",!0)])}var LW=zr(uW,[["render",NW]]),eK=(()=>`.volume-label{margin-right:10px;font-size:20px;font-weight:700}.volume-controls{font-size:25px;display:flex;align-items:center;justify-content:center;margin:0 20px}.volume-slider{width:200px;background-color:#00f}
|
|
180
|
+
`)();const RW=P.defineComponent({data(){return{muted:!1}},mounted(){const t=ga.Howler.volume();this.$refs.slider.value=t},methods:{changeVolume(t){const e=t.target;ga.Howler.volume(e.value)},toggleMute(){this.muted?(ga.Howler.mute(!1),this.muted=!1):(ga.Howler.mute(!0),this.muted=!0)}}}),DW={class:"volume-controls"},zW=P.createElementVNode("label",{for:"volume",class:"volume-label"},"Volume",-1);function BW(t,e,n,r,o,i){return P.openBlock(),P.createElementBlock("div",DW,[zW,P.createElementVNode("input",{ref:"slider",class:"volume-slider",type:"range",id:"volume",name:"volume",min:"0",max:"1",step:"0.1",value:"0.5",onChange:e[0]||(e[0]=(...a)=>t.changeVolume&&t.changeVolume(...a))},null,544)])}var L8=zr(RW,[["render",BW]]),tK=(()=>`.hud{position:absolute;right:0;top:0;display:flex;flex-direction:row-reverse;z-index:3}.hud-stat{border:1px dotted white;background-color:var(--hud-background);color:var(--hud-text-color);padding:5px}.hud-icon{display:inline-block;height:1em}.hud-text{margin-left:5px}
|
|
181
|
+
`)();const FW=P.defineComponent({components:{VolumeControls:L8},data(){return{}},computed:{...bi(zi,["hudStats"]),...bi(xc,["layoutMode"]),statsConfig(){return Bt().hudStats},stats(){return this.hudStats},hudStyle(){let t="0";return this.layoutMode==="horizontal"&&(t=`${Bt().layout.minTextWidth}px`),{right:t}}}}),qW=["src"],VW={class:"bold hud-text"},HW=P.createTextVNode(": ");function WW(t,e,n,r,o,i){return P.openBlock(),P.createElementBlock("div",{class:"hud",style:P.normalizeStyle(t.hudStyle)},[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.stats,(a,s)=>(P.openBlock(),P.createElementBlock("div",{key:s,class:"hud-stat"},[P.createElementVNode("img",{class:"hud-icon",src:t.statsConfig[s].icon},null,8,qW),P.createElementVNode("span",VW,P.toDisplayString(t.statsConfig[s].name),1),HW,P.createElementVNode("span",null,P.toDisplayString(Math.floor(a.value*100)/100),1)]))),128))],4)}var UW=zr(FW,[["render",WW]]),nK=(()=>`#loading-bar{position:relative;width:40vw;height:100px;border-radius:50px;background:black}#inner-loading-bar{height:100%;border-radius:50px 0 0 50px;background:var(--light-background)}#loading-text{z-index:99999;display:flex;align-items:center;justify-content:space-around;position:absolute;width:100%;height:100%;top:0}
|
|
182
|
+
`)();const JW=P.defineComponent({props:{percentage:Number,step:String},methods:{loadingStyle(){return{width:`${this.percentage*40}vw`}}},computed:{}}),GW={id:"loading-bar"},KW={id:"loading-text"};function QW(t,e,n,r,o,i){return P.openBlock(),P.createElementBlock("div",GW,[P.createElementVNode("div",{id:"inner-loading-bar",style:P.normalizeStyle(t.loadingStyle())},null,4),P.createElementVNode("div",KW,[P.createElementVNode("h3",null,"Loading "+P.toDisplayString(Math.floor(t.percentage*100))+"% - "+P.toDisplayString(t.step),1)])])}var YW=zr(JW,[["render",QW]]),rK=(()=>`.notifications-holder{position:fixed;top:0;right:0;padding:10px;display:flex;flex-direction:column-reverse;align-items:center;pointer-events:none}.notification{margin-top:10px;margin-bottom:10px;border-radius:10px;padding:15px;background:var(--notifications-bg);width:40vh;text-align:center}
|
|
183
|
+
`)();const XW=P.defineComponent({data(){},methods:{},computed:{...bi(wi,["notifications"])}});function ZW(t,e,n,r,o,i){return P.openBlock(),P.createBlock(P.TransitionGroup,{name:"notification",tag:"div",class:"notifications-holder"},{default:P.withCtx(()=>[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.notifications,(a,s)=>(P.openBlock(),P.createElementBlock("div",{class:"notification",key:s},[P.createElementVNode("h3",null,P.toDisplayString(a.text),1)]))),128))]),_:1})}var eU=zr(XW,[["render",ZW]]);let _g;function tU(t){_g=t}function Sg(t){return _g.characters[t]}function nU(t,e){const n=Sg(t);if(e||(e="default"),n.sprites)return`${_g.config.imagesPath}${n.sprites[e]}`}function md(t){return t?Sg(t).style||{}:{}}function R8(t,e,n,r){const o=t/n,i=e/r;return Math.min(o,i)}function D8(t,e,n){const r=n.getBoundingClientRect(),o=n.width/r.width,i=t-r.x,a=e-r.y,s=i*o,l=a*o;return{x:s,y:l}}function z8(t,e,n,r,o,i,a,s){return!(t+n<o||e+r<i||t>o+a||e>i+s)}const Cg={};let B8=0,F8=0;function rU(t){return Co.log("Loading images"),new Promise((e,n)=>{for(const r in t.images){const o=t.images[r];oU(r,o,e,n)}})}function oU(t,e,n,r){B8++,Co.log(`Loading image ${t} at ${e}`);const o=new Image;o.onload=()=>{F8+=1,Cg[t]=o,Co.log(`Loaded image ${t} successfully`),F8>=B8&&(Co.log("All images loaded"),n())},o.onerror=i=>{console.error(`Error loading image ${t}`),r(i)},o.src=e}function q8(t,e=50,n={}){var u,d;let r;const o=(u=n.isImmediate)!=null?u:!1,i=(d=n.callback)!=null?d:!1,a=n.maxWait;let s=Date.now(),l=[];function c(){if(a!==void 0){const h=Date.now()-s;if(h+e>=a)return a-h}return e}const f=function(...h){const p=this;return new Promise((v,g)=>{const m=function(){if(r=void 0,s=Date.now(),!o){const b=t.apply(p,h);i&&i(b),l.forEach(({resolve:w})=>w(b)),l=[]}},y=o&&r===void 0;if(r!==void 0&&clearTimeout(r),r=setTimeout(m,c()),y){const b=t.apply(p,h);return i&&i(b),v(b)}l.push({resolve:v,reject:g})})};return f.cancel=function(h){r!==void 0&&clearTimeout(r),l.forEach(({reject:p})=>p(h)),l=[]},f}var oK=(()=>`.quit-button{margin:20px;text-align:center}
|
|
184
|
+
`)();const iU=P.defineComponent({components:{Modal:tl,VolumeControls:L8},data(){return{}},mounted(){},methods:{quit(){window.close()},mainMenu(){Sn().menuReturn(),this.closeMenu()},closeMenu(){this.$emit("close")},getPlayTimeString(){const t=Sd(this.playTime.start,this.playTime.previousPlaytime);return Fg(t/1e3)}},computed:{...bi(Sn,["playTime"])}}),aU=P.createElementVNode("h3",{class:"title"},"Menu",-1),sU={class:"menu-content"};function lU(t,e,n,r,o,i){const a=P.resolveComponent("VolumeControls"),s=P.resolveComponent("modal");return P.openBlock(),P.createBlock(s,{class:"menu",onClose:e[2]||(e[2]=l=>t.$emit("close")),containerCssClass:"menu-modal"},{header:P.withCtx(()=>[aU]),body:P.withCtx(()=>[P.createElementVNode("div",sU,[P.createElementVNode("h3",null,"Play time: "+P.toDisplayString(t.getPlayTimeString()),1),P.createVNode(a),P.createElementVNode("button",{class:"button title quit-button",onClick:e[0]||(e[0]=(...l)=>t.mainMenu&&t.mainMenu(...l))}," Main Menu "),P.createElementVNode("button",{class:"button title quit-button",onClick:e[1]||(e[1]=(...l)=>t.quit&&t.quit(...l))},"Exit")])]),_:1})}var cU=zr(iU,[["render",lU]]),iK=(()=>`.skills-modal{width:800px}.skills-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.skill-display{width:200px;height:300px;position:relative;background-size:cover}.skill-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--skills-text-color);background:var(--skills-text-background)}.skill-level{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--skills-level-color);width:var(--skills-xp-bar-height);height:var(--skills-xp-bar-height);background-color:var(--skills-level-background)}.skill-description-container{justify-content:space-between;align-items:stretch}.skill-left{flex-direction:column;border:1px dashed white;padding:10px;justify-content:center}.skill-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline}.skill-xp-container{position:absolute;top:0;left:0;height:var(--skills-xp-bar-height);width:calc(100% - var(--skills-xp-bar-height));background-color:#00000080}.skill-xp-bar{position:absolute;top:0;left:0;width:50%;height:100%;background-color:#0000fa80}.skill-xp-text{z-index:2}
|
|
185
|
+
`)();const uU=P.defineComponent({setup(){const t=Sr();return{skills:P.computed(()=>t.skills)}},components:{Modal:tl},data(){return{chosenSkill:!1}},mounted(){},methods:{getSkillStyle(t){return{backgroundImage:`url(${this.skillConf[t].icon})`}},getSkillName(t){return this.skillConf[t].name},clickSkill(t){this.chosenSkill=t},closeSkill(){this.chosenSkill=!1},xpBarWidth(t){return{width:`${Math.floor(t/this.xpPerLevel*100)}%`}}},computed:{skillsToDisplay(){const t={};for(const e in this.skills)this.skillConf[e].hidden&&this.skills[e].level<1||(t[e]=this.skills[e]);return t},skillConf(){return Bt().skills},xpPerLevel(){return Bt().skillOptions.xpPerLevel}}}),fU=P.createElementVNode("h3",{class:"title"},"Skills",-1),dU={key:0,class:"skills-container"},hU=["onClick"],pU={class:"skill-title"},vU={class:"skill-xp-container"},mU={class:"skill-xp-text"},gU={class:"skill-level"},yU={key:1},bU={class:"flex flex-row skill-description-container"},wU={class:"flex skill-left"},kU={class:"flex skill-right"},xU=P.createElementVNode("hr",{class:"hr-solid"},null,-1);function jU(t,e,n,r,o,i){const a=P.resolveComponent("modal");return P.openBlock(),P.createBlock(a,{class:"menu",onClose:e[1]||(e[1]=s=>t.$emit("close")),containerCssClass:"skills-modal"},{header:P.withCtx(()=>[fU]),body:P.withCtx(()=>[t.chosenSkill?typeof t.chosenSkill=="string"?(P.openBlock(),P.createElementBlock("div",yU,[P.createElementVNode("div",bU,[P.createElementVNode("div",wU,[P.createElementVNode("div",{class:"skill-display",style:P.normalizeStyle(t.getSkillStyle(t.chosenSkill))},null,4)]),P.createElementVNode("div",kU,[P.createElementVNode("h2",null,P.toDisplayString(t.getSkillName(t.chosenSkill)),1),xU,P.createElementVNode("h3",null,"Level: "+P.toDisplayString(t.skills[t.chosenSkill].level),1),P.createElementVNode("p",null,P.toDisplayString(t.skillConf[t.chosenSkill].description),1)])]),P.createElementVNode("button",{class:"button",onClick:e[0]||(e[0]=(...s)=>t.closeSkill&&t.closeSkill(...s))},P.toDisplayString("<--"))])):P.createCommentVNode("",!0):(P.openBlock(),P.createElementBlock("div",dU,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.skillsToDisplay,s=>(P.openBlock(),P.createElementBlock("button",{onClick:()=>t.clickSkill(s.id),class:"skill-display",style:P.normalizeStyle(t.getSkillStyle(s.id)),key:s.id},[P.createElementVNode("h3",pU,P.toDisplayString(t.getSkillName(s.id)),1),P.createElementVNode("div",vU,[P.createElementVNode("div",{class:"skill-xp-bar",style:P.normalizeStyle(t.xpBarWidth(s.xp))},null,4),P.createElementVNode("h3",mU,P.toDisplayString(s.xp)+" / "+P.toDisplayString(t.xpPerLevel)+" XP",1)]),P.createElementVNode("h3",gU,P.toDisplayString(s.level),1)],12,hU))),128))]))]),_:1})}var _U=zr(uU,[["render",jU]]),aK=(()=>`.inventory-modal{width:800px;min-height:50%}.inventory-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.item-display{width:200px;height:300px;position:relative;background-repeat:no-repeat;background-size:contain}.item-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--inventory-text-color);background:var(--inventory-text-background)}.item-amount{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--inventory-amount-color);width:40px;height:40px;background-color:var(--inventory-amount-background)}.item-description-container{justify-content:space-between;align-items:stretch}.item-left{border:1px dashed white;flex-direction:column;padding:10px;justify-content:center}.item-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline;padding:10px}
|
|
186
|
+
`)();const SU=P.defineComponent({setup(){const t=_r(),e=so(),n=P.computed(()=>t.items),r=P.computed(()=>e.currentDialog.choices);return{items:n,currentlyChoosing:r}},components:{Modal:tl},data(){return{chosenId:!1}},mounted(){},methods:{close(){this.$emit("close")},getItemStyle(t){return{backgroundImage:`url(${this.itemConf[t].icon})`}},getItemName(t){return this.itemConf[t].name},getItemConf(t){return this.itemConf[t]},clickItem(t){this.chosenId=t},closeItem(){this.chosenId=!1},useItem(){if(this.chosenItem&&this.canUseChosenItem&&this.chosenItemConf){const t=this.chosenItemConf.onUse;this.close(),t.action==="jump"?fn().runLabel(t.label):t.action==="run"?fn().runLabelFunction(t.label,!0):hr(`Unknown action ${t.action}`)}},canUseItem(t){const e=this.itemConf[t.id];return!!(e&&e.onUse&&!_r().isInteractionTagBlocked(e.tag)&&!this.currentlyChoosing)}},computed:{itemsToDisplay(){const t={};for(const e in this.items)this.items[e].amount>0&&(t[e]=this.items[e]);return t},chosenItem(){return this.chosenId?this.items[this.chosenId]:null},canUseChosenItem(){return this.canUseItem(this.chosenItem)},chosenItemConf(){return this.chosenId?this.itemConf[this.chosenId]:null},itemConf(){return Bt().items}}}),CU=P.createElementVNode("h3",{class:"title"},"Inventory",-1),$U={key:0,class:"inventory-container"},OU=["onClick"],AU={class:"item-title"},EU={class:"item-amount"},PU={key:1},MU={class:"flex flex-row item-description-container"},TU={class:"flex item-left"},IU={class:"flex item-right"},NU=P.createElementVNode("hr",{class:"hr-solid"},null,-1),LU={key:2},RU=[P.createElementVNode("h2",null,"The inventory is empty!",-1)];function DU(t,e,n,r,o,i){const a=P.resolveComponent("modal");return P.openBlock(),P.createBlock(a,{class:"menu",onClose:t.close,containerCssClass:"inventory-modal"},{header:P.withCtx(()=>[CU]),body:P.withCtx(()=>[!t.chosenItem&&Object.keys(t.itemsToDisplay).length>0?(P.openBlock(),P.createElementBlock("div",$U,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.itemsToDisplay,s=>(P.openBlock(),P.createElementBlock("button",{onClick:()=>t.clickItem(s.id),class:"item-display",style:P.normalizeStyle(t.getItemStyle(s.id)),key:s.id},[P.createElementVNode("h3",AU,P.toDisplayString(t.getItemName(s.id)),1),P.createElementVNode("h3",EU,P.toDisplayString(s.amount),1)],12,OU))),128))])):typeof t.chosenId=="string"?(P.openBlock(),P.createElementBlock("div",PU,[P.createElementVNode("div",MU,[P.createElementVNode("div",TU,[P.createElementVNode("div",{class:"item-display",style:P.normalizeStyle(t.getItemStyle(t.chosenId))},null,4)]),P.createElementVNode("div",IU,[P.createElementVNode("h2",null,P.toDisplayString(t.getItemName(t.chosenId)),1),NU,P.createElementVNode("h3",null,"Amount: "+P.toDisplayString(t.chosenItem.amount),1),P.createElementVNode("p",null,P.toDisplayString(t.chosenItemConf.description),1),P.createElementVNode("button",{onClick:e[0]||(e[0]=(...s)=>t.useItem&&t.useItem(...s)),class:P.normalizeClass(["button",t.canUseChosenItem?"":"disabled"])}," Use ",2)])]),P.createElementVNode("button",{class:"button",onClick:e[1]||(e[1]=(...s)=>t.closeItem&&t.closeItem(...s))},P.toDisplayString("<--"))])):(P.openBlock(),P.createElementBlock("div",LU,RU))]),_:1},8,["onClose"])}var zU=zr(SU,[["render",DU]]),lK=(()=>`.dialog-picture{position:absolute;width:80px;height:80px;border:2px solid white;border-radius:10px;background-color:gray;z-index:99}.dialog-picture img{width:100%;height:100%}
|
|
187
|
+
`)();const BU=P.defineComponent({props:{pictureUrl:String},computed:{...bi(xc,["layoutMode"]),boxStyle(){const t=Bt().layout;let e=0,n=0;return this.layoutMode==="vertical"?(e="50%",n=`${t.mobileDialogHeightPercentage-5}%`):(e=`${t.minTextWidth-10}px`,n="20%"),{right:e,bottom:n,width:`${t.portraits.width}px`,height:`${t.portraits.height}px`}}}}),FU=["src"];function qU(t,e,n,r,o,i){return P.openBlock(),P.createElementBlock("div",{class:"dialog-picture override",style:P.normalizeStyle(t.boxStyle)},[P.createElementVNode("img",{src:t.pictureUrl,class:"picture override"},null,8,FU)],4)}var VU=zr(BU,[["render",qU]]),cK=(()=>`.dialog-title{font-size:20px;font-weight:700}.dialog-text{font-size:16px}.dialog-box{color:var(--text-color);padding:10px 10px 10px 2em;margin-bottom:10px}.dialog-choice{color:var(--dialog-choice-color)}.dialog-choice:hover{color:var(--dialog-choice-hover-color);cursor:pointer}.buttons-container{width:100%;padding:10px;display:flex;justify-content:space-evenly;align-items:stretch;box-sizing:border-box}.interact-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:50px;color:var(--text-color);border:1px solid black;font-weight:700;font-size:24px;text-align:center;flex-grow:2;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.interact-button:not(:last-child){margin-right:10px}
|
|
188
|
+
`)();const HU=P.defineComponent({data(){return{playerText:"",passed:!1}},props:{options:{type:Object,required:!0},active:Boolean},mounted(){document.addEventListener("keydown",t=>{if(this.canInteract&&this.options.textField&&t.key==="Enter"&&this.submitText(),this.canInteract&&!this.options.textField){let e=-1;if(t.key===" ")this.choices?e=0:this.chooseOption(0);else switch(t.key){case" ":e=0;break;case"1":e=0;break;case"2":e=1;break;case"3":e=2;break;case"4":e=3;break;case"5":e=4;break;case"6":e=5;break;case"7":e=6;break;case"8":e=7;break}e!==-1&&this.choices&&e<this.choices.length&&this.chooseOption(this.choices[e])}}),setTimeout(()=>{this.options.textField&&this.$refs.playerInput.focus()},10)},computed:{...bi(Sn,["paused"]),preText(){return this.options.title?" \u2013 ":""},style(){return md(this.options.styleId)},dialogBoxStyle(){const t=md(this.options.styleId),e={opacity:this.options.old?"0.7":"1"};return this.options.title||(e.marginTop="-20px"),{...t.boxCss,...e}},titleStyle(){const t=md(this.options.styleId);return{color:t.color,...t.nameCss}},textStyle(){return md(this.options.styleId).textCss},choices(){if(this.options.choices)return this.options.choices},canInteract(){return this.active&&!this.passed&&this.options.interactive&&!this.paused}},methods:{chooseOption(t){this.passed=!0;let e;typeof t=="object"?e=t.originalIndex:e=t,Sn().playerAnswered(e)},dialogStyle(t){const e={};return t.allowed||(e.pointerEvents="none",e.textDecoration="line-through"),e},dialogClass(t){if(!t.allowed)return"strike-anim"},submitText(){const t=this.playerText;Sn().playerAnswered(t)}}}),WU={class:"dialog-content"},UU=["innerHTML"],JU=["innerHTML"],GU=["innerHTML"],KU={key:1,class:"dialog-choices"},QU=["onClick","innerHTML"],YU={key:2},XU={key:3,class:"buttons-container"};function ZU(t,e,n,r,o,i){return P.openBlock(),P.createElementBlock("div",{class:"dialog-box w-full override",style:P.normalizeStyle(t.dialogBoxStyle)},[P.createElementVNode("div",WU,[t.options.title?(P.openBlock(),P.createElementBlock("span",{key:0,class:"dialog-title override",style:P.normalizeStyle(t.titleStyle),innerHTML:t.options.title},null,12,UU)):P.createCommentVNode("",!0),P.createElementVNode("span",{class:"dialog-text dialog-separator override",style:P.normalizeStyle(t.textStyle),innerHTML:t.preText},null,12,JU),P.createElementVNode("span",{class:"dialog-text override",style:P.normalizeStyle(t.textStyle),innerHTML:t.options.text},null,12,GU),t.canInteract&&t.choices?(P.openBlock(),P.createElementBlock("div",KU,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.choices,(a,s)=>(P.openBlock(),P.createElementBlock("p",{key:s,style:P.normalizeStyle(t.dialogStyle(a)),class:P.normalizeClass([t.dialogClass(a),"dialog-choice override"]),onClick:l=>t.chooseOption(a),innerHTML:`${s+1}. \u2013\xA0 ${a.choice}`},null,14,QU))),128))])):t.canInteract&&t.options.textField?(P.openBlock(),P.createElementBlock("div",YU,[P.withDirectives(P.createElementVNode("input",{type:"text",class:"label-input input",ref:"playerInput",id:"player-input-field","onUpdate:modelValue":e[0]||(e[0]=a=>t.playerText=a)},null,512),[[P.vModelText,t.playerText]]),P.createElementVNode("button",{onClick:e[1]||(e[1]=(...a)=>t.submitText&&t.submitText(...a)),class:"button",id:"player-input-submit"}," Submit ")])):t.canInteract?(P.openBlock(),P.createElementBlock("div",XU,[P.createElementVNode("div",{onClick:e[2]||(e[2]=a=>t.chooseOption(0)),class:"interact-button button override"}," Continue ")])):P.createCommentVNode("",!0)])],4)}var eJ=zr(HU,[["render",ZU]]),uK=(()=>`.dialog-container{flex-shrink:2;min-height:100%;width:100%;background-color:(var(--bg-color));box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;overflow-x:hidden}.dialog{overflow-y:auto;overflow-x:hidden;position:relative;-ms-overflow-style:none;scrollbar-width:none}.dialog::-webkit-scrollbar{display:none}.dialog *{overflow-anchor:none}.anchor{overflow-anchor:auto;height:1px}
|
|
189
|
+
`)();const tJ=P.createElementVNode("div",{class:"anchor"},null,-1),nJ=P.defineComponent({__name:"game-dialog",props:{layoutMode:String,inGame:Boolean},setup(t){const e=t,n=fn(),r=P.computed(()=>n.stack),o=so(),i=P.computed(()=>o.dialog),a=P.ref(null),s=P.computed(()=>e.layoutMode==="vertical"?{}:{paddingBottom:`${Bt().layout.dialogBottomPadding}px`}),l=P.computed(()=>{if(i.value.length>0)return i.value[i.value.length-1]}),c=P.computed(()=>{if(l.value)return nU(l.value.speaker,l.value.pose)}),f=P.computed(()=>Bt().layout.minTextWidth),u=P.computed(()=>{let p;const v="100%";return e.layoutMode,{width:e.layoutMode==="horizontal"?`${f.value}px`:"100%",height:v,transform:p,transformOrigin:"right"}});function d(p,v){let m=Sg(p.speaker).name;return v>=1&&i.value[v-1].speaker===p.speaker&&(m=void 0),p.choices&&p.choices.forEach(y=>{y.choice=$8(y.choice)}),{title:m!=null?m:"",text:p.text,styleId:p.speaker,choices:p.choices,old:v<i.value.length-1,interactive:p.interactive,textField:p.textField}}function h(p){return p===o.dialog.length-1&&r.value.length>0}return P.watch(i.value,p=>{if(a.value){const v=a.value;v.scrollTop=v.scrollHeight+1e8}}),(p,v)=>(P.openBlock(),P.createElementBlock(P.Fragment,null,[P.createVNode(P.Transition,{name:"fade"},{default:P.withCtx(()=>[P.unref(c)?(P.openBlock(),P.createBlock(VU,{key:0,pictureUrl:P.unref(c)},null,8,["pictureUrl"])):P.createCommentVNode("",!0)]),_:1}),t.inGame?(P.openBlock(),P.createElementBlock("div",{key:0,class:"dialog override",ref_key:"dialogRef",ref:a,style:P.normalizeStyle(P.unref(u))},[P.createVNode(P.TransitionGroup,{name:"list",tag:"div",class:"dialog-container w-full override",style:P.normalizeStyle(P.unref(s))},{default:P.withCtx(()=>[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(P.unref(i),(g,m)=>(P.openBlock(),P.createBlock(eJ,{key:g.id,options:d(g,m),active:h(m)},null,8,["options","active"]))),128))]),_:1},8,["style"]),tJ],4)):P.createCommentVNode("",!0)],64))}}),V8=(t,e)=>{const n={};for(const r in t)e(t[r])&&(n[r]=t[r]);return n};var fK=(()=>`.quests-modal{width:100%;min-height:50%}.quest-header{display:flex;flex-direction:row;align-items:center}.quest-title{font-size:1.5rem;font-weight:700;margin-bottom:.5rem}.quest-completed{color:var(--completed-quest-title-color)}.quest-in-progress{color:var(--quest-title-color)}.quest-state{font-size:1.25rem;font-weight:700;margin-bottom:.5rem}.quest-description{font-size:1.1rem;text-align:justify;font-style:italic;margin-bottom:.5rem}.quest-objectives-container{margin-left:10px}.quest-objective-completed{color:var(--objective-completed-color);text-decoration:line-through}.quest-objective-in-progress{color:var(--objective-in-progress-color)}.quest-objective-description{font-size:1rem;margin-bottom:.5rem}
|
|
190
|
+
`)();const rJ=P.defineComponent({setup(){const t=Rr();return{quests:P.computed(()=>t.quests)}},computed:{questsToDisplay(){return V8(this.quests,t=>t.state!=="hidden")}},methods:{close(){this.$emit("close")},getQuestData(t){return dd(t)},getObjectiveData(t,e){return pg(t,e)},getDisplayTextForQuestState(t){switch(t.state){case"hidden":return" Hidden";case"unlocked":return"";case"completed":return" (Completed)";default:return" Unknown"}},getQuestDescription(t){return t.ending?t.ending:this.getQuestData(t.id).description},getAvailableObjectives(t){return V8(t.objectives,e=>e.state!=="hidden")}},components:{Modal:tl}}),oJ=P.createElementVNode("h3",{class:"title"},"Quests",-1),iJ={key:0,class:"quests-container"},aJ={class:"quest-title"},sJ={class:"quest-description"},lJ={key:0,class:"quest-objectives-container list-disc"},cJ={key:1,class:"menu-container"},uJ=[P.createElementVNode("h2",{class:"title"},"There are no quests!",-1)];function fJ(t,e,n,r,o,i){const a=P.resolveComponent("modal");return P.openBlock(),P.createBlock(a,{class:"quests",onClose:t.close,containerCssClass:"quests-modal"},{header:P.withCtx(()=>[oJ]),body:P.withCtx(()=>[Object.keys(t.questsToDisplay).length>0?(P.openBlock(),P.createElementBlock("div",iJ,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.questsToDisplay,s=>(P.openBlock(),P.createElementBlock("div",{class:"quest-display",key:s.id},[P.createElementVNode("div",{class:P.normalizeClass(["quest-header",s.state==="completed"?"quest-completed":"quest-in-progress"])},[P.createElementVNode("h3",aJ,P.toDisplayString(t.getQuestData(s.id).title)+" "+P.toDisplayString(t.getDisplayTextForQuestState(s)),1)],2),P.createElementVNode("p",sJ,P.toDisplayString(t.getQuestDescription(s)),1),s.state!=="completed"?(P.openBlock(),P.createElementBlock("ul",lJ,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.getAvailableObjectives(s),l=>(P.openBlock(),P.createElementBlock("li",{class:"quest-objective-display",key:l.id},[P.createElementVNode("p",{class:P.normalizeClass(["quest-objective-description",l.state==="completed"?"quest-objective-completed":"quest-objctive-in-progress"])},P.toDisplayString(t.getObjectiveData(s.id,l.id).description),3)]))),128))])):P.createCommentVNode("",!0)]))),128))])):(P.openBlock(),P.createElementBlock("div",cJ,uJ))]),_:1},8,["onClose"])}var dJ=zr(rJ,[["render",fJ]]),hK=(()=>`.menu-content{text-align:center}.menu-toggle-button{margin:0;padding:2px;border-radius:5px}.menu-toggle-button:not(:last-child){margin-right:10px}.menu-modal{width:500px}
|
|
191
|
+
`)();const hJ=P.defineComponent({data(){return{buttons:[{id:"menu",cssId:"menu-button",text:"Menu"},{id:"skills",cssId:"skills-menu-button",text:"Skills",condition:()=>this.showSkills},{id:"inventory",cssId:"inventory-menu-button",text:"Items",condition:()=>this.showInventory},{id:"quests",cssId:"quests-menu-button",text:"Quests",condition:()=>this.showQuests}],activeMenu:!1}},mounted(){document.addEventListener("keydown",t=>{t.key==="Escape"&&this.toggleMenu()}),or.callHook("onGameMounted")},unmounted(){or.callHook("onGameUnmounted")},methods:{buttonClick(t){t.onClick?t.onClick():Sn().openModal(t.id)},openMenu(){Sn().openModal("menu")},openSkills(){Sn().openModal("skills")},openInventory(){Sn().openModal("inventory")},openQuests(){Sn().openModal("quests")},closeMenu(){Sn().closeModal()},toggleMenu(){Sn().toggleMenu()}},computed:{buttonsToShow(){return this.buttons.map(t=>{const e=Bt().menuButtons[t.id]||{};return{...t,...e}}).filter(t=>t.condition?t.condition():!0)},showSkills(){return Object.entries(Bt().skills).length>0},showInventory(){return Object.entries(Bt().items).length>0},showQuests(){return Object.entries(Bt().quests).length>0}}}),pJ={class:"menu-container"},vJ=["onClick","id"];function mJ(t,e,n,r,o,i){return P.openBlock(),P.createElementBlock("div",pJ,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.buttonsToShow,a=>(P.openBlock(),P.createElementBlock("button",{key:a.id,onClick:s=>t.buttonClick(a),id:a.cssId,class:"button menu-toggle-button"},P.toDisplayString(a.text),9,vJ))),128))])}var gJ=zr(hJ,[["render",mJ]]),pK=(()=>`#app{background-color:var(--bg-color);width:100%;height:100%;position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;color:var(--text-color);box-sizing:border-box;overflow:hidden;transform-origin:center center}.game{background-color:var(--bg-color);position:relative;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;height:100%;box-sizing:border-box;overflow:hidden}.interact-button{height:50px;border:1px solid black;font-weight:700;font-size:20px;text-align:center;flex-grow:2;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.interact-button:not(:last-child){margin-right:10px}.background{margin:0}#background-canvas{height:100%}.menu-toggle{position:fixed;bottom:0px;right:15%;z-index:2}#game-title-container{margin-bottom:50px}#game-title-text{text-align:center;font-size:50px}.menu-button{font-size:25px}#game-header{position:relative;top:100px}
|
|
192
|
+
`)();const yJ=P.defineComponent({setup(){const t=so(),e=fn(),n=Sn();return{dialog:P.computed(()=>t.dialog),stack:P.computed(()=>e.stack),modal:P.computed(()=>n.modal),flowState:P.computed(()=>n.flowState)}},$refs:{dialogContainer:HTMLInputElement},inject:["mq"],components:{DebugMenu:LW,LoadingBar:YW,NotificationToast:eU,Hud:UW,MainMenu:cU,Skills:_U,InventoryUi:zU,GameDialog:nJ,QuestsUi:dJ,MenuButtons:gJ},data(){return{lineTitle:"title",lineText:"hello",gameLoaded:!1,loadingStep:"Loading",loadingPercentage:.1,hasSave:!1}},props:{config:Object,options:Object},async mounted(){or.callHook("onAppMounted"),this.loadingStep="Characters";const t=await bg("data/characters.json");await tU(JSON.parse(t)),this.loadingPercentage=.2,this.loadingStep="Data",this.loadingPercentage=.3,this.loadingStep="Images",await rU(Bt()),this.loadingPercentage=.7,this.loadingStep="Audio",await _H(Bt()),or.callHook("onAssetsLoaded"),this.loadingPercentage=.95,this.loadingStep="Starting...",await this.setupMachine(),or.callHook("onGameSetup"),this.loadingPercentage=.1,this.gameLoaded=!0,this.getSaveFile()&&(this.hasSave=!0),window.addEventListener("resize",q8(()=>{this.updateScreenSize()},100,{maxWait:200})),setTimeout(()=>{this.updateScreenSize()},50)},computed:{...bi(xc,["screenWidth","screenHeight","canvasWidth","canvasHeight","topOffset","leftOffset","layoutMode"]),...bi(fn,["currentLine"]),backgroundStyle(){let t;return this.layoutMode==="vertical"&&(t=`${100-Bt().layout.mobileDialogHeightPercentage}%`),{backgroundColor:"red",height:t}},layoutWidth(){return Bt().layout.backgrounds.width},gameTitle(){return Bt().gameTitle},inGame(){return this.flowState==="playing"},layoutHeight(){return Bt().layout.backgrounds.height},backgroundSize(){return{width:this.canvasWidth,height:this.canvasHeight,top:this.topOffset,left:this.leftOffset}},gameWidth(){const t=Bt();return this.layoutMode==="vertical"?window.innerWidth:t.layout.backgrounds.width+t.layout.minTextWidth},gameHeight(){const t=Bt();return this.layoutMode==="vertical"?window.innerHeight:t.layout.backgrounds.height},appStyle(){const t=Bt();if(this.screenWidth&&this.screenHeight&&t&&this.layoutMode==="horizontal"){const e=R8(this.screenWidth,this.screenHeight,this.gameWidth,this.gameHeight);return{transform:`scale(${e}, ${e})`,width:`${this.gameWidth}px`,height:`${this.gameHeight}px`}}return{}},gameStyle(){let t="row";return this.layoutMode==="vertical"&&(t="column"),{flexDirection:t}},screenRatio(){const t=Bt(),e=t.layout.minTextWidth+t.layout.backgrounds.width;return this.screenWidth/e}},methods:{async setupMachine(){const t=Bt().scripts;return Sn().setup(t,Bt())},getSaveFile(){return localStorage.getItem(m8)},async startGame(){bc("onPressStart"),await Sn().startGame()},async loadGame(){bc("onPressStart"),Sn().loadGame(this.getSaveFile())},nextLine(){fn().nextLine()},updateScreenSize(){xc().updateScreenSize(window.innerWidth,window.innerHeight,this.layoutMode==="horizontal"?Bt().layout.minTextWidth*this.screenRatio:0)},closeModal(){Sn().closeModal()}}}),bJ=["width","height"],wJ={key:2,id:"game-menu",style:{height:"100%",padding:"20px"}},kJ={id:"game-header"},xJ={id:"game-title-container"},jJ={id:"game-title-text"},_J={class:"flex flex-col"},SJ={key:3};function CJ(t,e,n,r,o,i){const a=P.resolveComponent("Hud"),s=P.resolveComponent("MenuButtons"),l=P.resolveComponent("Skills"),c=P.resolveComponent("InventoryUi"),f=P.resolveComponent("QuestsUi"),u=P.resolveComponent("MainMenu"),d=P.resolveComponent("GameDialog"),h=P.resolveComponent("LoadingBar"),p=P.resolveComponent("DebugMenu"),v=P.resolveComponent("NotificationToast");return P.openBlock(),P.createElementBlock("div",{id:"app",style:P.normalizeStyle(t.appStyle)},[t.inGame?(P.openBlock(),P.createBlock(a,{key:0})):P.createCommentVNode("",!0),t.inGame?(P.openBlock(),P.createElementBlock("div",{key:1,class:"game",style:P.normalizeStyle(t.gameStyle)},[P.createVNode(s,{class:"menu-toggle"}),t.modal==="skills"?(P.openBlock(),P.createBlock(l,{key:0,onClose:t.closeModal},null,8,["onClose"])):P.createCommentVNode("",!0),t.modal==="inventory"?(P.openBlock(),P.createBlock(c,{key:1,onClose:t.closeModal},null,8,["onClose"])):P.createCommentVNode("",!0),t.modal==="quests"?(P.openBlock(),P.createBlock(f,{key:2,onClose:t.closeModal},null,8,["onClose"])):P.createCommentVNode("",!0),t.modal==="menu"?(P.openBlock(),P.createBlock(u,{key:3,onClose:t.closeModal},null,8,["onClose"])):P.createCommentVNode("",!0),t.inGame?(P.openBlock(),P.createElementBlock("div",{key:4,class:"background",style:P.normalizeStyle(t.backgroundStyle)},[P.createElementVNode("canvas",{width:t.layoutWidth,height:t.layoutHeight,id:"background-canvas",class:"narrat-canvas"},null,8,bJ)],4)):P.createCommentVNode("",!0),P.createVNode(d,{inGame:t.inGame,layoutMode:t.layoutMode},null,8,["inGame","layoutMode"])],4)):t.gameLoaded?(P.openBlock(),P.createElementBlock("div",wJ,[P.createElementVNode("div",kJ,[P.createElementVNode("div",xJ,[P.createElementVNode("h1",jJ,P.toDisplayString(t.gameTitle),1)]),P.createElementVNode("div",_J,[P.createElementVNode("button",{class:"button menu-button main-menu-button larg start-button override",onClick:e[0]||(e[0]=(...g)=>t.startGame&&t.startGame(...g))}," Start Game "),t.hasSave?(P.openBlock(),P.createElementBlock("button",{key:0,class:"button menu-button main-menu-button large continue-button override",onClick:e[1]||(e[1]=(...g)=>t.loadGame&&t.loadGame(...g))}," Continue Game ")):P.createCommentVNode("",!0)])])])):(P.openBlock(),P.createElementBlock("div",SJ,[P.createVNode(h,{percentage:t.loadingPercentage,step:t.loadingStep},null,8,["percentage","step"])])),t.options.debug?(P.openBlock(),P.createBlock(p,{key:4})):P.createCommentVNode("",!0),P.createVNode(v)],4)}var $J=zr(yJ,[["render",CJ]]);let Vo,ki;const ya={x:0,y:0};function OJ(){document.addEventListener("mousemove",t=>{ya.x=t.clientX,ya.y=t.clientY}),document.addEventListener("click",q8(AJ,100,{maxWait:200})),H8()}function H8(){const t=Bi();if(Sn().playing){if(!Vo)Vo=document.querySelector("#background-canvas"),Vo&&!ki&&(ki=Vo.getContext("2d"));else if(Vo&&ki){ki.fillStyle="white",ki.fillRect(0,0,Vo.width,Vo.height);const n=t.currentScreen,r=Bt().screens[n],o=r.background;ki.drawImage(Cg[o],0,0);let i=!1;const a=D8(ya.x,ya.y,Vo);if(r.buttons){for(const s of r.buttons)if(t.buttons[s].enabled){const l=Bt().buttons[s],c=Cg[l.background];ki.drawImage(c,l.position.left,l.position.top),z8(a.x,a.y,1,1,l.position.left,l.position.top,l.position.width,l.position.height)&&(i=!0)}}i?document.body.style.cursor="pointer":document.body.style.cursor="default",ki.fillStyle="black",ki.textAlign="left"}}else Vo=void 0,ki=void 0;window.requestAnimationFrame(H8)}function AJ(t){const e=Bi(),n=fn();if(!Vo)return;ya.x=t.clientX,ya.y=t.clientY;const r=D8(ya.x,ya.y,Vo),o=e.currentScreen,i=Bt().screens[o];if(i.buttons){for(const a of i.buttons)if(e.buttons[a].enabled){const s=Bt().buttons[a];if(z8(r.x,r.y,1,1,s.position.left,s.position.top,s.position.width,s.position.height)){const l=s.action,c={branchData:n.script[l],currentIndex:0,label:l};n.setStack(c),n.runLine()}}}}function Qn(t,e){console.error("Runtime error ========================="),console.error("Args: ",t.args),console.error("Options: ",t.options),hr(`Runtime error at ${t.fileName}:${t.line} (${t.commandType}) ${t.code}. -
|
|
193
193
|
<br />
|
|
194
|
-
Error: ${e}`),console.error("============================")}class gt{constructor(e,n,r,o){Go(this,"keyword");Go(this,"runner");Go(this,"argTypes");Go(this,"parser");Go(this,"onPlayerAnswered");Go(this,"returnAfterPlayerAnswer");this.keyword=e,this.runner=r,this.argTypes=n,o?this.parser=o:this.parser=jc(this.keyword,this.argTypes),this.returnAfterPlayerAnswer=!1}async run(e,n){let r=await this.runner(e,n);return this.returnAfterPlayerAnswer&&(r=await new Promise((o,i)=>{fn().waitForPlayerAnswer(e),e.finishCommand=o})),r}async processPlayerAnswer(e,n){let r=n;return this.onPlayerAnswered&&(r=await this.onPlayerAnswered(e,n)),this.returnAfterPlayerAnswer&&e.finishCommand&&e.finishCommand(r),r}static FromOptions(e){var r;const n=new gt(e.keyword,e.argTypes,e.runner,e.parser);return n.onPlayerAnswered=e.onPlayerAnswered,n.returnAfterPlayerAnswer=(r=e.returnAfterPlayerAnswer)!=null?r:!1,n}}function jc(t,e){let n=[];if(e!=="any"){n=[e.length];const r=e.reduce((o,i)=>i.optional?o+1:o,0);if(r>1)throw new Error(`Only one optional argument is allowed for commands but ${t} has multiple ones`);r===1&&n.push(e.length-1)}return(r,o)=>{const i={newLine:r.currentLine+1},a=o.command.args;return e!=="any"&&!n.includes(a.length)?(console.log("Error details"),console.log(o.command),console.log(a),r.parserContext.error(r.line.line,`Command ${t}: Expected ${n.join(" or ")} arguments but got ${a.length}`),i):(o.command.commandType=t,e!=="any"&&o.command.args.forEach((s,l)=>{const c=e[l];M8(s)||c.type==="any"||typeof s===c.type||r.parserContext.error(r.line.line,`Command ${t}: Argument #${l+1} (${c.name}) should be a ${c.type}, but got type ${typeof s}: ${JSON.stringify(s)}`)}),{newLine:r.currentLine+1})}}const PJ=new gt("add_level",[{name:"skillKey",type:"string"},{name:"amount",type:"number"}],async t=>{const{skillKey:e,amount:n}=t.options;(!e||!n)&&Qn(t,"add_level command needs a skill id and a value as parameters"),Sr().incrementSkill(e,n)}),MJ=new gt("add_xp",[{name:"xpKey",type:"string"},{name:"xpToAdd",type:"number"}],async t=>{const{xpKey:e,xpToAdd:n}=t.options;(!e||!n)&&Qn(t,"add_xp command needs a skill id and a value as parameters"),Sr().addXp(e,n)}),TJ=new gt("roll",[{name:"id",type:"string"},{name:"skill",type:"string"},{name:"value",type:"number"},{name:"hideAfterRoll",type:"boolean",optional:!0}],async t=>{const{id:e,skill:n,value:r,hideAfterRoll:o}=t.options;return P8({id:e,skill:n,value:r,hideAfterRoll:o}).succeeded}),IJ=new gt("add_stat",[{name:"statKey",type:"string"},{name:"amountToAdd",type:"number"}],async t=>{const{statKey:e,amountToAdd:n}=t.options;(!e||typeof n!="number")&&Qn(t,"add_stat command needs a stat id and a value as parameters"),zi().addStat(e,n)}),NJ=new gt("set_stat",[{name:"statKey",type:"string"},{name:"value",type:"number"}],async t=>{const{statKey:e,value:n}=t.options;(!e||typeof n!="number")&&Qn(t,"set_stat command needs a stat id and a value as parameters"),zi().setStat(e,n)}),LJ=new gt("get_stat_value",[{name:"statKey",type:"string"}],async t=>{const{statKey:e}=t.options;return e||Qn(t,"get_stat_value command needs a stat id as parameter"),zi().getStatValue(e)}),RJ=gt.FromOptions({keyword:"jump",argTypes:"any",runner:async t=>{(t.args.length<1||typeof t.args[0]!="string")&&Qn(t,"requires a label argument");const e=t.args[0],n=fn(),r={branchData:n.script[e],label:e,args:t.args.splice(1),currentIndex:0};n.setStack(r),await Sn().saveGame(),await n.runFrame()}}),DJ=gt.FromOptions({keyword:"run",argTypes:"any",runner:async t=>{(t.args.length<1||typeof t.args[0]!="string")&&Qn(t,"run command needs a label to argument run");const e=t.args[0];return await fn().runLabelFunction(e,...t.args.slice(1))}}),zJ=gt.FromOptions({keyword:"var",argTypes:[{name:"name",type:"string"},{name:"value",type:"any"}],runner:async t=>{const{name:e,value:n}=t.options;fn().addScopedVariable(e,n)}}),BJ=gt.FromOptions({keyword:"return",argTypes:[{name:"value",type:"any"}],runner:async t=>{const{value:e}=t.options;fn().setReturnValue(e)}}),$g=[{name:"mode",type:"string"},{name:"audio",type:"string",optional:!0}],FJ=new gt("play",$g,async t=>{const e=t.options;e.mode==="music"?pd(e.audio):h8(e.audio)}),qJ=new gt("pause",$g,async t=>{const e=t.options;if(e.mode==="music"){const n=ao();n.currentMusic&&v8(n.currentMusic)}else e.mode==="sound"&&e.audio?v8(e.audio):Qn(t,"pause first option needs to either be in music mode, or if stopping a sound needs to have the sound name supplied as second argument.")}),VJ=new gt("stop",$g,async t=>{const e=t.options;e.mode==="music"?ao().currentMusic&&ao().stopMusic():e.mode==="sound"&&e.audio?p8(e.audio):Qn(t,"stop option needs to either be in music mode, or if stopping a sound needs to have the sound name supplied as second argument.")}),HJ=new gt("set",[{name:"key",type:"string"},{name:"value",type:"any"}],async t=>{const e=Xs();w8(e,t.options.key,t.options.value)}),WJ=new gt("add",[{name:"key",type:"string"},{name:"value",type:"any"}],async t=>{const e=Xs();k8(e,t.options.key,t.options.value)}),UJ=new gt("set_screen",[{name:"screen",type:"string"}],async t=>{Bi().setScreen(t.options.screen)}),JJ=new gt("set_button",[{name:"buttonId",type:"string"},{name:"enabled",type:"boolean"}],async t=>{const{buttonId:e,enabled:n}=t.options;Bi().changeButton(e,n)}),GJ=gt.FromOptions({keyword:"talk",argTypes:[{name:"speaker",type:"string"},{name:"pose",type:"string"},{name:"text",type:"string"}],runner:async(t,e)=>{await I8({speaker:t.options.speaker,pose:t.options.pose,text:`"${t.options.text}"`,choices:e,interactive:!0})},returnAfterPlayerAnswer:!0}),KJ=()=>{const t=jc("text",[]);return(e,n)=>{const r=t(e,n);return n.command.staticOptions={text:n.code},r}},QJ=gt.FromOptions({keyword:"text",argTypes:[],runner:async(t,e)=>{await I8({speaker:"game",text:t.staticOptions.text,choices:e,interactive:!0})},parser:KJ(),returnAfterPlayerAnswer:!0}),YJ=new gt("add_item",[{name:"id",type:"string"},{name:"amount",type:"number"}],async t=>{const{id:e,amount:n}=t.options;_r().add({id:e,amount:n})}),XJ=new gt("remove_item",[{name:"id",type:"string"},{name:"amount",type:"number"}],async t=>{const{id:e,amount:n}=t.options;_r().remove({id:e,amount:n})}),ZJ=new gt("has_item?",[{name:"id",type:"string"},{name:"amount",type:"number",optional:!0}],async t=>{const{id:e,amount:n}=t.options;return _r().hasItem(e,n)}),eG=new gt("item_amount?",[{name:"id",type:"string"}],async t=>{const{id:e}=t.options;return _r().getItemAmount(e)}),tG=new gt("enable_interaction",[{name:"tag",type:"string"}],async t=>{const e=t.options.tag;_r().enableInteraction(e)}),nG=new gt("disable_interaction",[{name:"tag",type:"string"}],async t=>{const e=t.options.tag;_r().disableInteraction(e)}),rG=new gt("start_quest",[{name:"questId",type:"string"}],async t=>{const e=t.options.questId;Rr().startQuest(e)}),oG=new gt("start_objective",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;Rr().startObjective(e,n)}),iG=new gt("complete_objective",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;Rr().completeObjective(e,n)}),aG=new gt("complete_quest",[{name:"questId",type:"string"},{name:"ending",type:"string",optional:!0}],async t=>{const{questId:e,ending:n}=t.options;Rr().completeQuest(e,n)}),sG=new gt("quest_completed?",[{name:"questId",type:"string"}],async t=>{const{questId:e}=t.options;return Rr().isQuestCompleted(e)}),lG=new gt("objective_completed?",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;return Rr().isObjectiveCompleted(e,n)}),cG=new gt("quest_started?",[{name:"questId",type:"string"}],async t=>{const{questId:e}=t.options;return Rr().isQuestStarted(e)}),uG=new gt("objective_started?",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;return Rr().isObjectiveStarted(e,n)}),fG=new gt("wait",[{name:"duration",type:"number"}],async t=>{await vg(t.options.duration)}),dG=new gt("notify",[{name:"text",type:"string"}],async t=>{const{text:e}=t.options;wi().addNotification(e)}),hG=new gt("clear_dialog",[],async t=>{so().clearDialog()}),pG=new gt("if",[{name:"condition",type:"boolean"}],async t=>{const e=iW(t),n=fn();if(e){const r={branchData:{branch:e},currentIndex:0};return n.addAndRunFrame(r)}},(t,e)=>{let n=t.currentLine;jc("if",[{name:"condition",type:"string"}])(t,e);const{lines:o,currentLine:i,line:a}=t,s=e.command;let l;const c=aW(o,i+1);return c&&c.code==="else:"&&(l=t.processCommandsFunction(t.parserContext,c.branch,a),n++),s.staticOptions={success:t.processCommandsFunction(t.parserContext,a.branch,a),failure:l},n++,{newLine:n}}),vG=new gt("==","any",async t=>{t.args.length<2&&Qn(t,"requires at least two arguments");let e=t.args[0],n=!0;for(const r of t.args)if(r!=e){n=!1;break}else e=r;return n}),mG=new gt(">",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e>n}),gG=new gt("<",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e<n}),yG=new gt(">=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e>=n}),bG=new gt("<=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e<=n}),wG=new gt("!=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e!=n}),kG=new gt("!",[{name:"a",type:"any"}],async t=>{const{a:e}=t.options;return!e}),xG=new gt("&&","any",async t=>{const e=t.args;return t.args.length<2&&Qn(t,"requires at least two arguments"),e.reduce((n,r)=>n&&r,!0)}),jG=new gt("||","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>e||n,!1))),_G=new gt("?",[{name:"a",type:"any"},{name:"b",type:"any"},{name:"c",type:"any"}],async t=>{const{a:e,b:n,c:r}=t.options;return e?n:r}),SG=new gt("+","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e+n:(Qn(t,"requires all arguments to be numbers"),e),0))),CG=new gt("-","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e-n:(Qn(t,"requires all arguments to be numbers"),e),0))),$G=new gt("*","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e*n:(Qn(t,"requires all arguments to be numbers"),e),0))),OG=new gt("/","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e/n:(Qn(t,"requires all arguments to be numbers"),e),0))),AG=async t=>{const{prompt:e,choices:n}=t.staticOptions,r=[];for(const[a,s]of n.entries()){const l=await jg(s.prompt);r.push(l)}t.options.choiceResults=r;const o=r.map((a,s)=>{var f,u;let l=!0;return a.skillCheck&&(l=(u=(f=a.skillCheck)==null?void 0:f.allowed)!=null?u:!1),{choice:a.text,originalIndex:s,allowed:l}}).filter(a=>a.choice),i=await N8(e,o);await TG(t,i)};function EG(t,e,n){e.expression,e.branch||t.parserContext.error(e.line,`Choice option doesn't have any branch to go to (${e.code} - ${e.line})`);let r,o;const i=e.branch;return e.expression[1]==="roll"?((!i[0].branch||!i[1].branch)&&t.parserContext.error(e.line,`Choice option with a skill roll needs success and failure branches (${e.code} - ${e.line})`),r={success:t.processCommandsFunction(t.parserContext,i[0].branch,e),failure:t.processCommandsFunction(t.parserContext,i[1].branch,e)}):o=t.processCommandsFunction(t.parserContext,i,e),{prompt:t.processCommandsFunction(t.parserContext,[e],e)[0],branch:o,skillBranches:r}}const PG=(t,e)=>{let n=t.currentLine;jc("choice",[]);const{line:r}=t,o=e.command;(!r.branch||r.branch.length<2)&&t.parserContext.error(r.line,"Choice menu needs to have at least one option");const i=r.branch[0];i||t.parserContext.error(t.line.line,"Choice prompt is missing ");const s=r.branch.slice(1).map((l,c)=>(l.branch||t.parserContext.error(l.line,`Choice option doesn't have any branch to go to (${l.code})`),l=IG(t.parserContext,l),EG(t,l)));return o.staticOptions={prompt:t.processCommandsFunction(t.parserContext,[i],r)[0],choices:s},n++,{newLine:n}},MG=gt.FromOptions({keyword:"choice",argTypes:[],runner:AG,parser:PG}),TG=async(t,e)=>{const n=e,r=fn(),{choices:o}=t.staticOptions,i=o[n],a=t.options.choiceResults[n];let s=a.text,l;if(a.skillCheck?(s=null,P8({skill:a.skillCheck.skillId,value:a.skillCheck.difficulty,id:a.skillCheck.skillCheckId,hideAfterRoll:a.skillCheck.hideAfterRoll}).succeeded?l=i.skillBranches.success:l=i.skillBranches.failure):l=i.branch,s){const c={speaker:"player",text:s,interactive:!1};so().addDialog(c)}if(l){const c={currentIndex:0,branchData:{branch:l}};await r.addAndRunFrame(c)}};function IG(t,e){return{code:`choicePrompt ${e.code}`,indentation:e.indentation,line:e.line,branch:e.branch,expression:["choicePrompt",...e.expression]}}const NG=new gt("choicePrompt","any",async t=>{const e=t.args;if(e[0]==="roll"){const n=e[1],r=e[2],o=e[3],i=e[4],a=e.length>5?e[5]:!1,s=Sr().getSkillCheck(n);if(s.hidden)return{text:null};const l=s.happened&&!s.succeeded,{difficultyText:c}=tW({skill:r,skillCheckId:n,value:o});return{text:`${c} ${i}`,skillCheck:{allowed:!l,skillId:r,skillCheckId:n,difficulty:o,hideAfterRoll:a}}}else if(e.length>1&&e[1]==="if"){const n=e[0];let r=!0;return e.length>2&&(r=e[2]),r?{text:n}:{text:null}}else return{text:e[0]}}),W8=gt.FromOptions({keyword:"text_field",argTypes:[{name:"prompt",type:"string"}],returnAfterPlayerAnswer:!0,runner:async t=>{const e={speaker:"game",text:t.options.prompt,textField:!0,interactive:!0};so().addDialog(e)}});W8.onPlayerAnswered=async(t,e)=>(typeof e!="string"&&Qn(t,"The player's answer should be a string"),e);const LG=gt.FromOptions({keyword:"text_field_prompt",argTypes:[{name:"prompt",type:"string"}],runner:async t=>{const e={speaker:"game",text:t.options.prompt,textField:!0,interactive:!0};so().addDialog(e)}});function RG(t){t.addCommand(MG),t.addCommand(NG),t.addCommand(pG),t.addCommand(IJ),t.addCommand(NJ),t.addCommand(LJ),t.addCommand(hG),t.addCommand(dG),t.addCommand(qJ),t.addCommand(FJ),t.addCommand(VJ),t.addCommand(JJ),t.addCommand(UJ),t.addCommand(fG),t.addCommand(vG),t.addCommand(mG),t.addCommand(gG),t.addCommand(yG),t.addCommand(bG),t.addCommand(wG),t.addCommand(kG),t.addCommand(xG),t.addCommand(jG),t.addCommand(_G),t.addCommand(SG),t.addCommand(CG),t.addCommand($G),t.addCommand(OG),t.addCommand(WJ),t.addCommand(HJ),t.addCommand(QJ),t.addCommand(GJ),t.addCommand(RJ),t.addCommand(DJ),t.addCommand(zJ),t.addCommand(BJ),t.addCommand(rG),t.addCommand(oG),t.addCommand(iG),t.addCommand(aG),t.addCommand(cG),t.addCommand(uG),t.addCommand(sG),t.addCommand(lG),t.addCommand(YJ),t.addCommand(XJ),t.addCommand(tG),t.addCommand(nG),t.addCommand(ZJ),t.addCommand(eG),t.addCommand(PJ),t.addCommand(MJ),t.addCommand(TJ),t.addCommand(W8),t.addCommand(LG)}let _c;or.callHook("onPageLoaded");async function DG(t,e){const n=await bg("data/config.json");gH(JSON.parse(n)),_c=P.createApp(OJ,{config:t,options:e});const r=bH();if(_c.use(r),Sn().setOptions(e),_c.use(X8,{breakpoints:{s:0,m:800,l:1200}}),RG(or),Bg.setupDebugger(e.debug),console.log("%c Narrat game engine \u2013 [VI]{version} - {date}[/VI]","background: #222; color: #bada55"),or.callHook("onNarratSetup"),_c.mount("#game-holder"),e.debug){const o={app:_c,vm:or,jump:i=>{fn().runLabel(i)}};window.narrat=o}AJ()}class zG{onPageLoaded(){}onNarratSetup(){}onAppMounted(){}onAssetsLoaded(){}onGameSetup(){}onGameStart(){}onGameMounted(){}onGameDismounted(){}}function BG(t){or.addPlugin(t)}function FG(t){or.addCommand(t)}sn.CommandPlugin=gt,sn.NarratPlugin=zG,sn.addCommand=FG,sn.aspectRatioFit=D8,sn.generateParser=jc,sn.getConfig=Bt,sn.registerPlugin=BG,sn.startApp=DG,Object.defineProperties(sn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
194
|
+
Error: ${e}`),console.error("============================")}class gt{constructor(e,n,r,o){Go(this,"keyword");Go(this,"runner");Go(this,"argTypes");Go(this,"parser");Go(this,"onPlayerAnswered");Go(this,"returnAfterPlayerAnswer");this.keyword=e,this.runner=r,this.argTypes=n,o?this.parser=o:this.parser=jc(this.keyword,this.argTypes),this.returnAfterPlayerAnswer=!1}async run(e,n){let r=await this.runner(e,n);return this.returnAfterPlayerAnswer&&(r=await new Promise((o,i)=>{fn().waitForPlayerAnswer(e),e.finishCommand=o})),r}async processPlayerAnswer(e,n){let r=n;return this.onPlayerAnswered&&(r=await this.onPlayerAnswered(e,n)),this.returnAfterPlayerAnswer&&e.finishCommand&&e.finishCommand(r),r}static FromOptions(e){var r;const n=new gt(e.keyword,e.argTypes,e.runner,e.parser);return n.onPlayerAnswered=e.onPlayerAnswered,n.returnAfterPlayerAnswer=(r=e.returnAfterPlayerAnswer)!=null?r:!1,n}}function jc(t,e){let n=[];if(e!=="any"){n=[e.length];const r=e.reduce((o,i)=>i.optional?o+1:o,0);if(r>1)throw new Error(`Only one optional argument is allowed for commands but ${t} has multiple ones`);r===1&&n.push(e.length-1)}return(r,o)=>{const i={newLine:r.currentLine+1},a=o.command.args;return e!=="any"&&!n.includes(a.length)?(console.log("Error details"),console.log(o.command),console.log(a),r.parserContext.error(r.line.line,`Command ${t}: Expected ${n.join(" or ")} arguments but got ${a.length}`),i):(o.command.commandType=t,e!=="any"&&o.command.args.forEach((s,l)=>{const c=e[l];P8(s)||c.type==="any"||typeof s===c.type||r.parserContext.error(r.line.line,`Command ${t}: Argument #${l+1} (${c.name}) should be a ${c.type}, but got type ${typeof s}: ${JSON.stringify(s)}`)}),{newLine:r.currentLine+1})}}const EJ=new gt("add_level",[{name:"skillKey",type:"string"},{name:"amount",type:"number"}],async t=>{const{skillKey:e,amount:n}=t.options;(!e||!n)&&Qn(t,"add_level command needs a skill id and a value as parameters"),Sr().incrementSkill(e,n)}),PJ=new gt("add_xp",[{name:"xpKey",type:"string"},{name:"xpToAdd",type:"number"}],async t=>{const{xpKey:e,xpToAdd:n}=t.options;(!e||!n)&&Qn(t,"add_xp command needs a skill id and a value as parameters"),Sr().addXp(e,n)}),MJ=new gt("roll",[{name:"id",type:"string"},{name:"skill",type:"string"},{name:"value",type:"number"},{name:"hideAfterRoll",type:"boolean",optional:!0}],async t=>{const{id:e,skill:n,value:r,hideAfterRoll:o}=t.options;return E8({id:e,skill:n,value:r,hideAfterRoll:o}).succeeded}),TJ=new gt("add_stat",[{name:"statKey",type:"string"},{name:"amountToAdd",type:"number"}],async t=>{const{statKey:e,amountToAdd:n}=t.options;(!e||typeof n!="number")&&Qn(t,"add_stat command needs a stat id and a value as parameters"),zi().addStat(e,n)}),IJ=new gt("set_stat",[{name:"statKey",type:"string"},{name:"value",type:"number"}],async t=>{const{statKey:e,value:n}=t.options;(!e||typeof n!="number")&&Qn(t,"set_stat command needs a stat id and a value as parameters"),zi().setStat(e,n)}),NJ=new gt("get_stat_value",[{name:"statKey",type:"string"}],async t=>{const{statKey:e}=t.options;return e||Qn(t,"get_stat_value command needs a stat id as parameter"),zi().getStatValue(e)}),LJ=gt.FromOptions({keyword:"jump",argTypes:"any",runner:async t=>{(t.args.length<1||typeof t.args[0]!="string")&&Qn(t,"requires a label argument");const e=t.args[0],n=fn(),r={branchData:n.script[e],label:e,args:t.args.splice(1),currentIndex:0};n.setStack(r),await Sn().saveGame(),await n.runFrame()}}),RJ=gt.FromOptions({keyword:"run",argTypes:"any",runner:async t=>{(t.args.length<1||typeof t.args[0]!="string")&&Qn(t,"run command needs a label to argument run");const e=t.args[0];return await fn().runLabelFunction(e,...t.args.slice(1))}}),DJ=gt.FromOptions({keyword:"var",argTypes:[{name:"name",type:"string"},{name:"value",type:"any"}],runner:async t=>{const{name:e,value:n}=t.options;fn().addScopedVariable(e,n)}}),zJ=gt.FromOptions({keyword:"return",argTypes:[{name:"value",type:"any"}],runner:async t=>{const{value:e}=t.options;fn().setReturnValue(e)}}),$g=[{name:"mode",type:"string"},{name:"audio",type:"string",optional:!0}],BJ=new gt("play",$g,async t=>{const e=t.options;e.mode==="music"?pd(e.audio):h8(e.audio)}),FJ=new gt("pause",$g,async t=>{const e=t.options;if(e.mode==="music"){const n=ao();n.currentMusic&&v8(n.currentMusic)}else e.mode==="sound"&&e.audio?v8(e.audio):Qn(t,"pause first option needs to either be in music mode, or if stopping a sound needs to have the sound name supplied as second argument.")}),qJ=new gt("stop",$g,async t=>{const e=t.options;e.mode==="music"?ao().currentMusic&&ao().stopMusic():e.mode==="sound"&&e.audio?p8(e.audio):Qn(t,"stop option needs to either be in music mode, or if stopping a sound needs to have the sound name supplied as second argument.")}),VJ=new gt("set",[{name:"key",type:"string"},{name:"value",type:"any"}],async t=>{const e=Xs();b8(e,t.options.key,t.options.value)}),HJ=new gt("add",[{name:"key",type:"string"},{name:"value",type:"any"}],async t=>{const e=Xs();w8(e,t.options.key,t.options.value)}),WJ=new gt("set_screen",[{name:"screen",type:"string"}],async t=>{Bi().setScreen(t.options.screen)}),UJ=new gt("set_button",[{name:"buttonId",type:"string"},{name:"enabled",type:"boolean"}],async t=>{const{buttonId:e,enabled:n}=t.options;Bi().changeButton(e,n)}),JJ=gt.FromOptions({keyword:"talk",argTypes:[{name:"speaker",type:"string"},{name:"pose",type:"string"},{name:"text",type:"string"}],runner:async(t,e)=>{await T8({speaker:t.options.speaker,pose:t.options.pose,text:`"${t.options.text}"`,choices:e,interactive:!0})},returnAfterPlayerAnswer:!0}),GJ=()=>{const t=jc("text",[]);return(e,n)=>{const r=t(e,n);return n.command.staticOptions={text:n.code},r}},KJ=gt.FromOptions({keyword:"text",argTypes:[],runner:async(t,e)=>{await T8({speaker:"game",text:t.staticOptions.text,choices:e,interactive:!0})},parser:GJ(),returnAfterPlayerAnswer:!0}),QJ=new gt("add_item",[{name:"id",type:"string"},{name:"amount",type:"number"}],async t=>{const{id:e,amount:n}=t.options;_r().add({id:e,amount:n})}),YJ=new gt("remove_item",[{name:"id",type:"string"},{name:"amount",type:"number"}],async t=>{const{id:e,amount:n}=t.options;_r().remove({id:e,amount:n})}),XJ=new gt("has_item?",[{name:"id",type:"string"},{name:"amount",type:"number",optional:!0}],async t=>{const{id:e,amount:n}=t.options;return _r().hasItem(e,n)}),ZJ=new gt("item_amount?",[{name:"id",type:"string"}],async t=>{const{id:e}=t.options;return _r().getItemAmount(e)}),eG=new gt("enable_interaction",[{name:"tag",type:"string"}],async t=>{const e=t.options.tag;_r().enableInteraction(e)}),tG=new gt("disable_interaction",[{name:"tag",type:"string"}],async t=>{const e=t.options.tag;_r().disableInteraction(e)}),nG=new gt("start_quest",[{name:"questId",type:"string"}],async t=>{const e=t.options.questId;Rr().startQuest(e)}),rG=new gt("start_objective",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;Rr().startObjective(e,n)}),oG=new gt("complete_objective",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;Rr().completeObjective(e,n)}),iG=new gt("complete_quest",[{name:"questId",type:"string"},{name:"ending",type:"string",optional:!0}],async t=>{const{questId:e,ending:n}=t.options;Rr().completeQuest(e,n)}),aG=new gt("quest_completed?",[{name:"questId",type:"string"}],async t=>{const{questId:e}=t.options;return Rr().isQuestCompleted(e)}),sG=new gt("objective_completed?",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;return Rr().isObjectiveCompleted(e,n)}),lG=new gt("quest_started?",[{name:"questId",type:"string"}],async t=>{const{questId:e}=t.options;return Rr().isQuestStarted(e)}),cG=new gt("objective_started?",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;return Rr().isObjectiveStarted(e,n)}),uG=new gt("wait",[{name:"duration",type:"number"}],async t=>{await vg(t.options.duration)}),fG=new gt("notify",[{name:"text",type:"string"}],async t=>{const{text:e}=t.options;wi().addNotification(e)}),dG=new gt("clear_dialog",[],async t=>{so().clearDialog()}),hG=new gt("if",[{name:"condition",type:"boolean"}],async t=>{const e=oW(t),n=fn();if(e){const r={branchData:{branch:e},currentIndex:0};return n.addAndRunFrame(r)}},(t,e)=>{let n=t.currentLine;jc("if",[{name:"condition",type:"string"}])(t,e);const{lines:o,currentLine:i,line:a}=t,s=e.command;let l;const c=iW(o,i+1);return c&&c.code==="else:"&&(l=t.processCommandsFunction(t.parserContext,c.branch,a),n++),s.staticOptions={success:t.processCommandsFunction(t.parserContext,a.branch,a),failure:l},n++,{newLine:n}}),pG=new gt("==","any",async t=>{t.args.length<2&&Qn(t,"requires at least two arguments");let e=t.args[0],n=!0;for(const r of t.args)if(r!=e){n=!1;break}else e=r;return n}),vG=new gt(">",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e>n}),mG=new gt("<",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e<n}),gG=new gt(">=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e>=n}),yG=new gt("<=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e<=n}),bG=new gt("!=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e!=n}),wG=new gt("!",[{name:"a",type:"any"}],async t=>{const{a:e}=t.options;return!e}),kG=new gt("&&","any",async t=>{const e=t.args;return t.args.length<2&&Qn(t,"requires at least two arguments"),e.reduce((n,r)=>n&&r,!0)}),xG=new gt("||","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>e||n,!1))),jG=new gt("?",[{name:"a",type:"any"},{name:"b",type:"any"},{name:"c",type:"any"}],async t=>{const{a:e,b:n,c:r}=t.options;return e?n:r}),_G=new gt("+","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e+n:(Qn(t,"requires all arguments to be numbers"),e),0))),SG=new gt("-","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e-n:(Qn(t,"requires all arguments to be numbers"),e),0))),CG=new gt("*","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e*n:(Qn(t,"requires all arguments to be numbers"),e),0))),$G=new gt("/","any",async t=>(t.args.length<2&&Qn(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e/n:(Qn(t,"requires all arguments to be numbers"),e),0))),OG=async t=>{const{prompt:e,choices:n}=t.staticOptions,r=[];for(const[a,s]of n.entries()){const l=await jg(s.prompt);r.push(l)}t.options.choiceResults=r;const o=r.map((a,s)=>{var f,u;let l=!0;return a.skillCheck&&(l=(u=(f=a.skillCheck)==null?void 0:f.allowed)!=null?u:!1),{choice:a.text,originalIndex:s,allowed:l}}).filter(a=>a.choice),i=await I8(e,o);await MG(t,i)};function AG(t,e,n){e.expression,e.branch||t.parserContext.error(e.line,`Choice option doesn't have any branch to go to (${e.code} - ${e.line})`);let r,o;const i=e.branch;return e.expression[1]==="roll"?((!i[0].branch||!i[1].branch)&&t.parserContext.error(e.line,`Choice option with a skill roll needs success and failure branches (${e.code} - ${e.line})`),r={success:t.processCommandsFunction(t.parserContext,i[0].branch,e),failure:t.processCommandsFunction(t.parserContext,i[1].branch,e)}):o=t.processCommandsFunction(t.parserContext,i,e),{prompt:t.processCommandsFunction(t.parserContext,[e],e)[0],branch:o,skillBranches:r}}const EG=(t,e)=>{let n=t.currentLine;jc("choice",[]);const{line:r}=t,o=e.command;(!r.branch||r.branch.length<2)&&t.parserContext.error(r.line,"Choice menu needs to have at least one option");const i=r.branch[0];i||t.parserContext.error(t.line.line,"Choice prompt is missing ");const s=r.branch.slice(1).map((l,c)=>(l.branch||t.parserContext.error(l.line,`Choice option doesn't have any branch to go to (${l.code})`),l=TG(t.parserContext,l),AG(t,l)));return o.staticOptions={prompt:t.processCommandsFunction(t.parserContext,[i],r)[0],choices:s},n++,{newLine:n}},PG=gt.FromOptions({keyword:"choice",argTypes:[],runner:OG,parser:EG}),MG=async(t,e)=>{const n=e,r=fn(),{choices:o}=t.staticOptions,i=o[n],a=t.options.choiceResults[n];let s=a.text,l;if(a.skillCheck?(s=null,E8({skill:a.skillCheck.skillId,value:a.skillCheck.difficulty,id:a.skillCheck.skillCheckId,hideAfterRoll:a.skillCheck.hideAfterRoll}).succeeded?l=i.skillBranches.success:l=i.skillBranches.failure):l=i.branch,s){const c={speaker:"player",text:s,interactive:!1};so().addDialog(c)}if(l){const c={currentIndex:0,branchData:{branch:l}};await r.addAndRunFrame(c)}};function TG(t,e){return{code:`choicePrompt ${e.code}`,indentation:e.indentation,line:e.line,branch:e.branch,expression:["choicePrompt",...e.expression]}}const IG=new gt("choicePrompt","any",async t=>{const e=t.args;if(e[0]==="roll"){const n=e[1],r=e[2],o=e[3],i=e[4],a=e.length>5?e[5]:!1,s=Sr().getSkillCheck(n);if(s.hidden)return{text:null};const l=s.happened&&!s.succeeded,{difficultyText:c}=eW({skill:r,skillCheckId:n,value:o});return{text:`${c} ${i}`,skillCheck:{allowed:!l,skillId:r,skillCheckId:n,difficulty:o,hideAfterRoll:a}}}else if(e.length>1&&e[1]==="if"){const n=e[0];let r=!0;return e.length>2&&(r=e[2]),r?{text:n}:{text:null}}else return{text:e[0]}}),W8=gt.FromOptions({keyword:"text_field",argTypes:[{name:"prompt",type:"string"}],returnAfterPlayerAnswer:!0,runner:async t=>{const e={speaker:"game",text:t.options.prompt,textField:!0,interactive:!0};so().addDialog(e)}});W8.onPlayerAnswered=async(t,e)=>(typeof e!="string"&&Qn(t,"The player's answer should be a string"),e);const NG=gt.FromOptions({keyword:"text_field_prompt",argTypes:[{name:"prompt",type:"string"}],runner:async t=>{const e={speaker:"game",text:t.options.prompt,textField:!0,interactive:!0};so().addDialog(e)}});function LG(t){t.addCommand(PG),t.addCommand(IG),t.addCommand(hG),t.addCommand(TJ),t.addCommand(IJ),t.addCommand(NJ),t.addCommand(dG),t.addCommand(fG),t.addCommand(FJ),t.addCommand(BJ),t.addCommand(qJ),t.addCommand(UJ),t.addCommand(WJ),t.addCommand(uG),t.addCommand(pG),t.addCommand(vG),t.addCommand(mG),t.addCommand(gG),t.addCommand(yG),t.addCommand(bG),t.addCommand(wG),t.addCommand(kG),t.addCommand(xG),t.addCommand(jG),t.addCommand(_G),t.addCommand(SG),t.addCommand(CG),t.addCommand($G),t.addCommand(HJ),t.addCommand(VJ),t.addCommand(KJ),t.addCommand(JJ),t.addCommand(LJ),t.addCommand(RJ),t.addCommand(DJ),t.addCommand(zJ),t.addCommand(nG),t.addCommand(rG),t.addCommand(oG),t.addCommand(iG),t.addCommand(lG),t.addCommand(cG),t.addCommand(aG),t.addCommand(sG),t.addCommand(QJ),t.addCommand(YJ),t.addCommand(eG),t.addCommand(tG),t.addCommand(XJ),t.addCommand(ZJ),t.addCommand(EJ),t.addCommand(PJ),t.addCommand(MJ),t.addCommand(W8),t.addCommand(NG)}let _c;or.callHook("onPageLoaded");async function RG(t,e){const n=await bg("data/config.json");gH(JSON.parse(n)),_c=P.createApp($J,{config:t,options:e});const r=bH();if(_c.use(r),Sn().setOptions(e),_c.use(X8,{breakpoints:{s:0,m:800,l:1200}}),LG(or),Bg.setupDebugger(e.debug),console.log("%c Narrat game engine \u2013 [VI]{version} - {date}[/VI]","background: #222; color: #bada55"),or.callHook("onNarratSetup"),_c.mount("#game-holder"),e.debug){const o={app:_c,vm:or,jump:i=>{fn().runLabel(i)}};window.narrat=o}OJ()}class DG{onPageLoaded(){}onNarratSetup(){}onAppMounted(){}onAssetsLoaded(){}onGameSetup(){}onGameStart(){}onGameMounted(){}onGameDismounted(){}}function zG(t){or.addPlugin(t)}function BG(t){or.addCommand(t)}sn.CommandPlugin=gt,sn.NarratPlugin=DG,sn.addCommand=BG,sn.aspectRatioFit=R8,sn.generateParser=jc,sn.getConfig=Bt,sn.registerPlugin=zG,sn.startApp=RG,Object.defineProperties(sn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
195
195
|
//# sourceMappingURL=narrat.umd.js.map
|