@drincs/pixi-vn-ink 1.1.0 → 1.1.2

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.
@@ -43,7 +43,7 @@ Error:${h}`);}return l!=null&&(u=new r(l,s,this._externalErrorHandler,this._root
43
43
  \r`),this.ParseNewline(),ct.ParseSuccess),this.Line=s=>()=>{let o=this.ParseObject(s);return o===null?null:(this.Expect(this.EndOfLine,"end of line",this.SkipToNextLine),o)},this.StartTag=()=>{if(this.Whitespace(),this.ParseString("#")===null)return null;this.parsingStringExpression&&this.Error("Tags aren't allowed inside of strings. Please use \\# if you want a hash symbol.");let s=null;if(this.tagActive){let o=new Pe.ContentList;o.AddContent(new yn.Tag(false)),o.AddContent(new yn.Tag(true)),s=o;}else s=new yn.Tag(true);return this.tagActive=true,this.Whitespace(),s},this._inlineWhitespaceChars=new ce.CharacterSet(" "),this.EndOfLine=()=>this.OneOf([this.Newline,this.EndOfFile]),this.Newline=()=>(this.Whitespace(),this.ParseNewline()!==null?ct.ParseSuccess:null),this.EndOfFile=()=>(this.Whitespace(),this.endOfInput?ct.ParseSuccess:null),this.MultilineWhitespace=()=>{let s=this.OneOrMore(this.Newline);return s===null?null:s.length>=1?ct.ParseSuccess:null},this.Whitespace=()=>this.ParseCharactersFromCharSet(this._inlineWhitespaceChars)!==null?ct.ParseSuccess:null,this.Spaced=s=>()=>{this.Whitespace();let o=this.ParseObject(s);return o===null?null:(this.Whitespace(),o)},this.AnyWhitespace=()=>{let s=false;for(;this.OneOf([this.Whitespace,this.MultilineWhitespace])!==null;)s=true;return s?ct.ParseSuccess:null},this.MultiSpaced=s=>()=>{this.AnyWhitespace();let o=this.ParseObject(s);return o===null?null:(this.AnyWhitespace(),o)},this._filename=null,this._externalErrorHandler=null,this._fileHandler=null,this._filename=t,this.RegisterExpressionOperators(),this.GenerateStatementLevelRules(),this.errorHandler=this.OnStringParserError,this._externalErrorHandler=n,a===null?this._fileHandler=new pC.DefaultFileHandler:this._fileHandler=a,i===null){if(this._rootParser=this,this._openFilenames=[],this._filename!==null){let s=this.fileHandler.ResolveInkFilename(this._filename);this._openFilenames.push(s);}}else this._rootParser=i;}PreProcessInputString(e){return new Xg.CommentEliminator(e).Process()}get parsingStringExpression(){return this.GetFlag(Number(Bs.CustomFlags.ParsingString))}set parsingStringExpression(e){this.SetFlag(Number(Bs.CustomFlags.ParsingString),e);}get tagActive(){return this.GetFlag(Number(Bs.CustomFlags.TagActive))}set tagActive(e){this.SetFlag(Number(Bs.CustomFlags.TagActive),e);}get identifierCharSet(){return this._identifierCharSet===null&&((this._identifierCharSet=new ce.CharacterSet).AddRange("A","Z").AddRange("a","z").AddRange("0","9").Add("_"),this.ExtendIdentifierCharacterRanges(this._identifierCharSet)),this._identifierCharSet}EndTagIfNecessary(e){this.tagActive&&(e!=null&&(e instanceof Pe.ContentList?e.AddContent(new yn.Tag(false)):e.push(new yn.Tag(false))),this.tagActive=false);}};qs.InkParser=U;U.LatinBasic=He.CharacterRange.Define("A","z",new ce.CharacterSet().AddRange("[","`"));U.LatinExtendedA=He.CharacterRange.Define("\u0100","\u017F");U.LatinExtendedB=He.CharacterRange.Define("\u0180","\u024F");U.Greek=He.CharacterRange.Define("\u0370","\u03FF",new ce.CharacterSet().AddRange("\u0378","\u0385").AddCharacters("\u0374\u0375\u0378\u0387\u038B\u038D\u03A2"));U.Cyrillic=He.CharacterRange.Define("\u0400","\u04FF",new ce.CharacterSet().AddRange("\u0482","\u0489"));U.Armenian=He.CharacterRange.Define("\u0530","\u058F",new ce.CharacterSet().AddCharacters("\u0530").AddRange("\u0557","\u0560").AddRange("\u0588","\u058E"));U.Hebrew=He.CharacterRange.Define("\u0590","\u05FF",new ce.CharacterSet);U.Arabic=He.CharacterRange.Define("\u0600","\u06FF",new ce.CharacterSet);U.Korean=He.CharacterRange.Define("\uAC00","\uD7AF",new ce.CharacterSet);U.Latin1Supplement=He.CharacterRange.Define("\x80","\xFF",new ce.CharacterSet);U.Chinese=He.CharacterRange.Define("\u4E00","\u9FFF",new ce.CharacterSet);U.ListAllCharacterRanges=()=>[U.LatinBasic,U.LatinExtendedA,U.LatinExtendedB,U.Arabic,U.Armenian,U.Cyrillic,U.Greek,U.Hebrew,U.Korean,U.Latin1Supplement,U.Chinese];});var mc=w(Ms=>{Object.defineProperty(Ms,"__esModule",{value:true});Ms.GenerateStoryStats=void 0;var fC=sn(),mC=un(),gC=qn(),CC=Go(),yC=Ko(),vC=St();function SC(r){let e=r.FindAll(vC.Text)(),t=0;for(let u of e){let l=0,h=true;for(let c of u.text)c==" "||c==" "||c==`
44
44
  `||c=="\r"?h=true:h&&(l++,h=false);t+=l;}let n=r.FindAll(CC.Knot)(),i=r.FindAll(yC.Stitch)(),a=r.FindAll(fC.Choice)(),s=r.FindAll(gC.Gather)(u=>u.debugMetadata!=null),o=r.FindAll(mC.Divert)();return {words:t,knots:n.length,functions:n.filter(u=>u.isFunction).length,stitches:i.length,gathers:s.length,diverts:o.length-1,choices:a.length}}Ms.GenerateStoryStats=SC;});var gc=w(Gs=>{Object.defineProperty(Gs,"__esModule",{value:true});Gs.JsonFileHandler=void 0;var _l=class{constructor(e){this.fileHierarchy=e,this.ResolveInkFilename=t=>{if(Object.keys(this.fileHierarchy).includes(t))return t;throw new Error(`Cannot locate ${t}. Are you trying a relative import ? This is not yet implemented.`)},this.LoadInkFileContents=t=>{if(Object.keys(this.fileHierarchy).includes(t))return this.fileHierarchy[t];throw new Error(`Cannot open ${t}.`)};}};Gs.JsonFileHandler=_l;});var yc=w(Ce=>{Object.defineProperty(Ce,"__esModule",{value:true});Ce.Compiler=Ce.Story=Ce.InkList=Ce.JsonFileHandler=Ce.StatementLevel=Ce.InkParser=Ce.CompilerOptions=void 0;var EC=ha(),DC=xu(),Ol=Ut(),bC=xl(),AC=ee(),wC=H(),xC=mc(),_C=ha();Object.defineProperty(Ce,"CompilerOptions",{enumerable:true,get:function(){return _C.CompilerOptions}});var OC=xl();Object.defineProperty(Ce,"InkParser",{enumerable:true,get:function(){return OC.InkParser}});var TC=zo();Object.defineProperty(Ce,"StatementLevel",{enumerable:true,get:function(){return TC.StatementLevel}});var PC=gc();Object.defineProperty(Ce,"JsonFileHandler",{enumerable:true,get:function(){return PC.JsonFileHandler}});var Cc=Yn();Object.defineProperty(Ce,"InkList",{enumerable:true,get:function(){return Cc.InkList}});Object.defineProperty(Ce,"Story",{enumerable:true,get:function(){return Cc.Story}});var Tl=class{get errors(){return this._errors}get warnings(){return this._warnings}get authorMessages(){return this._authorMessages}get inputString(){return this._inputString}get options(){return this._options}get parsedStory(){if(!this._parsedStory)throw new Error;return this._parsedStory}get runtimeStory(){if(!this._runtimeStory)throw new Error("Compilation failed.");return this._runtimeStory}get parser(){if(!this._parser)throw new Error;return this._parser}get debugSourceRanges(){return this._debugSourceRanges}constructor(e,t=null){this._errors=[],this._warnings=[],this._authorMessages=[],this._parsedStory=null,this._runtimeStory=null,this._parser=null,this._debugSourceRanges=[],this.Compile=()=>(this._parser=new bC.InkParser(this.inputString,this.options.sourceFilename||null,this.OnError,null,this.options.fileHandler),this._parsedStory=this.parser.ParseStory(),this.errors.length===0?(this.parsedStory.countAllVisits=this.options.countAllVisits,this._runtimeStory=this.parsedStory.ExportRuntime(this.OnError)):this._runtimeStory=null,this.runtimeStory),this.RetrieveDebugSourceForLatestContent=()=>{var n;for(let i of this.runtimeStory.state.outputStream){let a=(0, wC.asOrNull)(i,AC.StringValue);if(a!==null){let s=new DC.DebugSourceRange(((n=a.value)===null||n===void 0?void 0:n.length)||0,a.debugMetadata,a.value||"unknown");this.debugSourceRanges.push(s);}}},this.GenerateStats=()=>this._parsedStory===null?null:(0, xC.GenerateStoryStats)(this._parsedStory),this.DebugMetadataForContentAtOffset=n=>{let i=0,a=null;for(let s of this.debugSourceRanges){if(s.debugMetadata!==null&&(a=s.debugMetadata),n>=i&&n<i+s.length)return a;i+=s.length;}return null},this.OnError=(n,i)=>{switch(i){case Ol.ErrorType.Author:this._authorMessages.push(n);break;case Ol.ErrorType.Warning:this._warnings.push(n);break;case Ol.ErrorType.Error:this._errors.push(n);break}this.options.errorHandler!==null&&this.options.errorHandler(n,i);},this._inputString=e,this._options=t||new EC.CompilerOptions;}};Ce.Compiler=Tl;});var be;(r=>(r.log=(e,...t)=>console.log(`[Pixi\u2019VN Json] ${e}`,...t),r.warn=(e,...t)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...t),r.error=(e,...t)=>console.error(`[Pixi\u2019VN Json] ${e}`,...t),r.info=(e,...t)=>console.info(`[Pixi\u2019VN Json] ${e}`,...t)))(be||={});var _=class M{static init(e){e.loadAssets&&(M._loadAssets=e.loadAssets),e.soundOperation&&(M._soundOperation=e.soundOperation),e.imageOperation&&(M._imageOperation=e.imageOperation),e.videoOperation&&(M._videoOperation=e.videoOperation),e.imageContainerOperation&&(M._imageContainerOperation=e.imageContainerOperation),e.textOperation&&(M._textOperation=e.textOperation),e.canvasElementOperation&&(M._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&(M._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&(M._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&(M._narrationOperation=e.narrationOperation),e.effectOperation&&(M._effectOperation=e.effectOperation),e.animateOperation&&(M._animateOperation=e.animateOperation),e.getLogichValue&&(M._getLogichValue=e.getLogichValue),e.getConditionalStep&&(M._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return M._loadAssets}static _soundOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return M._soundOperation}static _imageOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return M._imageOperation}static _videoOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return M._videoOperation}static _imageContainerOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return M._imageContainerOperation}static _textOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return M._textOperation}static _canvasElementOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return M._canvasElementOperation}static _setStorageValue=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return M._setStorageValue}static _setInitialStorageValue=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return M._setInitialStorageValue}static _narrationOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return M._narrationOperation}static _effectOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return M._effectOperation}static _animateOperation=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return M._animateOperation}static _getLogichValue=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return M._getLogichValue}static _getConditionalStep=()=>{throw be.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return M._getConditionalStep}};var $t;(r=>{r.options={replaceRegex:/\[([^\]]+)\]/};let e=[];function t(l,h){e.unshift({fn:l,opts:h});}r.add=t;function n(l){let h=e.findIndex(c=>c.fn===l);h!==-1&&e.splice(h,1);}r.remove=n;function i(){return e.map(l=>l.opts)}r.info=i;function a(l,h){let c=e.filter(d=>(d.opts.type??"after-translation")===h.type);for(let d of c)l=u(l,d.fn,d.opts.validation);return l}r.replace=a;function s(l){let h=e.filter(c=>c.opts.i18nInterpolation);for(let c of h)l=o(l,c.fn,c.opts);return l}r.runI18nPreStep=s;function o(l,h,c){let{validation:d}=c,f=new RegExp(r.options.replaceRegex.source,"g"),m=[...l.matchAll(f)],g=new Set,b=[];for(let S of m)g.has(S[1])||(g.add(S[1]),b.push(S[1]));for(let S of b){if(d==="characterId"){if(!RegisteredCharacters.has(S))continue}else if(d!=="all"){if(d instanceof RegExp){if(!d.test(S))continue}else if(d instanceof ZodType&&!d.safeParse(S).success)continue}h(S)!==void 0&&(l.includes(`{{[${S}]}}`)||(l=l.replaceAll(`[${S}]`,`{{[${S}]}}`)));}return l}function u(l,h,c){let d=new RegExp(r.options.replaceRegex.source,"g"),f=[...l.matchAll(d)],m=new Set,g=[];for(let b of f)m.has(b[1])||(m.add(b[1]),g.push(b[1]));for(let b of g){if(c==="characterId"){if(!RegisteredCharacters.has(b))continue}else if(c!=="all"){if(c instanceof RegExp){if(!c.test(b))continue}else if(c instanceof ZodType&&!c.safeParse(b).success)continue}let S=h(b);S!==void 0&&(l=l.replaceAll(`[${b}]`,S));}return l}})($t||={});function Tc(r,e={}){let t="";return r.values.forEach(n=>{if(typeof n=="string")t+=n;else {let i=_.getLogichValue(n,e);t+=`${i}`;}}),t}var Ll;(r=>{let e=u=>u;function t(u){return Array.isArray(u)?u.map(l=>n(`${l}`)):n(`${u}`)}r.t=t;function n(u){let l=u;return r.beforeToTranslate&&(l=(0, r.beforeToTranslate)(l)),l=$t.replace(l,{type:"before-translation"}),l=e(l),r.afterToTranslate&&(l=(0, r.afterToTranslate)(l)),l=$t.replace(l,{type:"after-translation"}),l}r.translate=n;function i(u){e=u;}r.setTranslate=i;function a(u,l,h){let{defaultValue:c="empty_string"}=h;typeof l=="string"&&(l=[l]),Array.isArray(l)&&l.forEach(d=>{let f=d;if(r.beforeToTranslate&&(f=(0, r.beforeToTranslate)(f)),c==="empty_string")u[f]===void 0&&(u[f]="");else if(c==="copy_key"){let m=d;r.beforeToTranslate&&(m=(0, r.beforeToTranslate)(m));let g=$t.runI18nPreStep(m);g=$t.replace(g,{type:"before-translation"}),u[f]=g;}});}function s(u,l=[]){if(typeof u=="object"&&u&&"type"in u)if(u.type==="ifelse")u.then&&s(u.then,l),u.else&&s(u.else,l);else if(u.type==="stepswitch"){if(u.elements)if(Array.isArray(u.elements))u.elements.forEach(h=>{s(h,l);});else if(u.elements.type==="ifelse"){let h=[];s(u.elements,h),h.forEach(c=>{l.push(...c);});}else if(u.elements.type==="stepswitch"){let h=[];s(u.elements,h),h.forEach(c=>{l.push(...c);});}else s(u.elements,l);}else u.type==="resulttocombine"?(u.firstItem&&s(u.firstItem,l),u.secondConditionalItem&&u.secondConditionalItem.forEach(h=>{s(h,l);})):l.push(u);else u&&l.push(u);return l}async function o(u,l={},h={}){let{defaultValue:c="copy_key",operationStringConvert:d}=h,f=u.map(async m=>{if(m.choices){let g=[];Array.isArray(m.choices)?g=[m.choices]:g=s(m.choices),g.forEach(b=>{b.forEach(S=>{if("type"in S){let y=[];S.type==="ifelse"||S.type==="stepswitch"?s(S,y):y=[S],y.map(p=>s(p.text)).forEach(p=>{Array.isArray(p)&&p.forEach(D=>{Array.isArray(D)?D.forEach(C=>{typeof C=="string"?a(l,C,{defaultValue:c}):s(C).forEach(E=>{Array.isArray(E)?E.forEach(x=>{typeof x=="string"&&a(l,x,{defaultValue:c});}):typeof E=="string"&&a(l,E,{defaultValue:c});});}):typeof D=="string"&&a(l,D,{defaultValue:c});});});}});});}if(m.dialogue){let g=[];Array.isArray(m.dialogue)?g=[m.dialogue]:g=s(m.dialogue),g.forEach(b=>{if(typeof b=="string")a(l,b,{defaultValue:c});else if("text"in b){let S=s(b.text);typeof S=="string"&&(S=[S]),S.forEach(y=>{typeof y=="string"?a(l,y,{defaultValue:c}):s(y).forEach(p=>{typeof p=="string"?a(l,p,{defaultValue:c}):Array.isArray(p)&&p.forEach(D=>{typeof D=="string"?a(l,D,{defaultValue:c}):s(D).forEach(C=>{typeof C=="string"&&a(l,C,{defaultValue:c});});});});});}});}if(m.operations)for(let g of m.operations){if(g.type==="operationtoconvert"&&d){let b=Tc(g),S=await d(b,m,{});if(!S)return;g=S;}g.type==="text"&&g.operationType==="show"&&a(l,g.text,{defaultValue:c});}m.conditionalStep&&s(m.conditionalStep).forEach(g=>{Array.isArray(g)?o(g,l,h):o([g],l,h);});});return await Promise.all(f),l}r.generateJsonTranslation=o;})(Ll||={});var Ve=Ll;async function Bl(r){let e=_.getLogichValue(r,{});if(e)switch(e.type){case "assets":switch(e.operationType){case "load":await Assets.load(e.aliases);break;case "lazyload":Assets.backgroundLoad(e.aliases);break}break;case "bundle":switch(e.operationType){case "load":await Assets.loadBundle(e.aliases);break;case "lazyload":Assets.backgroundLoadBundle(e.aliases);break}break}}var q;(r=>(r.log=(e,...t)=>console.log(`[Pixi\u2019VN Json] ${e}`,...t),r.warn=(e,...t)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...t),r.error=(e,...t)=>console.error(`[Pixi\u2019VN Json] ${e}`,...t),r.info=(e,...t)=>console.info(`[Pixi\u2019VN Json] ${e}`,...t)))(q||={});async function pi(r,e,t){switch(t.type){case "fade":await showWithFade(e.alias,r,t.props,t.priority);break;case "dissolve":await showWithDissolve(e.alias,r,t.props,t.priority);break;case "movein":case "moveout":await moveIn(e.alias,r,t.props,t.priority);break;case "zoomin":case "zoomout":await zoomIn(e.alias,r,t.props,t.priority);break;case "pushin":case "pushout":await pushIn(e.alias,r,t.props,t.priority);break}}function Sn(r){if(r.transition)switch(r.transition.type){case "fade":removeWithFade(r.alias,r.transition.props,r.transition.priority);break;case "dissolve":removeWithDissolve(r.alias,r.transition.props,r.transition.priority);break;case "movein":case "moveout":moveOut(r.alias,r.transition.props,r.transition.priority);break;case "zoomin":case "zoomout":zoomOut(r.alias,r.transition.props,r.transition.priority);break;case "pushin":case "pushout":pushOut(r.alias,r.transition.props,r.transition.priority);break}else canvas.remove(r.alias);}async function Wl(r){switch(r.operationType){case "show":if(r.transition){let e=new ImageSprite(r.props,r.url||r.alias);await pi(e,r,r.transition);}else await showImage(r.alias,r.url,r.props);break;case "edit":{let e=canvas.find(r.alias);e?r.props&&await e.setMemory({...e.memory,...r.props}):q.error(`Image with alias ${r.alias} not found.`);break}case "remove":Sn(r);break}}async function jl(r){switch(r.operationType){case "show":if(r.transition){let e=new VideoSprite(r.props,r.url||r.alias);await pi(e,r,r.transition);}else await showVideo(r.alias,r.url,r.props);break;case "edit":{let e=canvas.find(r.alias);e?r.props&&await e.setMemory({...e.memory,...r.props}):q.error(`Video with alias ${r.alias} not found.`);break}case "remove":Sn(r);break;case "pause":case "resume":{let e=canvas.find(r.alias);e?e.paused=r.operationType==="pause":q.error(`Video with alias ${r.alias} not found.`);break}}}async function ql(r){switch(r.operationType){case "show":if(r.transition){let e=new ImageContainer(r.props,r.urls);await pi(e,r,r.transition);}else await showImageContainer(r.alias,r.urls,r.props);break;case "edit":{let e=canvas.find(r.alias);e?r.props&&await e.setMemory({...e.memory,...r.props}):q.error(`ImageContainer with alias ${r.alias} not found.`);break}case "remove":Sn(r);break}}async function Ml(r){switch(r.operationType){case "show":if(r.props=r.props||{},r.props.text=Ve.t(r.text),r.transition){let e=new Text(r.props);await pi(e,r,r.transition);}else showText(r.alias,r.text,r.props);break;case "edit":{let e=canvas.find(r.alias);e?r.props&&await e.setMemory({...e.memory,...r.props}):q.error(`Text with alias ${r.alias} not found.`);break}case "remove":Sn(r);break}}async function Gl(r){switch(r.operationType){case "edit":try{let e=canvas.find(r.alias);e?r.props&&e.setMemory({...e.memory,...r.props}):q.error(`Canvas Element with alias ${r.alias} not found.`);}catch(e){q.error(`There was an error while trying to edit the canvas element with alias ${r.alias}.`,e);}break;case "remove":Sn(r);break}}async function $l(r){r.type==="shake"&&await shakeEffect(r.alias,r.props,r.priority);}function Jl(r){switch(r.type){case "animate":canvas.animate(r.alias,r.keyframes,r.options,r.priority);break;case "animate-sequence":canvas.animate(r.alias,r.sequence,r.options,r.priority);break}}function Hl(r){switch(r.type){case "input":narration.requestInput({type:r.valueType},r.defaultValue);break;case "dialogue":narration.dialogue=void 0;break}}function zl(r){switch(r.operationType){case "play":r.url?sound.play(r.alias,r.url,r.props):sound.play(r.alias,r.props);break;case "stop":switch(r.type){case "sound":sound.stop(r.alias);break;case "all":sound.stopAll();break}break;case "pause":switch(r.type){case "sound":sound.pause(r.alias);break;case "channel":sound.findChannel(r.alias).pauseAll();break;case "all":sound.pauseAll();break}break;case "resume":switch(r.type){case "sound":sound.resume(r.alias);break;case "channel":sound.findChannel(r.alias).resumeAll();break;case "all":sound.resumeAll();break}break;case "edit":Object.entries(r.props).forEach(([e,t])=>{let n=sound.find(r.alias);n&&(e==="volume"?n.volume.value=t:n.paused=t);});break}}var Hs="___param___",Xc=class G{static init(e){e.loadAssets&&(G._loadAssets=e.loadAssets),e.soundOperation&&(G._soundOperation=e.soundOperation),e.imageOperation&&(G._imageOperation=e.imageOperation),e.videoOperation&&(G._videoOperation=e.videoOperation),e.imageContainerOperation&&(G._imageContainerOperation=e.imageContainerOperation),e.textOperation&&(G._textOperation=e.textOperation),e.canvasElementOperation&&(G._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&(G._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&(G._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&(G._narrationOperation=e.narrationOperation),e.effectOperation&&(G._effectOperation=e.effectOperation),e.animateOperation&&(G._animateOperation=e.animateOperation),e.getLogichValue&&(G._getLogichValue=e.getLogichValue),e.getConditionalStep&&(G._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return G._loadAssets}static _soundOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return G._soundOperation}static _imageOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return G._imageOperation}static _videoOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return G._videoOperation}static _imageContainerOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return G._imageContainerOperation}static _textOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return G._textOperation}static _canvasElementOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return G._canvasElementOperation}static _setStorageValue=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return G._setStorageValue}static _setInitialStorageValue=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return G._setInitialStorageValue}static _narrationOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return G._narrationOperation}static _effectOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return G._effectOperation}static _animateOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return G._animateOperation}static _getLogichValue=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return G._getLogichValue}static _getConditionalStep=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return G._getConditionalStep}};function Yc(r,e){if(e&&typeof e=="object"&&typeof r.functionName=="string"&&r.functionName in e){let t=e[r.functionName];if(typeof t=="function"){let n=r.args.map(i=>Xc.getLogichValue(i,e));return t(...n)}else q.warn(`getLogichValue function ${r.functionName} not found in props`);}}function Ul(r,e){let t=_.getLogichValue(r,e);return t&&typeof t=="object"&&"type"in t?_.getLogichValue(t,e):t}function Kl(r,e={}){let t=Ul(r.value,e);switch(r.storageType){case "flagStorage":storage.setFlag(r.key,r.value);break;case "storage":storage.set(r.key,t);break;case "tempstorage":storage.setTempVariable(r.key,t);break;case "params":{let n=storage.get(`${Hs}${narration.openedLabels.length-1}`)||[];n.length>r.key&&(n[r.key]=t),storage.setTempVariable(`${Hs}${narration.openedLabels.length-1}`,n);break}}}function Xl(r,e={}){let t=Ul(r.value,e);switch(r.storageType){case "storage":case "tempstorage":storage.default={[r.key]:t};break}}function Yl(r,e={}){let t=Ql(r,e);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case "value":return Zc(t,e);case "arithmetic":case "arithmeticsingle":return Qc(t,e);case "compare":case "union":return ed(t,e);case "function":return Yc(t,e)}return t}function Qc(r,e){let t=_.getLogichValue(r.leftValue,e);switch(r.type){case "arithmetic":{let n=_.getLogichValue(r.rightValue,e);switch(r.operator){case "*":return t*n;case "/":return t/n;case "+":return typeof t=="string"||typeof n=="string"?`${t}${n}`:Array.isArray(t)&&Array.isArray(n)?[...t,...n]:Array.isArray(t)?[...t,n]:Array.isArray(n)?[t,...n]:t+n;case "-":if(Array.isArray(t)&&Array.isArray(n))return t.filter(i=>!n.includes(i));if(Array.isArray(t))return t.filter(i=>i!==n);if(Array.isArray(n)){q.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return t-n;case "%":return t%n;case "POW":return t**n;case "RANDOM":return narration.getRandomNumber(t,n);case "INTERSECTION":if(Array.isArray(t)&&Array.isArray(n))return t.filter(i=>n.includes(i));q.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:q.warn("getValueFromArithmeticOperations unknown operator",r);return}}case "arithmeticsingle":switch(r.operator){case "INT":return Number(t);case "FLOOR":return Math.floor(t)}break}}function Zc(r,e){if(r&&typeof r=="object"&&"type"in r&&r.type==="value"&&r.storageOperationType==="get")switch(r.storageType){case "storage":case "tempstorage":return r.key==="_input_value_"?narration.inputValue:storage.get(r.key);case "flagStorage":return storage.getFlag(r.key);case "label":return narration.getTimesLabelOpened(r.label);case "choice":return narration.getTimesChoiceMade(r.index);case "logic":return _.getLogichValue(r.operation,e);case "params":{let t=storage.get(`${Hs}${narration.openedLabels.length-1}`)||[];if(t&&t.length>r.key)return t[r.key];q.warn("getValue params not found");return}}return r}function ed(r,e){if(!r)return false;if(typeof r!="object"||!("type"in r))return !!r;switch(r.type){case "compare":{let t=_.getLogichValue(r.leftValue,e),n=_.getLogichValue(r.rightValue,e);switch(r.operator){case "==":return Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every(i=>n.includes(i)):t===n;case "!=":return Array.isArray(t)&&Array.isArray(n)?t.length!==n.length||!t.every(i=>n.includes(i)):t!==n;case "<":return typeof t=="string"&&typeof n=="string"?t.localeCompare(n)<0:Array.isArray(t)&&Array.isArray(n)?t.length<n.length:t<n;case "<=":return typeof t=="string"&&typeof n=="string"?t.localeCompare(n)<=0:Array.isArray(t)&&Array.isArray(n)?t.length<=n.length:t<=n;case ">":return typeof t=="string"&&typeof n=="string"?t.localeCompare(n)>0:Array.isArray(t)&&Array.isArray(n)?t.length>n.length:t>n;case ">=":return typeof t=="string"&&typeof n=="string"?t.localeCompare(n)>=0:Array.isArray(t)&&Array.isArray(n)?t.length>=n.length:t>=n;case "CONTAINS":return Array.isArray(t)&&Array.isArray(n)?n.every(i=>t.includes(i)):Array.isArray(t)?t.includes(n):t.toString().includes(n.toString())}break}case "value":{let t=_.getLogichValue(r,e);return Array.isArray(t)?t.length>0:t&&typeof t=="object"?Object.keys(t).length>0:!!t}case "union":return td(r,e)}return !!r}function td(r,e){if(r.unionType==="not"){let n=Yl(r.condition,e);return Array.isArray(n)?n.length===0:n&&typeof n=="object"?Object.keys(n).length===0:!n}let t=n=>_.getLogichValue(n,e)||false;return r.unionType==="and"?r.conditions.every(t):r.conditions.some(t)}function nd(r,e){return Math.floor(Math.random()*(e-r+1)+r)}function Ql(r,e={}){if(Array.isArray(r)||!r)return r;if(r&&typeof r=="object"&&"type"in r)switch(r.type){case "resulttocombine":return id(r,e);case "ifelse":return _.getLogichValue(r.condition,e)?_.getLogichValue(r.then,e):_.getLogichValue(r.else,e);case "stepswitch":{let t=_.getLogichValue(r.elements,e)||[];if(t.length===0){q.error("getValueFromConditionalStatements elements.length === 0");return}switch(r.choiceType){case "random":{let n=nd(0,t.length-1);return _.getLogichValue(t[n],e)}case "loop":{let n=NarrationManagerStatic.getCurrentStepTimesCounter(r.nestedId)-1;return n>t.length-1?(n=n%t.length,_.getLogichValue(t[n],e)):_.getLogichValue(t[n],e)}case "sequential":{let n,i=NarrationManagerStatic.getCurrentStepTimesCounter(r.nestedId)-1;return r.end==="lastItem"&&(n=_.getLogichValue(t[t.length-1],e)),i>t.length-1?n:_.getLogichValue(t[i],e)}case "sequentialrandom":{let n=NarrationManagerStatic.getRandomNumber(0,t.length-1,{nestedId:r.nestedId,onceOnly:true});if(n===void 0&&r.end==="lastItem"){let i=NarrationManagerStatic.getCurrentStepTimesCounterData(r.nestedId);if(!i?.usedRandomNumbers){q.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let a=i.usedRandomNumbers[`0-${t.length-1}`];return _.getLogichValue(t[a[a.length-1]],e)}if(n===void 0){q.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return _.getLogichValue(t[n],e)}}}}return r}function fi(r,e={}){if(r.conditionalStep){let t=createExportableElement(_.getLogichValue(r.conditionalStep,e));if(t?.glueEnabled===void 0&&delete t?.glueEnabled,t?.goNextStep===void 0&&delete t?.goNextStep,t?.end===void 0&&delete t?.end,t?.choices===void 0&&delete t?.choices,t?.dialogue===void 0&&delete t?.dialogue,t?.labelToOpen===void 0&&delete t?.labelToOpen,t?.operations===void 0&&delete t?.operations,t){let n={...r,conditionalStep:void 0,...t};return fi(n,e)}else narration.dialogGlue&&(narration.dialogGlue=false);}return r}function id(r,e){let t=r.firstItem,n=(r.secondConditionalItem??[]).flatMap(a=>Array.isArray(a)?a.map(s=>_.getLogichValue(s,e)):[_.getLogichValue(a,e)]),i=t?[t,...n]:n;if(i.length===0){q.warn("combinateResult toCheck.length === 0");return}if(typeof i[0]=="string")return Ve.t(i);if(typeof i[0]=="object"){let a=i,s,o=false,u=a.map((y,p)=>{y=fi(y,e);let D=_.getLogichValue(y.dialogue,e)||"";return p===0?(s=_.getLogichValue(y.glueEnabled,e)||false,D):(typeof D=="object"&&"text"in D&&(D=`${D.character}: ${D.text}`),s===false&&o&&(D=`
45
45
 
46
- ${D}`),D&&(o=true),s=_.getLogichValue(y.glueEnabled,e)||false,D)}),l=_.getLogichValue(u[0],e),h=typeof l=="object"&&"character"in l?l.character:void 0,c=u.flatMap(y=>{let p;y&&typeof y=="object"&&"text"in y?p=y.text:p=y;let D;return Array.isArray(p)?D=p.map(C=>{let E=_.getLogichValue(C,e);return Ve.t(`${E}`)}):D=_.getLogichValue(p,e)||"",Ve.t(D)}),d=a.find(y=>y.end),f=a.find(y=>y.choices),m=false,g=false;a.length>0&&(a[0].glueEnabled&&a[0].goNextStep&&a[0].dialogue===void 0&&(narration.dialogGlue=true),m=a[a.length-1].glueEnabled,g=a.reverse().find(y=>!(y.operations&&(!y.dialogue||!y.choices)))?.goNextStep);let b=a.find(y=>y.labelToOpen),S=[];return a.forEach(y=>{y.operations&&(S=[...S,...y.operations]);}),{dialogue:h?{character:h,text:c}:c,end:d?.end,choices:f?.choices,glueEnabled:m,goNextStep:g,labelToOpen:b?.labelToOpen,operations:S}}}var mi;(r=>{let e=new Set;function t(a){e.add(a);}r.add=t;function n(){e.clear();}r.clear=n;function i(a,s={}){let o=h=>Yl(h,s)??void 0,u=Ql(a,s);if(e.size===0)return o(u);let l=o;for(let h of e){let c=l;l=d=>h(d,c)??void 0;}return l(u)}r.getLogichValue=i;})(mi||={});var od=Object.create,iu=Object.defineProperty,ld=Object.getOwnPropertyDescriptor,ud=Object.getOwnPropertyNames,hd=Object.getPrototypeOf,cd=Object.prototype.hasOwnProperty,eu=(r=>typeof xt<"u"?xt:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof xt<"u"?xt:e)[t]}):r)(function(r){if(typeof xt<"u")return xt.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')}),ru=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),dd=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ud(e))!cd.call(r,i)&&i!==t&&iu(r,i,{get:()=>e[i],enumerable:!(n=ld(e,i))||n.enumerable});return r},pd=(r,e,t)=>(t=r!=null?od(hd(r)):{},dd(iu(t,"default",{value:r,enumerable:true}),r)),fd=ru((r,e)=>{(function(t,n){typeof r=="object"?e.exports=r=n():typeof define=="function"&&define.amd?define([],n):t.CryptoJS=n();})(r,function(){var t=t||(function(n,i){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof global<"u"&&global.crypto&&(a=global.crypto),!a&&typeof eu=="function")try{a=eu("crypto");}catch{}var s=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||(function(){function y(){}return function(p){var D;return y.prototype=p,D=new y,y.prototype=null,D}})(),u={},l=u.lib={},h=l.Base=(function(){return {extend:function(y){var p=o(this);return y&&p.mixIn(y),(!p.hasOwnProperty("init")||this.init===p.init)&&(p.init=function(){p.$super.init.apply(this,arguments);}),p.init.prototype=p,p.$super=this,p},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var p in y)y.hasOwnProperty(p)&&(this[p]=y[p]);y.hasOwnProperty("toString")&&(this.toString=y.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),c=l.WordArray=h.extend({init:function(y,p){y=this.words=y||[],p!=i?this.sigBytes=p:this.sigBytes=y.length*4;},toString:function(y){return (y||f).stringify(this)},concat:function(y){var p=this.words,D=y.words,C=this.sigBytes,E=y.sigBytes;if(this.clamp(),C%4)for(var x=0;x<E;x++){var P=D[x>>>2]>>>24-x%4*8&255;p[C+x>>>2]|=P<<24-(C+x)%4*8;}else for(var N=0;N<E;N+=4)p[C+N>>>2]=D[N>>>2];return this.sigBytes+=E,this},clamp:function(){var y=this.words,p=this.sigBytes;y[p>>>2]&=4294967295<<32-p%4*8,y.length=n.ceil(p/4);},clone:function(){var y=h.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var p=[],D=0;D<y;D+=4)p.push(s());return new c.init(p,y)}}),d=u.enc={},f=d.Hex={stringify:function(y){for(var p=y.words,D=y.sigBytes,C=[],E=0;E<D;E++){var x=p[E>>>2]>>>24-E%4*8&255;C.push((x>>>4).toString(16)),C.push((x&15).toString(16));}return C.join("")},parse:function(y){for(var p=y.length,D=[],C=0;C<p;C+=2)D[C>>>3]|=parseInt(y.substr(C,2),16)<<24-C%8*4;return new c.init(D,p/2)}},m=d.Latin1={stringify:function(y){for(var p=y.words,D=y.sigBytes,C=[],E=0;E<D;E++){var x=p[E>>>2]>>>24-E%4*8&255;C.push(String.fromCharCode(x));}return C.join("")},parse:function(y){for(var p=y.length,D=[],C=0;C<p;C++)D[C>>>2]|=(y.charCodeAt(C)&255)<<24-C%4*8;return new c.init(D,p)}},g=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(m.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return m.parse(unescape(encodeURIComponent(y)))}},b=l.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new c.init,this._nDataBytes=0;},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes;},_process:function(y){var p,D=this._data,C=D.words,E=D.sigBytes,x=this.blockSize,P=x*4,N=E/P;y?N=n.ceil(N):N=n.max((N|0)-this._minBufferSize,0);var Z=N*x,ye=n.min(Z*4,E);if(Z){for(var Gt=0;Gt<Z;Gt+=x)this._doProcessBlock(C,Gt);p=C.splice(0,Z),D.sigBytes-=ye;}return new c.init(p,ye)},clone:function(){var y=h.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});l.Hasher=b.extend({cfg:h.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset();},reset:function(){b.reset.call(this),this._doReset();},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var p=this._doFinalize();return p},blockSize:16,_createHelper:function(y){return function(p,D){return new y.init(D).finalize(p)}},_createHmacHelper:function(y){return function(p,D){return new S.HMAC.init(y,D).finalize(p)}}});var S=u.algo={};return u})(Math);return t});}),md=ru((r,e)=>{(function(t,n){typeof r=="object"?e.exports=r=n(fd()):typeof define=="function"&&define.amd?define(["./core"],n):n(t.CryptoJS);})(r,function(t){return (function(){var n=t,i=n.lib,a=i.WordArray,s=i.Hasher,o=n.algo,u=[],l=o.SHA1=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(h,c){for(var d=this._hash.words,f=d[0],m=d[1],g=d[2],b=d[3],S=d[4],y=0;y<80;y++){if(y<16)u[y]=h[c+y]|0;else {var p=u[y-3]^u[y-8]^u[y-14]^u[y-16];u[y]=p<<1|p>>>31;}var D=(f<<5|f>>>27)+S+u[y];y<20?D+=(m&g|~m&b)+1518500249:y<40?D+=(m^g^b)+1859775393:y<60?D+=(m&g|m&b|g&b)-1894007588:D+=(m^g^b)-899497514,S=b,b=g,g=m<<30|m>>>2,m=f,f=D;}d[0]=d[0]+f|0,d[1]=d[1]+m|0,d[2]=d[2]+g|0,d[3]=d[3]+b|0,d[4]=d[4]+S|0;},_doFinalize:function(){var h=this._data,c=h.words,d=this._nDataBytes*8,f=h.sigBytes*8;return c[f>>>5]|=128<<24-f%32,c[(f+64>>>9<<4)+14]=Math.floor(d/4294967296),c[(f+64>>>9<<4)+15]=d,h.sigBytes=c.length*4,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});n.SHA1=s._createHelper(l),n.HmacSHA1=s._createHmacHelper(l);})(),t.SHA1});}),tu="___param___",se;(r=>(r.log=(e,...t)=>console.log(`[Pixi\u2019VN Json] ${e}`,...t),r.warn=(e,...t)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...t),r.error=(e,...t)=>console.error(`[Pixi\u2019VN Json] ${e}`,...t),r.info=(e,...t)=>console.info(`[Pixi\u2019VN Json] ${e}`,...t)))(se||={});var gd=class ${static init(e){e.loadAssets&&($._loadAssets=e.loadAssets),e.soundOperation&&($._soundOperation=e.soundOperation),e.imageOperation&&($._imageOperation=e.imageOperation),e.videoOperation&&($._videoOperation=e.videoOperation),e.imageContainerOperation&&($._imageContainerOperation=e.imageContainerOperation),e.textOperation&&($._textOperation=e.textOperation),e.canvasElementOperation&&($._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&($._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&($._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&($._narrationOperation=e.narrationOperation),e.effectOperation&&($._effectOperation=e.effectOperation),e.animateOperation&&($._animateOperation=e.animateOperation),e.getLogichValue&&($._getLogichValue=e.getLogichValue),e.getConditionalStep&&($._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return $._loadAssets}static _soundOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return $._soundOperation}static _imageOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return $._imageOperation}static _videoOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return $._videoOperation}static _imageContainerOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return $._imageContainerOperation}static _textOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return $._textOperation}static _canvasElementOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return $._canvasElementOperation}static _setStorageValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return $._setStorageValue}static _setInitialStorageValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return $._setInitialStorageValue}static _narrationOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return $._narrationOperation}static _effectOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return $._effectOperation}static _animateOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return $._animateOperation}static _getLogichValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return $._getLogichValue}static _getConditionalStep=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return $._getConditionalStep}};function Cd(r,e){if(e&&typeof e=="object"&&typeof r.functionName=="string"&&r.functionName in e){let t=e[r.functionName];if(typeof t=="function"){let n=r.args.map(i=>gd.getLogichValue(i,e));return t(...n)}else se.warn(`getLogichValue function ${r.functionName} not found in props`);}}function yd(r,e={}){let t="";return r.values.forEach(n=>{if(typeof n=="string")t+=n;else {let i=_.getLogichValue(n,e);t+=`${i}`;}}),t}async function su(r,e,t){let n=_.getLogichValue(r,e);if(n)switch(n.type){case "sound":_.soundOperation(n);break;case "assets":case "bundle":await _.loadAssets(n);break;case "image":await _.imageOperation(n);break;case "video":await _.videoOperation(n);break;case "imagecontainer":await _.imageContainerOperation(n);break;case "text":await _.textOperation(n);break;case "canvaselement":await _.canvasElementOperation(n);break;case "value":_.setStorageValue(n,e);break;case "operationtoconvert":if(t){let i=yd(n,e),a=await t(i);a&&await su(a,e,t);}break;case "input":case "dialogue":_.narrationOperation(n);break;case "shake":await _.effectOperation(n);break;case "animate":case "animate-sequence":_.animateOperation(n);break;case "function":await Cd(n,e);break}}function nu(r){let e=_.getLogichValue(r,{});e&&e.type==="value"&&e.storageOperationType==="set"&&(e.storageType==="storage"||e.storageType==="tempstorage")&&_.setInitialStorageValue(e);}var vd=pd(md()),Sd=class extends LabelAbstract{constructor(r,e,t,n={}){t||(t={}),t.onLoadingLabel=async()=>{for(let i of e){let a;if(typeof i=="function"?a=i():a=i,a=_.getConditionalStep(a),a.operations)try{let s=a.operations.map(o=>_.loadAssets(o));await Promise.all(s);}catch(s){se.error("The operation in the onLoadingLabel function of the label has an error:",s);}}},super(r,t),this._steps=e,this.operationStringConvert=n.operationStringConvert,this.skipEmptyDialogs=n.skipEmptyDialogs||false;}_steps;get steps(){return this._steps.map(r=>this.stepConverter(r))}get stepCount(){return this._steps.length}getStepById(r){if(r<0||r>=this._steps.length)return;let e=this._steps[r];return this.stepConverter(e)}operationStringConvert;skipEmptyDialogs=false;getStepSha(r){if(r<0||r>=this.steps.length)return;let e=this._steps[r];return (0, vd.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(r,e){let t="";if(Array.isArray(r)){let n=[];r.forEach(i=>{if(typeof i=="string")n.push(i);else if(i&&typeof i=="object"){let a=_.getLogichValue(i,e);a?(a&&!Array.isArray(a)&&typeof a=="object"&&(a=_.getLogichValue(a,e)||""),Array.isArray(a)?n=n.map(s=>`${s}`).concat(a):n.push(`${a}`)):n.push(`${i}`);}else n.push(`${i}`);}),t=n;}else {let n=_.getLogichValue(r,e);n&&!Array.isArray(n)&&typeof n=="object"&&(n=_.getLogichValue(n,e)),n&&Array.isArray(n)?t=n.map(i=>`${i}`):t=`${n}`;}return t}getDialogue(r,e){if(r==null)return;let t=_.getLogichValue(r,e);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:Ve.t(this.getDialogueText(t.text,e))}:Ve.t(this.getDialogueText(t,e))}getChoices(r,e){return _.getLogichValue(r,e)?.map(t=>_.getLogichValue(t,e)).filter(t=>t!==void 0)}stepConverter(r){return async e=>{let t=typeof r=="function"?r():r;t=createExportableElement(t),t=_.getConditionalStep(t,e);let n=this.operationStringConvert?d=>this.operationStringConvert(d,t,e):void 0,{operations:i=[]}=t;for(let d of i)await su(d,e,n);let{labelToOpen:a=[]}=t,s=this.getChoices(t.choices,e),o=_.getLogichValue(t.glueEnabled,e),u=this.getDialogue(t.dialogue,e),l=[];Array.isArray(a)||(a=[a]),a.forEach(d=>{let f=_.getLogichValue(d,e);f&&l.push(f);});let h=_.getLogichValue(t.goNextStep,e),c=_.getLogichValue(t.end,e);if(s){let d=s.map(f=>{let m="";if(Array.isArray(f.text)){let g=[];f.text.forEach(b=>{if(typeof b=="string")g.push(Ve.t(b));else if(b&&typeof b=="object"){let S=_.getLogichValue(b,e);S&&!Array.isArray(S)&&typeof S=="object"&&(S=_.getLogichValue(S,e)||""),S&&(Array.isArray(S)?g=g.concat(Ve.t(S)):g.push(Ve.t(S)));}}),m=g;}else typeof f.text=="string"&&(m=Ve.t(f.text));return {label:f.label,text:m,props:f.props,type:f.type,oneTime:f.oneTime,onlyHaveNoChoice:f.onlyHaveNoChoice,autoSelect:f.autoSelect}});narration.choices=d;}else narration.choices=void 0;u!==void 0&&(narration.dialogue=u,this.skipEmptyDialogs&&typeof u=="string"&&(u===""||RegExp(/^\s+$/).test(u))&&(h=true)),o?narration.dialogGlue=true:o===false&&(narration.dialogGlue=false);for(let d of l){let f=d.label;typeof f=="object"&&(f=_.getLogichValue(f,e)||"");let m=d.params?.map(g=>_.getLogichValue(g,e));e={...e,...d.props},d.type==="jump"?(narration.openedLabels.length>0&&narration.closeCurrentLabel(),storage.setTempVariable(`${tu}${narration.openedLabels.length}`,m),await narration.call(f,e)):(storage.setTempVariable(`${tu}${narration.openedLabels.length}`,m),await narration.call(f,e));}c==="game_end"?(narration.closeAllLabels(),await narration.continue(e,{runNow:true})):c==="label_end"&&narration.closeCurrentLabel(),h&&await narration.continue(e,{runNow:true});}}};async function ry(r,e={}){if(!Array.isArray(r))if(typeof r=="object"||typeof r=="string")r=[r];else {se.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let t=r.map(a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(s){return se.error("Error parsing imported Pixi'VN JSON",s),{}}return a}),n=t.map(async a=>{if(a.initialOperations)for(let s of a.initialOperations)s.type==="value"&&(typeof s.value!="object"||!s.value||!("type"in s.value))&&nu(s);return Promise.resolve()});await Promise.all(n);let i=t.map(async a=>{if(a.initialOperations)for(let s of a.initialOperations)(s.type!=="value"||s.type==="value"&&typeof s.value=="object"&&s.value&&"type"in s.value)&&nu(s);if(a.labels){let s=a.labels;for(let o in s)try{let u=s[o],l=new Sd(o,u,void 0,e);RegisteredLabels.add(l);}catch(u){se.error(`Error creating JSON label ${o}`,u);}}return Promise.resolve()});await Promise.all(i);}var Ed={version:"1.13.10"};var au=`https://pixi-vn.com/schemas/${Ed.version}/schema.json`,ou=["==","!=","<","<=",">",">=","CONTAINS"];function hy(){_.init({animateOperation:Jl,canvasElementOperation:Gl,effectOperation:$l,imageContainerOperation:ql,imageOperation:Wl,textOperation:Ml,narrationOperation:Hl,loadAssets:Bl,soundOperation:zl,videoOperation:jl,setStorageValue:Kl,setInitialStorageValue:Xl,getLogichValue:mi.getLogichValue,getConditionalStep:fi});}var W;(i=>(i.log=(a,...s)=>console.log(`[Pixi\u2019VN Ink] ${a}`,...s),i.warn=(a,...s)=>console.warn(`[Pixi\u2019VN Ink] ${a}`,...s),i.error=(a,...s)=>console.error(`[Pixi\u2019VN Ink] ${a}`,...s),i.info=(a,...s)=>console.info(`[Pixi\u2019VN Ink] ${a}`,...s)))(W||={});var Dd=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,bd=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Ad=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,zs={Space_Separator:Dd,ID_Start:bd,ID_Continue:Ad},ne={isSpaceSeparator(r){return typeof r=="string"&&zs.Space_Separator.test(r)},isIdStartChar(r){return typeof r=="string"&&(r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="$"||r==="_"||zs.ID_Start.test(r))},isIdContinueChar(r){return typeof r=="string"&&(r>="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"||r==="$"||r==="_"||r==="\u200C"||r==="\u200D"||zs.ID_Continue.test(r))},isDigit(r){return typeof r=="string"&&/[0-9]/.test(r)},isHexDigit(r){return typeof r=="string"&&/[0-9A-Fa-f]/.test(r)}},Ks,Se,ot,Ci,pt,$e,oe,Qs,Dn,wd=function(e,t){Ks=String(e),Se="start",ot=[],Ci=0,pt=1,$e=0,oe=void 0,Qs=void 0,Dn=void 0;do oe=xd(),Td[Se]();while(oe.type!=="eof");return typeof t=="function"?Xs({"":Dn},"",t):Dn};function Xs(r,e,t){let n=r[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let a=String(i),s=Xs(n,a,t);s===void 0?delete n[a]:Object.defineProperty(n,a,{value:s,writable:true,enumerable:true,configurable:true});}else for(let i in n){let a=Xs(n,i,t);a===void 0?delete n[i]:Object.defineProperty(n,i,{value:a,writable:true,enumerable:true,configurable:true});}return t.call(r,e,n)}var V,I,En,at,L;function xd(){for(V="default",I="",En=false,at=1;;){L=lt();let r=uu[V]();if(r)return r}}function lt(){if(Ks[Ci])return String.fromCodePoint(Ks.codePointAt(Ci))}function A(){let r=lt();return r===`
46
+ ${D}`),D&&(o=true),s=_.getLogichValue(y.glueEnabled,e)||false,D)}),l=_.getLogichValue(u[0],e),h=typeof l=="object"&&"character"in l?l.character:void 0,c=u.flatMap(y=>{let p;y&&typeof y=="object"&&"text"in y?p=y.text:p=y;let D;return Array.isArray(p)?D=p.map(C=>{let E=_.getLogichValue(C,e);return Ve.t(`${E}`)}):D=_.getLogichValue(p,e)||"",Ve.t(D)}),d=a.find(y=>y.end),f=a.find(y=>y.choices),m=false,g=false;a.length>0&&(a[0].glueEnabled&&a[0].goNextStep&&a[0].dialogue===void 0&&(narration.dialogGlue=true),m=a[a.length-1].glueEnabled,g=a.reverse().find(y=>!(y.operations&&(!y.dialogue||!y.choices)))?.goNextStep);let b=a.find(y=>y.labelToOpen),S=[];return a.forEach(y=>{y.operations&&(S=[...S,...y.operations]);}),{dialogue:h?{character:h,text:c}:c,end:d?.end,choices:f?.choices,glueEnabled:m,goNextStep:g,labelToOpen:b?.labelToOpen,operations:S}}}var mi;(r=>{let e=new Set;function t(a){e.add(a);}r.add=t;function n(){e.clear();}r.clear=n;function i(a,s={}){let o=h=>Yl(h,s)??void 0,u=Ql(a,s);if(e.size===0)return o(u);let l=o;for(let h of e){let c=l;l=d=>h(d,c)??void 0;}return l(u)}r.getLogichValue=i;})(mi||={});var od=Object.create,iu=Object.defineProperty,ld=Object.getOwnPropertyDescriptor,ud=Object.getOwnPropertyNames,hd=Object.getPrototypeOf,cd=Object.prototype.hasOwnProperty,eu=(r=>typeof xt<"u"?xt:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof xt<"u"?xt:e)[t]}):r)(function(r){if(typeof xt<"u")return xt.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')}),ru=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),dd=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ud(e))!cd.call(r,i)&&i!==t&&iu(r,i,{get:()=>e[i],enumerable:!(n=ld(e,i))||n.enumerable});return r},pd=(r,e,t)=>(t=r!=null?od(hd(r)):{},dd(iu(t,"default",{value:r,enumerable:true}),r)),fd=ru((r,e)=>{(function(t,n){typeof r=="object"?e.exports=r=n():typeof define=="function"&&define.amd?define([],n):t.CryptoJS=n();})(r,function(){var t=t||(function(n,i){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof global<"u"&&global.crypto&&(a=global.crypto),!a&&typeof eu=="function")try{a=eu("crypto");}catch{}var s=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||(function(){function y(){}return function(p){var D;return y.prototype=p,D=new y,y.prototype=null,D}})(),u={},l=u.lib={},h=l.Base=(function(){return {extend:function(y){var p=o(this);return y&&p.mixIn(y),(!p.hasOwnProperty("init")||this.init===p.init)&&(p.init=function(){p.$super.init.apply(this,arguments);}),p.init.prototype=p,p.$super=this,p},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var p in y)y.hasOwnProperty(p)&&(this[p]=y[p]);y.hasOwnProperty("toString")&&(this.toString=y.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),c=l.WordArray=h.extend({init:function(y,p){y=this.words=y||[],p!=i?this.sigBytes=p:this.sigBytes=y.length*4;},toString:function(y){return (y||f).stringify(this)},concat:function(y){var p=this.words,D=y.words,C=this.sigBytes,E=y.sigBytes;if(this.clamp(),C%4)for(var x=0;x<E;x++){var P=D[x>>>2]>>>24-x%4*8&255;p[C+x>>>2]|=P<<24-(C+x)%4*8;}else for(var N=0;N<E;N+=4)p[C+N>>>2]=D[N>>>2];return this.sigBytes+=E,this},clamp:function(){var y=this.words,p=this.sigBytes;y[p>>>2]&=4294967295<<32-p%4*8,y.length=n.ceil(p/4);},clone:function(){var y=h.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var p=[],D=0;D<y;D+=4)p.push(s());return new c.init(p,y)}}),d=u.enc={},f=d.Hex={stringify:function(y){for(var p=y.words,D=y.sigBytes,C=[],E=0;E<D;E++){var x=p[E>>>2]>>>24-E%4*8&255;C.push((x>>>4).toString(16)),C.push((x&15).toString(16));}return C.join("")},parse:function(y){for(var p=y.length,D=[],C=0;C<p;C+=2)D[C>>>3]|=parseInt(y.substr(C,2),16)<<24-C%8*4;return new c.init(D,p/2)}},m=d.Latin1={stringify:function(y){for(var p=y.words,D=y.sigBytes,C=[],E=0;E<D;E++){var x=p[E>>>2]>>>24-E%4*8&255;C.push(String.fromCharCode(x));}return C.join("")},parse:function(y){for(var p=y.length,D=[],C=0;C<p;C++)D[C>>>2]|=(y.charCodeAt(C)&255)<<24-C%4*8;return new c.init(D,p)}},g=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(m.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return m.parse(unescape(encodeURIComponent(y)))}},b=l.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new c.init,this._nDataBytes=0;},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes;},_process:function(y){var p,D=this._data,C=D.words,E=D.sigBytes,x=this.blockSize,P=x*4,N=E/P;y?N=n.ceil(N):N=n.max((N|0)-this._minBufferSize,0);var Z=N*x,ye=n.min(Z*4,E);if(Z){for(var Gt=0;Gt<Z;Gt+=x)this._doProcessBlock(C,Gt);p=C.splice(0,Z),D.sigBytes-=ye;}return new c.init(p,ye)},clone:function(){var y=h.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});l.Hasher=b.extend({cfg:h.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset();},reset:function(){b.reset.call(this),this._doReset();},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var p=this._doFinalize();return p},blockSize:16,_createHelper:function(y){return function(p,D){return new y.init(D).finalize(p)}},_createHmacHelper:function(y){return function(p,D){return new S.HMAC.init(y,D).finalize(p)}}});var S=u.algo={};return u})(Math);return t});}),md=ru((r,e)=>{(function(t,n){typeof r=="object"?e.exports=r=n(fd()):typeof define=="function"&&define.amd?define(["./core"],n):n(t.CryptoJS);})(r,function(t){return (function(){var n=t,i=n.lib,a=i.WordArray,s=i.Hasher,o=n.algo,u=[],l=o.SHA1=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(h,c){for(var d=this._hash.words,f=d[0],m=d[1],g=d[2],b=d[3],S=d[4],y=0;y<80;y++){if(y<16)u[y]=h[c+y]|0;else {var p=u[y-3]^u[y-8]^u[y-14]^u[y-16];u[y]=p<<1|p>>>31;}var D=(f<<5|f>>>27)+S+u[y];y<20?D+=(m&g|~m&b)+1518500249:y<40?D+=(m^g^b)+1859775393:y<60?D+=(m&g|m&b|g&b)-1894007588:D+=(m^g^b)-899497514,S=b,b=g,g=m<<30|m>>>2,m=f,f=D;}d[0]=d[0]+f|0,d[1]=d[1]+m|0,d[2]=d[2]+g|0,d[3]=d[3]+b|0,d[4]=d[4]+S|0;},_doFinalize:function(){var h=this._data,c=h.words,d=this._nDataBytes*8,f=h.sigBytes*8;return c[f>>>5]|=128<<24-f%32,c[(f+64>>>9<<4)+14]=Math.floor(d/4294967296),c[(f+64>>>9<<4)+15]=d,h.sigBytes=c.length*4,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});n.SHA1=s._createHelper(l),n.HmacSHA1=s._createHmacHelper(l);})(),t.SHA1});}),tu="___param___",se;(r=>(r.log=(e,...t)=>console.log(`[Pixi\u2019VN Json] ${e}`,...t),r.warn=(e,...t)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...t),r.error=(e,...t)=>console.error(`[Pixi\u2019VN Json] ${e}`,...t),r.info=(e,...t)=>console.info(`[Pixi\u2019VN Json] ${e}`,...t)))(se||={});var gd=class ${static init(e){e.loadAssets&&($._loadAssets=e.loadAssets),e.soundOperation&&($._soundOperation=e.soundOperation),e.imageOperation&&($._imageOperation=e.imageOperation),e.videoOperation&&($._videoOperation=e.videoOperation),e.imageContainerOperation&&($._imageContainerOperation=e.imageContainerOperation),e.textOperation&&($._textOperation=e.textOperation),e.canvasElementOperation&&($._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&($._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&($._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&($._narrationOperation=e.narrationOperation),e.effectOperation&&($._effectOperation=e.effectOperation),e.animateOperation&&($._animateOperation=e.animateOperation),e.getLogichValue&&($._getLogichValue=e.getLogichValue),e.getConditionalStep&&($._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return $._loadAssets}static _soundOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return $._soundOperation}static _imageOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return $._imageOperation}static _videoOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return $._videoOperation}static _imageContainerOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return $._imageContainerOperation}static _textOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return $._textOperation}static _canvasElementOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return $._canvasElementOperation}static _setStorageValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return $._setStorageValue}static _setInitialStorageValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return $._setInitialStorageValue}static _narrationOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return $._narrationOperation}static _effectOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return $._effectOperation}static _animateOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return $._animateOperation}static _getLogichValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return $._getLogichValue}static _getConditionalStep=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return $._getConditionalStep}};function Cd(r,e){if(e&&typeof e=="object"&&typeof r.functionName=="string"&&r.functionName in e){let t=e[r.functionName];if(typeof t=="function"){let n=r.args.map(i=>gd.getLogichValue(i,e));return t(...n)}else se.warn(`getLogichValue function ${r.functionName} not found in props`);}}function yd(r,e={}){let t="";return r.values.forEach(n=>{if(typeof n=="string")t+=n;else {let i=_.getLogichValue(n,e);t+=`${i}`;}}),t}async function su(r,e,t){let n=_.getLogichValue(r,e);if(n)switch(n.type){case "sound":_.soundOperation(n);break;case "assets":case "bundle":await _.loadAssets(n);break;case "image":await _.imageOperation(n);break;case "video":await _.videoOperation(n);break;case "imagecontainer":await _.imageContainerOperation(n);break;case "text":await _.textOperation(n);break;case "canvaselement":await _.canvasElementOperation(n);break;case "value":_.setStorageValue(n,e);break;case "operationtoconvert":if(t){let i=yd(n,e),a=await t(i);a&&await su(a,e,t);}break;case "input":case "dialogue":_.narrationOperation(n);break;case "shake":await _.effectOperation(n);break;case "animate":case "animate-sequence":_.animateOperation(n);break;case "function":await Cd(n,e);break}}function nu(r){let e=_.getLogichValue(r,{});e&&e.type==="value"&&e.storageOperationType==="set"&&(e.storageType==="storage"||e.storageType==="tempstorage")&&_.setInitialStorageValue(e);}var vd=pd(md()),Sd=class extends LabelAbstract{constructor(r,e,t,n={}){t||(t={}),t.onLoadingLabel=async()=>{for(let i of e){let a;if(typeof i=="function"?a=i():a=i,a=_.getConditionalStep(a),a.operations)try{let s=a.operations.map(o=>_.loadAssets(o));await Promise.all(s);}catch(s){se.error("The operation in the onLoadingLabel function of the label has an error:",s);}}},super(r,t),this._steps=e,this.operationStringConvert=n.operationStringConvert,this.skipEmptyDialogs=n.skipEmptyDialogs||false;}_steps;get steps(){return this._steps.map(r=>this.stepConverter(r))}get stepCount(){return this._steps.length}getStepById(r){if(r<0||r>=this._steps.length)return;let e=this._steps[r];return this.stepConverter(e)}operationStringConvert;skipEmptyDialogs=false;getStepSha(r){if(r<0||r>=this.steps.length)return;let e=this._steps[r];return (0, vd.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(r,e){let t="";if(Array.isArray(r)){let n=[];r.forEach(i=>{if(typeof i=="string")n.push(i);else if(i&&typeof i=="object"){let a=_.getLogichValue(i,e);a?(a&&!Array.isArray(a)&&typeof a=="object"&&(a=_.getLogichValue(a,e)||""),Array.isArray(a)?n=n.map(s=>`${s}`).concat(a):n.push(`${a}`)):n.push(`${i}`);}else n.push(`${i}`);}),t=n;}else {let n=_.getLogichValue(r,e);n&&!Array.isArray(n)&&typeof n=="object"&&(n=_.getLogichValue(n,e)),n&&Array.isArray(n)?t=n.map(i=>`${i}`):t=`${n}`;}return t}getDialogue(r,e){if(r==null)return;let t=_.getLogichValue(r,e);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:Ve.t(this.getDialogueText(t.text,e))}:Ve.t(this.getDialogueText(t,e))}getChoices(r,e){return _.getLogichValue(r,e)?.map(t=>_.getLogichValue(t,e)).filter(t=>t!==void 0)}stepConverter(r){return async e=>{let t=typeof r=="function"?r():r;t=createExportableElement(t),t=_.getConditionalStep(t,e);let n=this.operationStringConvert?d=>this.operationStringConvert(d,t,e):void 0,{operations:i=[]}=t;for(let d of i)await su(d,e,n);let{labelToOpen:a=[]}=t,s=this.getChoices(t.choices,e),o=_.getLogichValue(t.glueEnabled,e),u=this.getDialogue(t.dialogue,e),l=[];Array.isArray(a)||(a=[a]),a.forEach(d=>{let f=_.getLogichValue(d,e);f&&l.push(f);});let h=_.getLogichValue(t.goNextStep,e),c=_.getLogichValue(t.end,e);if(s){let d=s.map(f=>{let m="";if(Array.isArray(f.text)){let g=[];f.text.forEach(b=>{if(typeof b=="string")g.push(Ve.t(b));else if(b&&typeof b=="object"){let S=_.getLogichValue(b,e);S&&!Array.isArray(S)&&typeof S=="object"&&(S=_.getLogichValue(S,e)||""),S&&(Array.isArray(S)?g=g.concat(Ve.t(S)):g.push(Ve.t(S)));}}),m=g;}else typeof f.text=="string"&&(m=Ve.t(f.text));return {label:f.label,text:m,props:f.props,type:f.type,oneTime:f.oneTime,onlyHaveNoChoice:f.onlyHaveNoChoice,autoSelect:f.autoSelect}});narration.choices=d;}else narration.choices=void 0;u!==void 0&&(narration.dialogue=u,this.skipEmptyDialogs&&typeof u=="string"&&(u===""||RegExp(/^\s+$/).test(u))&&(h=true)),o?narration.dialogGlue=true:o===false&&(narration.dialogGlue=false);for(let d of l){let f=d.label;typeof f=="object"&&(f=_.getLogichValue(f,e)||"");let m=d.params?.map(g=>_.getLogichValue(g,e));e={...e,...d.props},d.type==="jump"?(narration.openedLabels.length>0&&narration.closeCurrentLabel(),storage.setTempVariable(`${tu}${narration.openedLabels.length}`,m),await narration.call(f,e)):(storage.setTempVariable(`${tu}${narration.openedLabels.length}`,m),await narration.call(f,e));}c==="game_end"?(narration.closeAllLabels(),await narration.continue(e,{runNow:true})):c==="label_end"&&narration.closeCurrentLabel(),h&&await narration.continue(e,{runNow:true});}}};async function ry(r,e={}){if(!Array.isArray(r))if(typeof r=="object"||typeof r=="string")r=[r];else {se.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let t=r.map(a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(s){return se.error("Error parsing imported Pixi'VN JSON",s),{}}return a}),n=t.map(async a=>{if(a.initialOperations)for(let s of a.initialOperations)s.type==="value"&&(typeof s.value!="object"||!s.value||!("type"in s.value))&&nu(s);return Promise.resolve()});await Promise.all(n);let i=t.map(async a=>{if(a.initialOperations)for(let s of a.initialOperations)(s.type!=="value"||s.type==="value"&&typeof s.value=="object"&&s.value&&"type"in s.value)&&nu(s);if(a.labels){let s=a.labels;for(let o in s)try{let u=s[o],l=new Sd(o,u,void 0,e);RegisteredLabels.add(l);}catch(u){se.error(`Error creating JSON label ${o}`,u);}}return Promise.resolve()});await Promise.all(i);}var Ed={version:"1.13.12"};var au=`https://pixi-vn.com/schemas/${Ed.version}/schema.json`,ou=["==","!=","<","<=",">",">=","CONTAINS"];function hy(){_.init({animateOperation:Jl,canvasElementOperation:Gl,effectOperation:$l,imageContainerOperation:ql,imageOperation:Wl,textOperation:Ml,narrationOperation:Hl,loadAssets:Bl,soundOperation:zl,videoOperation:jl,setStorageValue:Kl,setInitialStorageValue:Xl,getLogichValue:mi.getLogichValue,getConditionalStep:fi});}var W;(i=>(i.log=(a,...s)=>console.log(`[Pixi\u2019VN Ink] ${a}`,...s),i.warn=(a,...s)=>console.warn(`[Pixi\u2019VN Ink] ${a}`,...s),i.error=(a,...s)=>console.error(`[Pixi\u2019VN Ink] ${a}`,...s),i.info=(a,...s)=>console.info(`[Pixi\u2019VN Ink] ${a}`,...s)))(W||={});var Dd=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,bd=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Ad=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,zs={Space_Separator:Dd,ID_Start:bd,ID_Continue:Ad},ne={isSpaceSeparator(r){return typeof r=="string"&&zs.Space_Separator.test(r)},isIdStartChar(r){return typeof r=="string"&&(r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="$"||r==="_"||zs.ID_Start.test(r))},isIdContinueChar(r){return typeof r=="string"&&(r>="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"||r==="$"||r==="_"||r==="\u200C"||r==="\u200D"||zs.ID_Continue.test(r))},isDigit(r){return typeof r=="string"&&/[0-9]/.test(r)},isHexDigit(r){return typeof r=="string"&&/[0-9A-Fa-f]/.test(r)}},Ks,Se,ot,Ci,pt,$e,oe,Qs,Dn,wd=function(e,t){Ks=String(e),Se="start",ot=[],Ci=0,pt=1,$e=0,oe=void 0,Qs=void 0,Dn=void 0;do oe=xd(),Td[Se]();while(oe.type!=="eof");return typeof t=="function"?Xs({"":Dn},"",t):Dn};function Xs(r,e,t){let n=r[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let a=String(i),s=Xs(n,a,t);s===void 0?delete n[a]:Object.defineProperty(n,a,{value:s,writable:true,enumerable:true,configurable:true});}else for(let i in n){let a=Xs(n,i,t);a===void 0?delete n[i]:Object.defineProperty(n,i,{value:a,writable:true,enumerable:true,configurable:true});}return t.call(r,e,n)}var V,I,En,at,L;function xd(){for(V="default",I="",En=false,at=1;;){L=lt();let r=uu[V]();if(r)return r}}function lt(){if(Ks[Ci])return String.fromCodePoint(Ks.codePointAt(Ci))}function A(){let r=lt();return r===`
47
47
  `?(pt++,$e=0):r?$e+=r.length:$e++,r&&(Ci+=r.length),r}var uu={default(){switch(L){case " ":case "\v":case "\f":case " ":case "\xA0":case "\uFEFF":case `
48
48
  `:case "\r":case "\u2028":case "\u2029":A();return;case "/":A(),V="comment";return;case void 0:return A(),K("eof")}if(ne.isSpaceSeparator(L)){A();return}return uu[Se]()},comment(){switch(L){case "*":A(),V="multiLineComment";return;case "/":A(),V="singleLineComment";return}throw X(A())},multiLineComment(){switch(L){case "*":A(),V="multiLineCommentAsterisk";return;case void 0:throw X(A())}A();},multiLineCommentAsterisk(){switch(L){case "*":A();return;case "/":A(),V="default";return;case void 0:throw X(A())}A(),V="multiLineComment";},singleLineComment(){switch(L){case `
49
49
  `:case "\r":case "\u2028":case "\u2029":A(),V="default";return;case void 0:return A(),K("eof")}A();},value(){switch(L){case "{":case "[":return K("punctuator",A());case "n":return A(),_t("ull"),K("null",null);case "t":return A(),_t("rue"),K("boolean",true);case "f":return A(),_t("alse"),K("boolean",false);case "-":case "+":A()==="-"&&(at=-1),V="sign";return;case ".":I=A(),V="decimalPointLeading";return;case "0":I=A(),V="zero";return;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":I=A(),V="decimalInteger";return;case "I":return A(),_t("nfinity"),K("numeric",1/0);case "N":return A(),_t("aN"),K("numeric",NaN);case '"':case "'":En=A()==='"',I="",V="string";return}throw X(A())},identifierNameStartEscape(){if(L!=="u")throw X(A());A();let r=Ys();switch(r){case "$":case "_":break;default:if(!ne.isIdStartChar(r))throw lu();break}I+=r,V="identifierName";},identifierName(){switch(L){case "$":case "_":case "\u200C":case "\u200D":I+=A();return;case "\\":A(),V="identifierNameEscape";return}if(ne.isIdContinueChar(L)){I+=A();return}return K("identifier",I)},identifierNameEscape(){if(L!=="u")throw X(A());A();let r=Ys();switch(r){case "$":case "_":case "\u200C":case "\u200D":break;default:if(!ne.isIdContinueChar(r))throw lu();break}I+=r,V="identifierName";},sign(){switch(L){case ".":I=A(),V="decimalPointLeading";return;case "0":I=A(),V="zero";return;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":I=A(),V="decimalInteger";return;case "I":return A(),_t("nfinity"),K("numeric",at*(1/0));case "N":return A(),_t("aN"),K("numeric",NaN)}throw X(A())},zero(){switch(L){case ".":I+=A(),V="decimalPoint";return;case "e":case "E":I+=A(),V="decimalExponent";return;case "x":case "X":I+=A(),V="hexadecimal";return}return K("numeric",at*0)},decimalInteger(){switch(L){case ".":I+=A(),V="decimalPoint";return;case "e":case "E":I+=A(),V="decimalExponent";return}if(ne.isDigit(L)){I+=A();return}return K("numeric",at*Number(I))},decimalPointLeading(){if(ne.isDigit(L)){I+=A(),V="decimalFraction";return}throw X(A())},decimalPoint(){switch(L){case "e":case "E":I+=A(),V="decimalExponent";return}if(ne.isDigit(L)){I+=A(),V="decimalFraction";return}return K("numeric",at*Number(I))},decimalFraction(){switch(L){case "e":case "E":I+=A(),V="decimalExponent";return}if(ne.isDigit(L)){I+=A();return}return K("numeric",at*Number(I))},decimalExponent(){switch(L){case "+":case "-":I+=A(),V="decimalExponentSign";return}if(ne.isDigit(L)){I+=A(),V="decimalExponentInteger";return}throw X(A())},decimalExponentSign(){if(ne.isDigit(L)){I+=A(),V="decimalExponentInteger";return}throw X(A())},decimalExponentInteger(){if(ne.isDigit(L)){I+=A();return}return K("numeric",at*Number(I))},hexadecimal(){if(ne.isHexDigit(L)){I+=A(),V="hexadecimalInteger";return}throw X(A())},hexadecimalInteger(){if(ne.isHexDigit(L)){I+=A();return}return K("numeric",at*Number(I))},string(){switch(L){case "\\":A(),I+=_d();return;case '"':if(En)return A(),K("string",I);I+=A();return;case "'":if(!En)return A(),K("string",I);I+=A();return;case `
@@ -65,7 +65,7 @@ ${D}`),D&&(o=true),s=_.getLogichValue(y.glueEnabled,e)||false,D)}),l=_.getLogich
65
65
  # lazyload bundle <alias...>
66
66
  \`\`\``,validation:v.union([v.tuple([v.enum(["load","lazyload"]),v.literal("assets")]).rest(e(r.assetAliasIds)),v.tuple([v.enum(["load","lazyload"]),v.literal("bundle")]).rest(e(r.bundleIds))])}),O.addMapper(l=>({type:"all",operationType:l[0]}),{name:"Pause/Resume/Stop all sounds",description:"Pauses, resumes, or stops all active sounds at once.\n\n```ink\n# pause all sounds\n# resume all sounds\n# stop all sounds\n```",validation:v.tuple([v.enum(["pause","resume","stop"]),v.literal("all"),v.enum(["sounds","sound"])])}),O.addMapper(l=>({type:"sound",operationType:"pause",alias:l[2]}),{name:"Pause sound",description:"Pauses the sound identified by its alias.\n\n```ink\n# pause sound <alias>\n```",validation:v.tuple([v.literal("pause"),v.literal("sound"),v.string()])}),O.addMapper(l=>({type:"channel",operationType:"pause",alias:l[2]}),{name:"Pause channel",description:"Pauses the audio channel identified by its alias.\n\n```ink\n# pause channel <alias>\n```",validation:v.tuple([v.literal("pause"),v.literal("channel"),v.string()])}),O.addMapper(l=>({type:"sound",operationType:"resume",alias:l[2]}),{name:"Resume sound",description:"Resumes the sound identified by its alias.\n\n```ink\n# resume sound <alias>\n```",validation:v.tuple([v.literal("resume"),v.literal("sound"),v.string()])}),O.addMapper(l=>({type:"channel",operationType:"resume",alias:l[2]}),{name:"Resume channel",description:"Resumes the audio channel identified by its alias.\n\n```ink\n# resume channel <alias>\n```",validation:v.tuple([v.literal("resume"),v.literal("channel"),v.string()])}),O.addMapper(l=>({type:"sound",operationType:"stop",alias:l[2]}),{name:"Stop sound",description:"Stops the sound identified by its alias.\n\n```ink\n# stop sound <alias>\n```",validation:v.tuple([v.literal("stop"),v.literal("sound"),v.string()])}),O.addMapper(l=>({type:"sound",operationType:"stop",alias:l[2]}),{name:"Remove sound",description:"Removes (stops) the sound identified by its alias.\n\n```ink\n# remove sound <alias>\n```",deprecated:true,validation:v.tuple([v.literal("remove"),v.literal("sound"),v.string()])}),O.addMapper(l=>({type:"sound",operationType:"edit",alias:l[2],props:O.convertListStringToObj(l.slice(3))}),{name:"Edit sound",description:"Edits the properties of a sound identified by its alias.\n\n```ink\n# edit sound <alias> [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("edit"),v.literal("sound"),v.string()]).rest(v.string()).refine(l=>(l.length-3)%2===0)}),O.addMapper(l=>{let h=l[2],c={type:"sound",operationType:"play",alias:h,url:h};return l.length>3&&(c.props=O.convertListStringToObj(l.slice(3))),c},{name:"Play sound",description:"Plays a sound using its alias as the URL, with optional key/value properties.\n\n```ink\n# play sound <alias> [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("play"),v.literal("sound"),v.string()]).rest(v.string()).refine(l=>(l.length-3)%2===0)}),O.addMapper(l=>{let h=l[2],c=l[3],d={type:"sound",operationType:"play",alias:h,url:c};return l.length>4&&(d.props=O.convertListStringToObj(l.slice(4))),d},{name:"Play sound with source",description:"Plays a sound with an explicit source URL and optional key/value properties.\n \n```ink\n# play sound <alias> <source> [<key> <value> \u2026]\n```\n",validation:v.tuple([v.literal("play"),v.literal("sound"),v.string()]).rest(v.string()).refine(l=>l.length>3&&(l.length-3)%2!==0)});function t(l){let h=[],c=0,d="";for(let f of l)f.startsWith("{")?(c++,d+=f):f.endsWith("}")&&c>0?(c--,d+=f,c===0&&(h.push(d),d="")):c>0?d+=f:h.push(f);return h}function n(l,h){switch(l){case "dissolve":case "fade":case "movein":case "moveout":case "zoomin":case "zoomout":case "pushin":case "pushout":break;default:return}let c={type:l};if(h.length>0)try{c.props=O.convertListStringToObj(h);}catch{}return c}function i(l,h,c){let d,f;c.length%2===0?(d=h,f=c):(d=c[0],f=c.slice(1));let m={type:l,operationType:"show",alias:h,url:d};if(f.length>0){if(f.includes("with")&&f.length>f.indexOf("with")+1){let g=f[f.indexOf("with")+1],b=f.slice(f.indexOf("with")+2);f=f.slice(0,f.indexOf("with"));let S=n(g,b);S!==void 0&&(m.transition=S);}f.length>0&&(m.props=O.convertListStringToObj(f));}return m}function a(l,h){let c,d;h.length%2===0?(c=l,d=h):(c=h[0],d=h.slice(1));let f={type:"text",operationType:"show",alias:l,text:c};if(d.length>0){if(d.includes("with")&&d.length>d.indexOf("with")+1){let m=d[d.indexOf("with")+1],g=d.slice(d.indexOf("with")+2);d=d.slice(0,d.indexOf("with"));let b=n(m,g);b!==void 0&&(f.transition=b);}d.length>0&&(f.props=O.convertListStringToObj(d));}return f}function s(l,h,c){let d={type:l,operationType:"remove",alias:h};if(c.includes("with")&&c.length>c.indexOf("with")+1){let f=c[c.indexOf("with")+1],m=c.slice(c.indexOf("with")+2),g=n(f,m);g!==void 0&&(d.transition=g);}return d}function o(l,h){let c=S=>S.startsWith('"')&&S.endsWith('"')||S.startsWith("'")&&S.endsWith("'")||S.startsWith("`")&&S.endsWith("`")?S.substring(1,S.length-1):S,d=[],f=h.findIndex(S=>S.startsWith("[")),m=h.findIndex(S=>S.endsWith("]"));if(f===-1||m===-1){W.error("Show imagecontainer must have a list of image ulrs",h);return}if(d=h.slice(f,m+1),d.length<2){W.error("Show imagecontainer must have a list of image ulrs",h);return}d[0]==="["?d.shift():d[0]=d[0].substring(1),d[d.length-1]==="]"?d.pop():d[d.length-1]=d[d.length-1].substring(0,d[d.length-1].length-1);let g={type:"imagecontainer",operationType:"show",alias:l,urls:d.map(S=>c(S))},b=h.slice(m+1);if(b.length>0){if(b.includes("with")&&b.length>b.indexOf("with")+1){let S=b[b.indexOf("with")+1],y=b.slice(b.indexOf("with")+2);b=b.slice(0,b.indexOf("with"));let p=n(S,y);p!==void 0&&(g.transition=p);}b.length>0&&(g.props=O.convertListStringToObj(b));}return g}function u(l){let h=l.slice(3),c=h.findIndex(g=>g.startsWith("[")),d=h.findIndex(g=>g.endsWith("]"));if(c===-1||d===-1||d<c)return;let f=h.slice(d+1),m=f.indexOf("with");return m===-1?{beforeWith:f,afterWith:[]}:{beforeWith:f.slice(0,m),afterWith:f.slice(m+1)}}O.addMapper(l=>({alias:l[1],type:"shake",props:O.convertListStringToObj(l.slice(2))}),{name:"Shake",description:"Applies shake effect to a canvas alias with optional key/value parameters.\n\n```ink\n# shake <alias> [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("shake"),v.string()]).rest(v.string()).refine(l=>(l.length-2)%2===0)}),O.addMapper(l=>{let h=l.slice(2),c=h,d=[];if(h.includes("options")){let m=h.indexOf("options");c=h.slice(0,m),d=h.slice(m+1);}return {alias:l[1],type:"animate",keyframes:O.convertListStringToObj(c),options:O.convertListStringToObj(d)}},{name:"Animate",description:"Animates a canvas alias with keyframes and optional options section, both in key/value pairs.\n\n```ink\n# animate <alias> [<key> <value> \u2026] [options <key> <value> \u2026]\n```",validation:v.tuple([v.literal("animate"),v.string()]).rest(v.string()).refine(l=>{let h=l.slice(2),c=h.indexOf("options");if(c===-1)return h.length%2===0;if(h.lastIndexOf("options")!==c)return false;let d=h.slice(0,c),f=h.slice(c+1);return d.length%2===0&&f.length%2===0})}),O.addMapper(l=>{let h=l[2],c=t(l.slice(3));return i("image",h,c)},{name:"Show image",description:"Shows an image canvas element with optional source URL, key/value properties, and transition effect.\n\n```ink\n# show image <alias> [<source>] [<key> <value> \u2026] [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v.tuple([v.literal("show"),v.literal("image"),v.string()]).rest(v.string())}),O.addMapper(l=>o(l[2],t(l.slice(3))),{name:"Show imagecontainer",description:"Shows an image-container canvas element with a list of image URLs and optional key/value properties.\n\n```ink\n# show imagecontainer <alias> [ <url1> <url2> \u2026 ] [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("show"),v.literal("imagecontainer"),v.string()]).rest(v.string()).refine(l=>{let h=u(l);return h===void 0?false:h.afterWith.length===0&&h.beforeWith.length%2===0})}),O.addMapper(l=>o(l[2],t(l.slice(3))),{name:"Show imagecontainer with transition",description:"Shows an image-container canvas element with a list of image URLs, optional properties, and a transition effect.\n\n```ink\n# show imagecontainer <alias> [ <url1> <url2> \u2026 ] [<key> <value> \u2026] with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout\n```",validation:v.tuple([v.literal("show"),v.literal("imagecontainer"),v.string()]).rest(v.string()).refine(l=>{let h=u(l);return h===void 0?false:h.afterWith.length===1&&h.beforeWith.length%2===0})}),O.addMapper(l=>o(l[2],t(l.slice(3))),{name:"Show imagecontainer with transition and props",description:"Shows an image-container canvas element with a list of image URLs, optional properties, a transition effect, and transition key/value properties.\n\n```ink\n# show imagecontainer <alias> [ <url1> <url2> \u2026 ] [<key> <value> \u2026] with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout <key> <value> \u2026\n```",validation:v.tuple([v.literal("show"),v.literal("imagecontainer"),v.string()]).rest(v.string()).refine(l=>{let h=u(l);return h===void 0?false:h.afterWith.length>1&&(h.afterWith.length-1)%2===0&&h.beforeWith.length%2===0})}),O.addMapper(l=>{let h=l[2],c=t(l.slice(3));return i("video",h,c)},{name:"Show video",description:"Shows a video canvas element with optional source URL, key/value properties, and transition effect.\n\n```ink\n# show video <alias> [<source>] [<key> <value> \u2026] [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v.tuple([v.literal("show"),v.literal("video"),v.string()]).rest(v.string())}),O.addMapper(l=>{let h=l[2];return a(h,l.slice(3))},{name:"Show text",description:"Shows a text canvas element with optional text content, key/value properties, and transition effect.\n\n```ink\n# show text <alias> [<text>] [<key> <value> \u2026] [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v.tuple([v.literal("show"),v.literal("text"),v.string()]).rest(v.string())}),O.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("image",h,c)},{name:"Remove image",description:"Removes an image canvas element with an optional transition effect.\n\n```ink\n# remove image <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v.tuple([v.literal("remove"),v.literal("image"),v.string()]).rest(v.string())}),O.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("video",h,c)},{name:"Remove video",description:"Removes a video canvas element with an optional transition effect.\n\n```ink\n# remove video <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v.tuple([v.literal("remove"),v.literal("video"),v.string()]).rest(v.string())}),O.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("canvaselement",h,c)},{name:"Remove canvas element",description:"Removes a canvas element with an optional transition effect.\n\n```ink\n# remove canvaselement <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v.tuple([v.literal("remove"),v.literal("canvaselement"),v.string()]).rest(v.string())}),O.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("text",h,c)},{name:"Remove text",description:"Removes a text canvas element with an optional transition effect.\n\n```ink\n# remove text <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v.tuple([v.literal("remove"),v.literal("text"),v.string()]).rest(v.string())}),O.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("imagecontainer",h,c)},{name:"Remove imagecontainer",description:"Removes an image-container canvas element with an optional transition effect.\n\n```ink\n# remove imagecontainer <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v.tuple([v.literal("remove"),v.literal("imagecontainer"),v.string()]).rest(v.string())}),O.addMapper(l=>({type:"image",operationType:"edit",alias:l[2],props:O.convertListStringToObj(l.slice(3))}),{name:"Edit image",description:"Edits the properties of an image canvas element identified by its alias.\n\n```ink\n# edit image <alias> [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("edit"),v.literal("image"),v.string()]).rest(v.string())}),O.addMapper(l=>({type:"imagecontainer",operationType:"edit",alias:l[2],props:O.convertListStringToObj(l.slice(3))}),{name:"Edit imagecontainer",description:"Edits the properties of an image-container canvas element identified by its alias.\n\n```ink\n# edit imagecontainer <alias> [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("edit"),v.literal("imagecontainer"),v.string()]).rest(v.string())}),O.addMapper(l=>({type:"canvaselement",operationType:"edit",alias:l[2],props:O.convertListStringToObj(l.slice(3))}),{name:"Edit canvas element",description:"Edits the properties of a canvas element identified by its alias.\n\n```ink\n# edit canvaselement <alias> [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("edit"),v.literal("canvaselement"),v.string()]).rest(v.string())}),O.addMapper(l=>({type:"video",operationType:"edit",alias:l[2],props:O.convertListStringToObj(l.slice(3))}),{name:"Edit video",description:"Edits the properties of a video canvas element identified by its alias.\n\n```ink\n# edit video <alias> [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("edit"),v.literal("video"),v.string()]).rest(v.string())}),O.addMapper(l=>({type:"text",operationType:"edit",alias:l[2],props:O.convertListStringToObj(l.slice(3))}),{name:"Edit text",description:"Edits the properties of a text canvas element identified by its alias.\n\n```ink\n# edit text <alias> [<key> <value> \u2026]\n```",validation:v.tuple([v.literal("edit"),v.literal("text"),v.string()]).rest(v.string())}),O.addMapper(l=>({type:"input",operationType:"request"}),{name:"Request input",description:"Requests player input without any additional constraints.\n\n```ink\n# request input\n```",validation:v.tuple([v.literal("request"),v.literal("input")])}),O.addMapper(l=>{let h={type:"input",operationType:"request"};try{let c=O.convertListStringToObj(l.slice(2));"type"in c&&typeof c.type=="string"&&(h.valueType=c.type),"default"in c&&(h.defaultValue=c.default);}catch{}return h},{name:"Request input with params",description:"Requests player input with optional key/value parameters (e.g. type, default).\n\n```ink\n# request input <key> <value> [<key> <value> \u2026]\n# request input type number default 18\n```",validation:v.tuple([v.literal("request"),v.literal("input")]).rest(v.string()).refine(l=>l.length>2&&(l.length-2)%2===0)});}var vi="global decl",Tt="___external_value___",yu=/\[([^\]]+)\]/;var vu=["+","-","/","*","%","_","==",">","<",">=","<=","!=","!","&&","||","MIN","MAX"],Su=["+","-","/","*","%","POW","RANDOM","L^"],Eu=["INT","FLOOR","FLOAT"];function Jt(r,e){if(r.endsWith(".s"))return;if(new RegExp(/.*\.[0-9]+\..*$/).test(r)&&(r=r.split(".").filter(i=>!i.match(/^[0-9]+$/)).join("."),!r.startsWith(".")))return r.replaceAll(".","_|_");if(!new RegExp(/^\.\^.*$/).test(r)&&r.includes("g-")){let n=r.split("g-");return Zs(e)+"_|_"+"g-"+n[n.length-1]}let t=0;for(;new RegExp(/^\.\^.*$/).test(r);)t++,r=r.substring(2);if(t=t-1,new RegExp(/^\..*$/).test(r)&&e){let n=r.substring(1);return Zs(e,t)+"_|_"+n.replaceAll(".","_|_")}return r.replaceAll(".","_|_")||Zs(e,t).replaceAll(".","_|_")}function Zs(r,e=0){let t=r.split("_|_");for(;t.length>1&&e>0;)t.pop()?.includes("g-")&&e--,e--;return t.join("_|_")}var Du="\xA7DOUBLE_SLASH_CONVERTOR\xA7";function ze(r){return r.startsWith("^")&&(r=r.substring(1)),r=r.replaceAll("\\\\",Du),r=r.replaceAll("\\n",`
67
67
  `),r=r.replaceAll("\\t"," "),r=r.replaceAll(" "," "),r=r.replaceAll(Du,"\\\\"),r}function ft(r,e,t,n){let{functions:i}=n;r=r.map(s=>{if(typeof s=="string")switch(s){case "rnd":return "RANDOM";case "?":return "CONTAINS"}return s});let a=[];return r.forEach(s=>{if(typeof s=="string")switch(s){case "&&":case "||":if(a.length>=2){let o={type:"union",unionType:s==="&&"?"and":"or",conditions:[a[a.length-2],a[a.length-1]]};a.pop(),a.pop(),a.push(o);}break;case "!":if(a.length===0)W.error("Error parsing ink file: Conditional statement is not valid",r);else {let o={type:"union",unionType:"not",condition:a[a.length-1]};a[a.length-1]=o;}break;case "!?":if(a.length>1){let o={type:"union",unionType:"not",condition:{type:"compare",operator:"CONTAINS",leftValue:a[a.length-2],rightValue:a[a.length-1]}};a.pop(),a.pop(),a.push(o);}else W.error("Error parsing ink file: Conditional statement is not valid",r);break;default:if(ou.includes(s))if(a.length<2)W.error("Error parsing ink file: Conditional statement is not valid",r);else {let o={type:"compare",operator:s,rightValue:a[a.length-1],leftValue:a[a.length-2]};a.pop(),a.pop(),a.push(o);}else if(Su.includes(s))if(a.length<2)W.error("Error parsing ink file: Conditional statement is not valid",r);else {s==="L^"&&(s="INTERSECTION");let o={type:"arithmetic",operator:s,rightValue:a[a.length-1],leftValue:a[a.length-2]};a.pop(),a.pop(),a.push(o);}else if(Eu.includes(s)){let o={type:"arithmeticsingle",operator:s,leftValue:a[a.length-1]};a.pop(),a.push(o);}else s.startsWith("^")&&a.push(ze(s));}else if(typeof s=="object"&&"CNT?"in s)if(new RegExp(/.*\.[0-9]\..*/).test(s["CNT?"])){let o=s["CNT?"].split("."),u=o.pop(),l=o.pop();if(l===void 0||u===void 0){W.error("Error parsing ink file: Conditional statement is not valid",r);return}let h=Number(l),c=o.join(".");if(c.includes("^.")){let f=c.split("."),m=f[f.length-1].replaceAll(".","_|_");f.pop(),c=`${f.join(".")}.${m}`,u.includes("c-")&&(c=c+"_|_"+u);}else c=c.replaceAll(".","_|_");let d=Jt(c,e);if(!d)return;a.push({type:"compare",leftValue:ea(d),operator:">=",rightValue:{type:"value",value:h}});}else {let o=Jt(s["CNT?"],e);if(!o)return;a.push(ea(o));}else if(typeof s=="object"&&"VAR?"in s)a.push(Pt({key:s["VAR?"],defaultType:"storage"},t));else if(typeof s=="object"&&"f()"in s){let o=s["f()"],u=i.find(h=>h.name===o);if(!u){W.error(`Error parsing ink file: Function ${o} is not defined`,r);return}let l=[];for(let h=0;h<u.args;h++)a.length!==0&&l.push(a.pop());a.push({type:"function",functionName:o,args:l.reverse()});}else if(typeof s=="object"&&"^->"in s)s["^->"].includes("$r")||a.push(s["^->"]);else if(typeof s=="object"&&"list"in s){let o=Object.values(s.list).map(u=>u);a.push(o);}else a.push(s);}),a}function ta(r,e,t,n){return ft(r,e,t,n)}function Pt(r,e,t){let{key:n,defaultType:i}=r,a=e.indexOf(n);return a>=0?{type:"value",storageType:"params",storageOperationType:"get",key:a}:{type:"value",storageOperationType:"get",storageType:i,key:n}}function An(r,e,t){let{key:n,value:i,defaultType:a,artmeticValue:s}=r,o=e.indexOf(n);if(o>=0)return [{type:"value",storageType:"params",storageOperationType:"set",key:o,value:i}];if(s){if(typeof i=="object"&&"list"in i){let u=Object.values(i.list).map(l=>l);return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:u}]}return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:i}]}else if(typeof i=="object"){if("list"in i&&typeof i.list=="object"){if("origins"in i&&Array.isArray(i.origins)&&i.origins.length>0)return i.origins.reduce(u=>(u.push({type:"value",storageOperationType:"set",storageType:a,key:n,value:Object.values(t.enums[n])}),Object.entries(t.enums[n]).forEach(([l,h])=>{u.push({type:"value",storageOperationType:"set",storageType:a,key:`${n}.${l}`,value:h});}),u),[]);{let u=new Set,l=Object.entries(i.list).reduce((h,[c,d])=>{let[f,m]=c.split(".");return h.push({type:"value",storageOperationType:"set",storageType:a,key:m,value:d}),u.add(f),h},[]);return u.forEach(h=>{l.push({type:"value",storageOperationType:"set",storageType:a,key:h,value:Object.values(t.enums[h])});}),n in t.enums?Object.entries(t.enums[n]).forEach(([h,c])=>{l.push({type:"value",storageOperationType:"set",storageType:a,key:`${n}.${h}`,value:c});}):l.push({type:"value",storageOperationType:"set",storageType:a,key:n,value:Object.values(i.list)}),l}}else if(typeof i=="object"&&"VAR?"in i){if(typeof i["VAR?"]=="string"&&i["VAR?"].includes(".")){let[u,l]=i["VAR?"].split(".");if(u in t.enums&&l in t.enums[u])return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:t.enums[u][l]}]}return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:Pt({key:i["VAR?"],defaultType:"storage"},e)}]}}return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:i}]}function ea(r){return {type:"value",storageType:"label",storageOperationType:"get",label:r}}function na(r,e){return e||new RegExp(`${"_|_".replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c-\\d+$`).test(r)?"call":"jump"}function Si(r,e){if(e){if(typeof e=="string")e.startsWith("^")&&r.push(ze(e));else if(typeof e=="object"&&"type"in e)switch(e.type){case "value":case "function":console.warn("Warning: trying to add a value or function operation as text. This is likely a mistake, so it will be ignored.");break;default:r.push(e);}}}function ia(r,e,t,n,i,a={}){let{isNewLine:s=true,isHashtagScript:o=false,isThreads:u=false}=a;return Bd(r,e,t,n,i,{isNewLine:s,isHashtagScript:o,isThreads:u})}function Bd(r,e,t,n,i,a){if(!e)return;let{isNewLine:s,isHashtagScript:o=false,isThreads:u}=a;if(o){if(Array.isArray(e)&&e.length>0){let l={goNextStep:true},h=[];try{if(e.length===1&&typeof e[0]=="string"&&!e[0].match(yu)){let c=e[0],d=O.convertTagTolist(c),f=O.convertOperation(d,l,{silent:!0});f&&(f.$origin=c,h.push(f));}}catch{}h.length===0&&h.push({type:"operationtoconvert",values:e}),r.push({...l,operations:h});}}else if(typeof e=="string"&&e.startsWith("^")||e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get"){if(!s&&r.length>0){let l=r[r.length-1];!l.glueEnabled&&!l.operations&&!l.labelToOpen&&(l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true)),r[r.length-1]=l;}typeof e=="string"?r.push(Wd(ze(e),n.characterIds)):r.push({dialogue:e});}else if(typeof e=="string"){if(e==="end")r.push({end:"game_end"});else if(e==="done")r.push({end:"label_end",goNextStep:true});else if(e==="<>")if(r.length>0){let l=r[r.length-1];l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true),r[r.length-1]=l;}else r.push({glueEnabled:true,goNextStep:false});}else if(typeof e=="object"){if("type"in e)switch(e.type){case "value":e.storageOperationType==="set"?(typeof e.value=="string"&&e.value.startsWith("^")&&(e.value=ze(e.value)),r.push({goNextStep:true,operations:[e]})):console.warn("Warning: trying to add a value get operation as step. This is likely a mistake, so it will be ignored.");break;case "function":r.push({goNextStep:true,operations:[e]});break;default:if(!s&&r.length>0){let l=r[r.length-1];!l.glueEnabled&&!l.operations&&(l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true)),r[r.length-1]=l;}r.push({conditionalStep:e});}else if("->"in e){let l=s?void 0:true;if(l&&t.includes("c-")&&r.length>0&&r[r.length-1]?.dialogue===void 0&&(l=void 0),!s&&r.length>0){let h=r[r.length-1];h.labelToOpen||(h.goNextStep=true),r[r.length-1]=h;}if(e.params&&e.params.length===0&&delete e.params,e.var)r.push({labelToOpen:{label:Pt({key:e["->"],defaultType:"storage"},i),type:u?"call":"jump",params:e.params},glueEnabled:l});else {let h=Jt(e["->"],t);if(!h)return;r.push({labelToOpen:{label:h,type:na(h,u),params:e.params},glueEnabled:l});}}else if("->t->"in e){let l=s?void 0:true;if(l&&t.includes("c-")&&r.length>0&&r[r.length-1]?.dialogue===void 0&&(l=void 0),!s&&r.length>0){let c=r[r.length-1];c.labelToOpen||(c.goNextStep=true),r[r.length-1]=c;}e.params&&e.params.length===0&&delete e.params;let h=Jt(e["->t->"],t);if(!h)return;r.push({labelToOpen:{label:h,type:"call",params:e.params},glueEnabled:l});}}}function Wd(r,e){let t;if(r.includes(": ")){let n=r.split(": "),i=n[0],a=n.slice(1).join(": ");(e?.has(i)||RegisteredCharacters.has(i))&&(t=i,r=a);}return t?{dialogue:{character:t,text:r}}:{dialogue:r}}function ra(r,e,t,n=true,i=false){return jd(r,e,t,n,i)}function jd(r,e,t,n,i=false){e&&(typeof e=="string"&&e.startsWith("^")||e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get"?typeof e=="string"?r.push(ze(e)):r.push(e):typeof e=="object"&&"type"in e&&r.push(e));}function Ei(r,e,t,n){if(r.length===0){W.error("Error parsing ink file: Arithmetic statement is not valid",r);return}let i=ft(r,e,t,n);if(i.length===1){let a=i[0];return a&&typeof a=="object"&&"type"in a?{type:"value",storageType:"logic",storageOperationType:"get",operation:a}:a}}function Ht(r,e,t,n="",i,a,s=void 0){let o=[],u="sequential",l=false,h=true;r.forEach(f=>{f==="%"&&(u="loop"),f==="seq"&&(u="random"),f==="MIN"&&(l=true);});let c=r[r.length-1];return Object.keys(c).forEach(f=>{let m=c[f];if(Array.isArray(m)&&m.length>3){m=m.slice(1,m.length-2);let g=[];mt(m,n,i,g,e,e,t,zt,s,true,a),g.length===1?o.push(g[0]):o.push({type:"resulttocombine",combine:"cross",secondConditionalItem:g});}else Array.isArray(m)&&m.length===3&&(h=false);}),u==="sequential"?{type:"stepswitch",elements:o,choiceType:u,end:h?"lastItem":void 0,nestedId:s}:l&&u==="random"?{type:"stepswitch",elements:o,choiceType:"sequentialrandom",end:h?"lastItem":void 0,nestedId:s}:{type:"stepswitch",elements:o,choiceType:u}}function mt(r,e,t,n=[],i,a,s,o,u=void 0,l=true,h=[]){let c=false,d=[],f=false,m=false,g=false,b=[],S=[];if(t.preDialog[e]&&(l=false,i(n,`^${t.preDialog[e].text}`,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),t.preDialog[e].glue&&i(n,"<>",e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),delete t.preDialog[e]),r.includes("visit")){let p=Ht(r,a,s,e,t,h,u);p&&(!l&&n.length>0&&i(n,"<>",e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}));return}let y=r[0];if(y&&typeof y=="object"&&"temp="in y){for(;r[0]&&typeof r[0]=="object"&&"temp="in r[0];)h.push(r[0]["temp="]),r.shift();h=h.reverse();}if(r.forEach((p,D)=>{if(m){if(typeof p=="string"&&p==="/#"){let C=[];mt(S,e,t,C,ra,ra,s,o,u,l),i(n,C,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),m=false,S=[];}else S.push(p);return}else if(c)if(Array.isArray(p))d.push(p);else if(p&&typeof p=="object")"CNT?"in p?D>0&&r[D-1]==="ev"?(f=true,b.push(p)):f?b.push(p):(d.push(p),l=false):"VAR="in p||"temp="in p?An({key:"VAR="in p?p["VAR="]:p["temp="],value:r[D-1],defaultType:"VAR="in p?"storage":"tempstorage"},h,t).forEach(E=>{if(E.value&&typeof E.value=="string"&&E.value==="/str"&&(E.value=r[D-2]),E.value&&typeof E.value=="object"&&"^->"in E.value&&(E.value=E.value["^->"]),d.length>1){let x=Ei(d,e,h,t);d=[],x&&typeof x=="object"&&"type"in x&&x.type==="value"&&"storageType"in x&&x.storageType==="logic"&&(E.value=x.operation);}(typeof E.key!="string"||!E.key.includes("$r"))&&(i(n,E,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=true);}):"VAR?"in p?d.push(p):"^->"in p?p["^->"].includes("$r")||d.push(p):("f()"in p||"list"in p&&typeof p.list=="object")&&d.push(p);else switch(p){case "/ev":f&&b.push(p),c=false,d.push(p);break;case "out":if(d.length>0){let C=d[d.length-1];if(C&&typeof C=="object"&&"VAR?"in C){d.pop();let E=Pt({key:C["VAR?"],defaultType:"storage"},h);i(n,E,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g});}else {let E=[];for(;d.length>0&&d[d.length-1]!=="/ev";)E.push(d.pop());E=E.reverse();let x=Ei(E,e,h,t);d=[],x&&typeof x=="object"&&"type"in x&&x.type==="value"&&"storageType"in x&&x.storageType==="logic"?i(n,{storageOperationType:"get",storageType:"logic",operation:x.operation,type:"value"},e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}):(i(n,"<>",e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),x=`^${x}`,i(n,x,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}));}l=false;}break;case "pop":{let C=d[d.length-1];if(C&&typeof C=="object"&&"f()"in C){let E=[];for(;d.length>0&&d[d.length-1]!=="/ev";)E.push(d.pop());E=E.reverse();let x=ft(E,e,h,t);d=[],x.forEach(P=>{P&&typeof P=="object"&&"type"in P&&P.type==="function"?i(n,P,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}):W.warn("Unhandled case: value is not a function",P);}),l=false;}else d.push(p);return}default:d.push(p);}else if(typeof p=="string")if(p.startsWith("^"))i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="ev")c=true;else if(p===`
68
- `)l=true;else if(p==="done"||p==="end")i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="<>")i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="nop"&&f){let C=bu(b,a,s,e,t,h,u);C&&i(n,C,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),f=false,b=[];}else p==="#"?m=true:p==="thread"&&(g=true);else if(Array.isArray(p))if(f)b.push(p);else if(p.length>1&&typeof p[p.length-2]=="object"&&p[p.length-2]&&"c"in p[p.length-2]&&typeof p[p.length-1]=="object"&&p[p.length-1]&&"b"in p[p.length-1]){d.pop();let C=[],E=[];for(;d.length>0&&d[d.length-1]!=="/ev";)C.push(d.pop());b=[...b,...C.reverse()],f=true,E.push(p.pop()),E.push(p.pop()),b=[...b,...p],b.push(E);}else if(p.length>1&&typeof p[p.length-1]=="object"&&p[p.length-1]&&"#n"in p[p.length-1]){let C=p.pop();if(!C){W.error("Error parsing ink file: el is undefined");return}let E=C["#n"];delete C["#n"],p.push(C),i(n,{"->":e?e+"_|_"+E:E},e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),s({[E]:p},e,t);}else mt(p,e,t,n,i,a,s,o,u,l,h);else if(p&&typeof p=="object")if("->"in p&&typeof p["->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(p["->"])){let C=[];d.length>0&&(C=ta(["ev",...d],e,h,t)),p.params=C,i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;}else if("->t->"in p&&typeof p["->t->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(p["->t->"])){let C=[];d.length>0&&(C=ta(["ev",...d],e,h,t)),p.params=C,i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;}else if("*"in p&&typeof p["*"]=="string")p["*"].includes("c")&&(d.push(p),l=false);else if("s"in p&&Array.isArray(p.s))d.push(p),l=false;else if("CNT?"in p)d.push(p),l=false;else if("VAR="in p||"temp="in p){let C="VAR="in p?p["VAR="]:p["temp="],E,x=[];if(C!=="$r"){for(d.pop(),d[d.length-1]==="/ev"&&d.pop();d.length>0&&d[d.length-1]!=="/ev";)x.push(d.pop());x=x.reverse(),E=Ei(x,e,h,t),d=[],An({key:C,value:E,defaultType:"VAR="in p?"storage":"tempstorage",artmeticValue:true},h,t).forEach(N=>{(N.value!==void 0||N.value!==null)&&i(n,N,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g});}),l=false;}}else s(p,e,t);}),o(d,n,e,t,h),e.includes("_|_")&&n.length===2){let p=n[0],D=n[1];p&&D&&typeof p=="object"&&"dialogue"in p&&typeof D=="object"&&"labelToOpen"in D&&p.dialogue===" "&&D.labelToOpen&&(n.shift(),delete D.glueEnabled,n[0]=D);}}function aa(r,e,t,n,i,a){if(e.length===0)return;let s=ft(e,n,t,i);if(s.length===1){let o={type:"ifelse",condition:s[0],then:r,else:a};return o.else||delete o.else,o}else if(s.length>1){let o={type:"ifelse",condition:{type:"union",unionType:"and",conditions:s},then:r,else:a};return o.else||delete o.else,o}}function bu(r,e,t,n,i,a,s=void 0){if(r.length===0){W.error("Error parsing ink file: Conditional statement is not valid",r);return}let o=[],u=[];if(r.forEach(c=>{Array.isArray(c)?u.push(c):typeof c=="string"&&c==="du"?i.du?o.push(i.du):i.du=o[o.length-1]:(typeof c!="string"||c!=="/ev")&&o.push(c);}),u.length===0){W.error("Error parsing ink file: Conditional statement is not valid",u);return}let l=sa(u[0],e,t,`${n}${"_|_"}then`,i,a,`${s||""}then`),h;return u.length===2?h=sa(u[1],e,t,`${n}${"_|_"}else`,i,a,`${s||""}else`):u.length>2?(u.shift(),u.push("nop"),u=[{b:u}],h=sa(u,e,t,`${n}${"_|_"}else`,i,a,`${s||""}else`)):h=void 0,i.du=void 0,aa(l,o,a,n,i,h)}function sa(r,e,t,n,i,a,s=void 0){let o=[];for(let l of r)typeof l=="object"&&"b"in l&&(l.b=l.b.filter(h=>h!==null&&!(typeof h=="object"&&"->"in h&&new RegExp(/.*\.[0-9]/).test(h["->"]))),mt(l.b,n,i,o,e,e,t,zt,s,true,a));return o.length===1?o[0]:{type:"resulttocombine",combine:"cross",secondConditionalItem:o}}function oa(r="",e=""){let t=Array.isArray(r)?r:[r],n=Array.isArray(e)?e:[e];return [...new Set([...t,...n])]}function zt(r,e,t,n,i){if(r.length>0){let a={};Au(r,a,i,n);for(let[s,o]of Object.entries(a)){let u=t+"_|_"+s,l={text:o.text.length===1?o.text[0]:o.text,label:u,props:{},type:na(u,false),oneTime:o.onetime};o.text.length===0&&(l.onlyHaveNoChoice=true,l.autoSelect=true),l.oneTime===false&&delete l.oneTime;let h=aa(l,o.conditions,i,t,n)||l,c=e[e.length-1];if(typeof c=="object"&&c&&"type"in c&&(c={conditionalStep:c}),e.length>0&&typeof c=="object"&&c&&"choices"in c&&c.choices){let d=c.choices;d&&Array.isArray(d)?d.push(h):W.error("Unhandled case: choices is PixiVNJsonConditionalStatements<PixiVNJsonChoices> | undefined",o,d),c.choices=d.sort((f,m)=>{try{let g=f.label.split("."),b=g[g.length-1].replaceAll(".","_|_"),S=m.label.split("."),y=S[S.length-1].replaceAll(".","_|_");if(b.includes("c-")&&y.includes("c-")){let p=b.split("c-")[1],D=Number(p),C=y.split("c-")[1],E=Number(C);return D-E}}catch{}return 0});}else e.push({choices:[h]});o.preDialog&&(n.preDialog[u]={...o.preDialog});}}}function Au(r,e,t,n,i){let a=[],s="",o="",u=false,l=[];for(let h=0;h<r.length;h++){let c=r[h];if(typeof c=="string")c.startsWith("^")?a.push(ze(c)):vu.includes(c)&&l.push(c);else if(Array.isArray(c)&&c.includes("visit")){let d=Ht(c,Si,(f,m,g)=>{},i,n,t);a.push(d);}else if(c&&typeof c=="object")if("*"in c&&typeof c["*"]&&typeof c["*"]=="string")c["*"].includes("c")&&(s=`c${c["*"].split("c")[1]}`,c.flg&16&&(u=true));else if("s"in c&&Array.isArray(c.s)){let d=wu(c.s),f=c.s.includes("<>");d&&(i&&e[i]?(e[i].preDialog={text:d,glue:f},e[i].text=oa(d,e[i].text)):(a.push(d),o=d));}else ("CNT?"in c||"VAR?"in c)&&l.push(c);else l.push(c);if(s){e[s]?e[s].text=oa(a,e[s].text):e[s]={text:a,onetime:u,conditions:l},o&&(e[s].preDialog={text:o,glue:false});let d=r.slice(h+1);Au(d,e,t,n,s);return}}}function wu(r){for(let e of r)if(typeof e=="string"){if(e.startsWith("^"))return ze(e)}else if(Array.isArray(e)){let t=wu(e);if(t)return t}}var la;(i=>{function r(a,s={}){let{labelToRemove:o=[],initialVarsToRemove:u=[],enums:l={},functions:h=[],preDialog:c={},characterIds:d}=s,f={$schema:au};if(f.labels=e(a.root,{labelToRemove:o,initialVarsToRemove:u,enums:l,functions:h,preDialog:c,characterIds:d}),f.labels&&vi in f.labels){let m=f.labels[vi];delete f.labels[vi],m.forEach(g=>{g.operations&&(f.initialOperations=f.initialOperations?[...f.initialOperations,...g.operations]:[...g.operations]);});}if(f.labels&&Tt in f.labels){let m=f.labels[Tt];delete f.labels[Tt],m.forEach(g=>{g.operations&&(f.initialOperations=f.initialOperations?[...f.initialOperations,...g.operations]:[...g.operations]);});}return o.forEach(m=>{f.labels&&m in f.labels&&delete f.labels[m];}),u.forEach(m=>{f.initialOperations&&(f.initialOperations=f.initialOperations.filter(g=>!(g.type==="value"&&g.key===m)));}),f}i.inkToJson=r;function e(a,s){try{let o={};return t(a,o,s),o}catch(o){W.error("Error parsing ink file",o);}}function t(a,s,o){for(let u of a)if(u)if(Array.isArray(u))if(u.includes("visit")){let l=Ht(u,Si,(h,c,d)=>{},"",o,[]);l&&(o.externalSwitch=l);}else t(u,s,o);else typeof u=="object"&&(u&&"VAR="in u&&o.externalSwitch&&(s[Tt]||(s[Tt]=[]),s[Tt].push({operations:An({defaultType:"storage",key:u["VAR="],value:o.externalSwitch},[],o)})),n(u,s,"",o));}function n(a,s,o="",u){if(a!==null){for(let[l,h]of Object.entries(a))if(Array.isArray(h)){let c=[],d={},f=(o?o+"_|_":"")+l;mt(h,f,u,c,ia,ia,(m,g,b)=>{n(m,d,g,b);},zt);for(let[m,g]of Object.entries(d))s[m]=g;c.length>0&&(s[f]=c);}}}})(la||={});var Sc=Js(yc(),1),Ec=Js(Ut(),1),FC=/(?:^|<>)\s*#\s*([^\r\n]+)/g,NC=/^=+[ \t]+(?:function[ \t]+)?(\w+)/gm,IC=new Set(["DONE","END"]),VC="_|_",vc=new Map;function Dc(r,e){let t=JSON.stringify([e,r]),n=vc.get(t);if(n)return n;let i=new RegExp(r,e);return vc.set(t,i),i}function ui(r,e){if(!e||typeof e!="object")return false;let t=e,n=t.anyOf;if(Array.isArray(n))return n.some(s=>ui(r,s));let i=t.oneOf;if(Array.isArray(i))return i.some(s=>ui(r,s));let a=t.allOf;if(Array.isArray(a))return a.every(s=>ui(r,s));if(typeof t.const=="string")return r===t.const;if(Array.isArray(t.enum))return t.enum.some(s=>typeof s=="string"&&s===r);if(t.type!=="string"||typeof t.minLength=="number"&&r.length<t.minLength||typeof t.maxLength=="number"&&r.length>t.maxLength)return false;if(typeof t.pattern=="string")try{if(!Dc(t.pattern,"").test(r))return !1}catch{return false}return true}function $s(r,e){if(!e||typeof e!="object")return false;let t=e,n=t.anyOf;if(Array.isArray(n))return n.some(o=>$s(r,o));let i=t.oneOf;if(Array.isArray(i))return i.some(o=>$s(r,o));let a=t.allOf;if(Array.isArray(a))return a.every(o=>$s(r,o));if(t.type!=="array"||typeof t.minItems=="number"&&r.length<t.minItems||typeof t.maxItems=="number"&&r.length>t.maxItems)return false;let s=Array.isArray(t.prefixItems)?t.prefixItems:[];if(r.length<s.length)return false;for(let o=0;o<s.length;o++)if(!ui(r[o],s[o]))return false;return r.length===s.length?true:t.items===false||typeof t.items>"u"?false:t.items===true?true:r.slice(s.length).every(o=>ui(o,t.items))}function kC(r,e){if(e.type==="regexp")try{let t=Dc(e.source,e.flags);return t.lastIndex=0,t.test(r.join(" "))}catch{return false}return e.type==="literal"?r.join(" ")===e.value:$s(r,e.schema)}function RC(r){let e=r.split(/\r?\n/),t=[];for(let n=0;n<e.length;n++){let i=e[n];for(let a of i.matchAll(FC)){let s=(a[1]??"").trim();if(!s)continue;let o=O.convertTagTolist(s,{mergeInkVariables:true});o.length!==0&&t.push({line:n+1,command:s,tokens:o});}}return t}var Pl;(i=>{function r(a,s={labelToRemove:[],initialVarsToRemove:[],functions:[],enums:{}}){let o=[];try{return {json:new Sc.Compiler(a,{errorHandler:(c,d)=>{let f=c.replace(/^[A-Z]+: line \d+: ?/,""),m=c.match(/line (\d+)/);o.push({message:f,type:d,line:m?Number(m[1]):-1});},countAllVisits:!0,fileHandler:{ResolveInkFilename:c=>c,LoadInkFileContents:()=>""},pluginNames:[],sourceFilename:null}).Compile().ToJson()||"",issues:o}}catch{let l=false,h={...s,textSource:a};return e(o,()=>{l=true;},h),l?r(h.textSource,s):{issues:o}}}i.compile=r;function e(a,s,o){let{functions:u,initialVarsToRemove:l,labelToRemove:h}=o,c=a.find(d=>d.type===Ec.ErrorType.Error);if(c){if(c.message.includes("Divert target not found")){let d=c.message.match(/Divert target not found: '-> (\w+)'/);if(d?.[1]){let f=d[1],m=`
68
+ `)l=true;else if(p==="done"||p==="end")i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="<>")i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="nop"&&f){let C=bu(b,a,s,e,t,h,u);C&&i(n,C,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),f=false,b=[];}else p==="#"?m=true:p==="thread"&&(g=true);else if(Array.isArray(p))if(f)b.push(p);else if(p.length>1&&typeof p[p.length-2]=="object"&&p[p.length-2]&&"c"in p[p.length-2]&&typeof p[p.length-1]=="object"&&p[p.length-1]&&"b"in p[p.length-1]){d.pop();let C=[],E=[];for(;d.length>0&&d[d.length-1]!=="/ev";)C.push(d.pop());b=[...b,...C.reverse()],f=true,E.push(p.pop()),E.push(p.pop()),b=[...b,...p],b.push(E);}else if(p.length>1&&typeof p[p.length-1]=="object"&&p[p.length-1]&&"#n"in p[p.length-1]){let C=p.pop();if(!C){W.error("Error parsing ink file: el is undefined");return}let E=C["#n"];delete C["#n"],p.push(C),i(n,{"->":e?e+"_|_"+E:E},e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),s({[E]:p},e,t);}else mt(p,e,t,n,i,a,s,o,u,l,h);else if(p&&typeof p=="object")if("->"in p&&typeof p["->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(p["->"])){let C=[];d.length>0&&(C=ta(["ev",...d],e,h,t)),p.params=C,i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;}else if("->t->"in p&&typeof p["->t->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(p["->t->"])){let C=[];d.length>0&&(C=ta(["ev",...d],e,h,t)),p.params=C,i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;}else if("*"in p&&typeof p["*"]=="string")p["*"].includes("c")&&(d.push(p),l=false);else if("s"in p&&Array.isArray(p.s))d.push(p),l=false;else if("CNT?"in p)d.push(p),l=false;else if("VAR="in p||"temp="in p){let C="VAR="in p?p["VAR="]:p["temp="],E,x=[];if(C!=="$r"){for(d.pop(),d[d.length-1]==="/ev"&&d.pop();d.length>0&&d[d.length-1]!=="/ev";)x.push(d.pop());x=x.reverse(),E=Ei(x,e,h,t),d=[],An({key:C,value:E,defaultType:"VAR="in p?"storage":"tempstorage",artmeticValue:true},h,t).forEach(N=>{(N.value!==void 0||N.value!==null)&&i(n,N,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g});}),l=false;}}else s(p,e,t);}),o(d,n,e,t,h),e.includes("_|_")&&n.length===2){let p=n[0],D=n[1];p&&D&&typeof p=="object"&&"dialogue"in p&&typeof D=="object"&&"labelToOpen"in D&&p.dialogue===" "&&D.labelToOpen&&(n.shift(),delete D.glueEnabled,n[0]=D);}}function aa(r,e,t,n,i,a){if(e.length===0)return;let s=ft(e,n,t,i);if(s.length===1){let o={type:"ifelse",condition:s[0],then:r,else:a};return o.else||delete o.else,o}else if(s.length>1){let o={type:"ifelse",condition:{type:"union",unionType:"and",conditions:s},then:r,else:a};return o.else||delete o.else,o}}function bu(r,e,t,n,i,a,s=void 0){if(r.length===0){W.error("Error parsing ink file: Conditional statement is not valid",r);return}let o=[],u=[];if(r.forEach(c=>{Array.isArray(c)?u.push(c):typeof c=="string"&&c==="du"?i.du?o.push(i.du):i.du=o[o.length-1]:(typeof c!="string"||c!=="/ev")&&o.push(c);}),u.length===0){W.error("Error parsing ink file: Conditional statement is not valid",u);return}let l=sa(u[0],e,t,`${n}${"_|_"}then`,i,a,`${s||""}then`),h;return u.length===2?h=sa(u[1],e,t,`${n}${"_|_"}else`,i,a,`${s||""}else`):u.length>2?(u.shift(),u.push("nop"),u=[{b:u}],h=sa(u,e,t,n,i,a,`${s||""}else`)):h=void 0,i.du=void 0,aa(l,o,a,n,i,h)}function sa(r,e,t,n,i,a,s=void 0){let o=[];for(let l of r)typeof l=="object"&&"b"in l&&(l.b=l.b.filter(h=>h!==null&&!(typeof h=="object"&&"->"in h&&new RegExp(/.*\.[0-9]/).test(h["->"]))),mt(l.b,n,i,o,e,e,t,zt,s,true,a));return o.length===1?o[0]:{type:"resulttocombine",combine:"cross",secondConditionalItem:o}}function oa(r="",e=""){let t=Array.isArray(r)?r:[r],n=Array.isArray(e)?e:[e];return [...new Set([...t,...n])]}function zt(r,e,t,n,i){if(r.length>0){let a={};Au(r,a,i,n);for(let[s,o]of Object.entries(a)){let u=t+"_|_"+s,l={text:o.text.length===1?o.text[0]:o.text,label:u,props:{},type:na(u,false),oneTime:o.onetime};o.text.length===0&&(l.onlyHaveNoChoice=true,l.autoSelect=true),l.oneTime===false&&delete l.oneTime;let h=aa(l,o.conditions,i,t,n)||l,c=e[e.length-1];if(typeof c=="object"&&c&&"type"in c&&(c={conditionalStep:c}),e.length>0&&typeof c=="object"&&c&&"choices"in c&&c.choices){let d=c.choices;d&&Array.isArray(d)?d.push(h):W.error("Unhandled case: choices is PixiVNJsonConditionalStatements<PixiVNJsonChoices> | undefined",o,d),c.choices=d.sort((f,m)=>{try{let g=f.label.split("."),b=g[g.length-1].replaceAll(".","_|_"),S=m.label.split("."),y=S[S.length-1].replaceAll(".","_|_");if(b.includes("c-")&&y.includes("c-")){let p=b.split("c-")[1],D=Number(p),C=y.split("c-")[1],E=Number(C);return D-E}}catch{}return 0});}else e.push({choices:[h]});o.preDialog&&(n.preDialog[u]={...o.preDialog});}}}function Au(r,e,t,n,i){let a=[],s="",o="",u=false,l=[];for(let h=0;h<r.length;h++){let c=r[h];if(typeof c=="string")c.startsWith("^")?a.push(ze(c)):vu.includes(c)&&l.push(c);else if(Array.isArray(c)&&c.includes("visit")){let d=Ht(c,Si,(f,m,g)=>{},i,n,t);a.push(d);}else if(c&&typeof c=="object")if("*"in c&&typeof c["*"]&&typeof c["*"]=="string")c["*"].includes("c")&&(s=`c${c["*"].split("c")[1]}`,c.flg&16&&(u=true));else if("s"in c&&Array.isArray(c.s)){let d=wu(c.s),f=c.s.includes("<>");d&&(i&&e[i]?(e[i].preDialog={text:d,glue:f},e[i].text=oa(d,e[i].text)):(a.push(d),o=d));}else ("CNT?"in c||"VAR?"in c)&&l.push(c);else l.push(c);if(s){e[s]?e[s].text=oa(a,e[s].text):e[s]={text:a,onetime:u,conditions:l},o&&(e[s].preDialog={text:o,glue:false});let d=r.slice(h+1);Au(d,e,t,n,s);return}}}function wu(r){for(let e of r)if(typeof e=="string"){if(e.startsWith("^"))return ze(e)}else if(Array.isArray(e)){let t=wu(e);if(t)return t}}var la;(i=>{function r(a,s={}){let{labelToRemove:o=[],initialVarsToRemove:u=[],enums:l={},functions:h=[],preDialog:c={},characterIds:d}=s,f={$schema:au};if(f.labels=e(a.root,{labelToRemove:o,initialVarsToRemove:u,enums:l,functions:h,preDialog:c,characterIds:d}),f.labels&&vi in f.labels){let m=f.labels[vi];delete f.labels[vi],m.forEach(g=>{g.operations&&(f.initialOperations=f.initialOperations?[...f.initialOperations,...g.operations]:[...g.operations]);});}if(f.labels&&Tt in f.labels){let m=f.labels[Tt];delete f.labels[Tt],m.forEach(g=>{g.operations&&(f.initialOperations=f.initialOperations?[...f.initialOperations,...g.operations]:[...g.operations]);});}return o.forEach(m=>{f.labels&&m in f.labels&&delete f.labels[m];}),u.forEach(m=>{f.initialOperations&&(f.initialOperations=f.initialOperations.filter(g=>!(g.type==="value"&&g.key===m)));}),f}i.inkToJson=r;function e(a,s){try{let o={};return t(a,o,s),o}catch(o){W.error("Error parsing ink file",o);}}function t(a,s,o){for(let u of a)if(u)if(Array.isArray(u))if(u.includes("visit")){let l=Ht(u,Si,(h,c,d)=>{},"",o,[]);l&&(o.externalSwitch=l);}else t(u,s,o);else typeof u=="object"&&(u&&"VAR="in u&&o.externalSwitch&&(s[Tt]||(s[Tt]=[]),s[Tt].push({operations:An({defaultType:"storage",key:u["VAR="],value:o.externalSwitch},[],o)})),n(u,s,"",o));}function n(a,s,o="",u){if(a!==null){for(let[l,h]of Object.entries(a))if(Array.isArray(h)){let c=[],d={},f=(o?o+"_|_":"")+l;mt(h,f,u,c,ia,ia,(m,g,b)=>{n(m,d,g,b);},zt);for(let[m,g]of Object.entries(d))s[m]=g;c.length>0&&(s[f]=c);}}}})(la||={});var Sc=Js(yc(),1),Ec=Js(Ut(),1),FC=/(?:^|<>)\s*#\s*([^\r\n]+)/g,NC=/^=+[ \t]+(?:function[ \t]+)?(\w+)/gm,IC=new Set(["DONE","END"]),VC="_|_",vc=new Map;function Dc(r,e){let t=JSON.stringify([e,r]),n=vc.get(t);if(n)return n;let i=new RegExp(r,e);return vc.set(t,i),i}function ui(r,e){if(!e||typeof e!="object")return false;let t=e,n=t.anyOf;if(Array.isArray(n))return n.some(s=>ui(r,s));let i=t.oneOf;if(Array.isArray(i))return i.some(s=>ui(r,s));let a=t.allOf;if(Array.isArray(a))return a.every(s=>ui(r,s));if(typeof t.const=="string")return r===t.const;if(Array.isArray(t.enum))return t.enum.some(s=>typeof s=="string"&&s===r);if(t.type!=="string"||typeof t.minLength=="number"&&r.length<t.minLength||typeof t.maxLength=="number"&&r.length>t.maxLength)return false;if(typeof t.pattern=="string")try{if(!Dc(t.pattern,"").test(r))return !1}catch{return false}return true}function $s(r,e){if(!e||typeof e!="object")return false;let t=e,n=t.anyOf;if(Array.isArray(n))return n.some(o=>$s(r,o));let i=t.oneOf;if(Array.isArray(i))return i.some(o=>$s(r,o));let a=t.allOf;if(Array.isArray(a))return a.every(o=>$s(r,o));if(t.type!=="array"||typeof t.minItems=="number"&&r.length<t.minItems||typeof t.maxItems=="number"&&r.length>t.maxItems)return false;let s=Array.isArray(t.prefixItems)?t.prefixItems:[];if(r.length<s.length)return false;for(let o=0;o<s.length;o++)if(!ui(r[o],s[o]))return false;return r.length===s.length?true:t.items===false||typeof t.items>"u"?false:t.items===true?true:r.slice(s.length).every(o=>ui(o,t.items))}function kC(r,e){if(e.type==="regexp")try{let t=Dc(e.source,e.flags);return t.lastIndex=0,t.test(r.join(" "))}catch{return false}return e.type==="literal"?r.join(" ")===e.value:$s(r,e.schema)}function RC(r){let e=r.split(/\r?\n/),t=[];for(let n=0;n<e.length;n++){let i=e[n];for(let a of i.matchAll(FC)){let s=(a[1]??"").trim();if(!s)continue;let o=O.convertTagTolist(s,{mergeInkVariables:true});o.length!==0&&t.push({line:n+1,command:s,tokens:o});}}return t}var Pl;(i=>{function r(a,s={labelToRemove:[],initialVarsToRemove:[],functions:[],enums:{}}){let o=[];try{return {json:new Sc.Compiler(a,{errorHandler:(c,d)=>{let f=c.replace(/^[A-Z]+: line \d+: ?/,""),m=c.match(/line (\d+)/);o.push({message:f,type:d,line:m?Number(m[1]):-1});},countAllVisits:!0,fileHandler:{ResolveInkFilename:c=>c,LoadInkFileContents:()=>""},pluginNames:[],sourceFilename:null}).Compile().ToJson()||"",issues:o}}catch{let l=false,h={...s,textSource:a};return e(o,()=>{l=true;},h),l?r(h.textSource,s):{issues:o}}}i.compile=r;function e(a,s,o){let{functions:u,initialVarsToRemove:l,labelToRemove:h}=o,c=a.find(d=>d.type===Ec.ErrorType.Error);if(c){if(c.message.includes("Divert target not found")){let d=c.message.match(/Divert target not found: '-> (\w+)'/);if(d?.[1]){let f=d[1],m=`
69
69
 
70
70
  === ${f} ===
71
71
 
@@ -1 +1 @@
1
- import {g,n,f as f$1,i}from'./chunk-LJ7DXYK6.mjs';async function f(r,s={}){Array.isArray(r)||(r=[r]),g();let p={functions:[],enums:{},characters:s.characters},m=r.map(async a=>{let n$1=n(a,p);return n$1&&await f$1(n$1,{operationStringConvert:i.run,skipEmptyDialogs:true}),a});return await Promise.all(m)}async function h(r){return g(),await f$1(r,{operationStringConvert:i.run,skipEmptyDialogs:true})}export{f as a,h as b};
1
+ import {g,n,f as f$1,i}from'./chunk-54QJQIS3.mjs';async function f(r,s={}){Array.isArray(r)||(r=[r]),g();let p={functions:[],enums:{},characters:s.characters},m=r.map(async a=>{let n$1=n(a,p);return n$1&&await f$1(n$1,{operationStringConvert:i.run,skipEmptyDialogs:true}),a});return await Promise.all(m)}async function h(r){return g(),await f$1(r,{operationStringConvert:i.run,skipEmptyDialogs:true})}export{f as a,h as b};