@drincs/pixi-vn-ink 0.10.2 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-4UZ2R64L.mjs +18 -0
- package/dist/index.cjs +52 -39
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/vite-listener.cjs +52 -39
- package/dist/vite-listener.mjs +1 -1
- package/package.json +9 -4
- package/dist/chunk-46QHQPLY.mjs +0 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {a,c,b as b$1,e,d,f as f$1}from'./chunk-GMXDYDC6.mjs';import {RegisteredLabels,narration,LabelAbstract,NarrationManagerStatic}from'@drincs/pixi-vn/narration';import {storage,SYSTEM_RESERVED_STORAGE_KEYS}from'@drincs/pixi-vn/storage';import {canvas,VideoSprite,showVideo,ZoomTicker,RotateTicker,MoveTicker,FadeAlphaTicker,sound,Assets,narration as narration$1,Text,showText,ImageSprite,showImage,ImageContainer,showImageContainer,shakeEffect,pushOut,zoomOut,moveOut,removeWithDissolve,removeWithFade,pushIn,zoomIn,moveIn,showWithDissolve,showWithFade}from'@drincs/pixi-vn';import {RegisteredCharacters}from'@drincs/pixi-vn/characters';var jt=Object.defineProperty,_t=(t,e,r)=>e in t?jt(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r,M=(t,e,r)=>_t(t,typeof e!="symbol"?e+"":e,r),I;(t=>(t.log=(e,...r)=>console.log(`[Pixi\u2019VN Json] ${e}`,...r),t.warn=(e,...r)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...r),t.error=(e,...r)=>console.error(`[Pixi\u2019VN Json] ${e}`,...r),t.info=(e,...r)=>console.info(`[Pixi\u2019VN Json] ${e}`,...r)))(I||(I={}));var z=class O{static init(e){O._loadAssets=e.loadAssets,O._soundOperation=e.soundOperation,O._imageOperation=e.imageOperation,O._videoOperation=e.videoOperation,O._imageContainerOperation=e.imageContainerOperation,O._textOperation=e.textOperation,O._canvasElementOperation=e.canvasElementOperation,O._setStorageValue=e.setStorageValue,O._narrationOperation=e.narrationOperation,O._tickerOperation=e.tickerOperation,O._effectOperation=e.effectOperation,O._animateOperation=e.animateOperation,O._getLogichValue=e.getLogichValue,O._getConditionalStep=e.getConditionalStep;}static get loadAssets(){return O._loadAssets}static get soundOperation(){return O._soundOperation}static get imageOperation(){return O._imageOperation}static get videoOperation(){return O._videoOperation}static get textOperation(){return O._textOperation}static get imageContainerOperation(){return O._imageContainerOperation}static get canvasElementOperation(){return O._canvasElementOperation}static get setStorageValue(){return O._setStorageValue}static get narrationOperation(){return O._narrationOperation}static get tickerOperation(){return O._tickerOperation}static get effectOperation(){return O._effectOperation}static get animateOperation(){return O._animateOperation}static get getLogichValue(){return O._getLogichValue}static get getConditionalStep(){return O._getConditionalStep}};M(z,"_loadAssets",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_soundOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_imageOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_videoOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_imageContainerOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_textOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_canvasElementOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_setStorageValue",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_narrationOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_tickerOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_effectOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_animateOperation",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_getLogichValue",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),M(z,"_getConditionalStep",()=>{throw I.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new Error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")});var v=z;var It=Object.defineProperty,$t=(t,e,r)=>e in t?It(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r,Je=(t,e,r)=>$t(t,typeof e!="symbol"?e+"":e,r);function zt(t){let e="";return t.values.forEach(r=>{if(typeof r=="string")e+=r;else {let u=v.getLogichValue(r);e+=`${u}`;}}),e}var Fe=class B{static t(e){return Array.isArray(e)?e.map(r=>B.translate(`${r}`)):B.translate(`${e}`)}static set beforeToTranslate(e){B._beforeToTranslate=e;}static set translate(e){B._translate=e;}static get translate(){return e=>{let r=e;return B._beforeToTranslate&&(r=B._beforeToTranslate(r)),r=B._translate(r),B._afterToTranslate&&(r=B._afterToTranslate(r)),r}}static set afterToTranslate(e){B._afterToTranslate=e;}static addKey(e,r,u){let n=u.defaultValue||"empty_string";typeof r=="string"&&(r=[r]),Array.isArray(r)&&r.forEach(i=>{e[i]===void 0&&(n==="empty_string"?e[i]="":n==="copy_key"&&(B._beforeToTranslate?e[i]=B._beforeToTranslate(i):e[i]=i));});}static getConditionalsThenElse(e,r=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&B.getConditionalsThenElse(e.then,r),e.else&&B.getConditionalsThenElse(e.else,r);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(u=>{B.getConditionalsThenElse(u,r);});else if(e.elements.type==="ifelse"){let u=[];B.getConditionalsThenElse(e.elements,u),u.forEach(n=>{r.push(...n);});}else if(e.elements.type==="stepswitch"){let u=[];B.getConditionalsThenElse(e.elements,u),u.forEach(n=>{r.push(...n);});}else B.getConditionalsThenElse(e.elements,r);}else e.type==="resulttocombine"?(e.firstItem&&B.getConditionalsThenElse(e.firstItem,r),e.secondConditionalItem&&e.secondConditionalItem.forEach(u=>{B.getConditionalsThenElse(u,r);})):r.push(e);else e&&r.push(e);return r}static async generateJsonTranslation(e,r={},u={}){let{defaultValue:n="copy_key",operationStringConvert:i}=u,p=e.map(async g=>{if(g.choices){let l=[];Array.isArray(g.choices)?l=[g.choices]:l=B.getConditionalsThenElse(g.choices),l.forEach(s=>s.forEach(a=>{if("type"in a){let A=[];a.type==="ifelse"||a.type==="stepswitch"?B.getConditionalsThenElse(a,A):A=[a],A.map(D=>B.getConditionalsThenElse(D.text)).forEach(D=>{Array.isArray(D)&&D.forEach(F=>{Array.isArray(F)?F.forEach(m=>{typeof m=="string"?B.addKey(r,m,{defaultValue:n}):B.getConditionalsThenElse(m).forEach(d=>{Array.isArray(d)?d.forEach(h=>{typeof h=="string"&&B.addKey(r,h,{defaultValue:n});}):typeof d=="string"&&B.addKey(r,d,{defaultValue:n});});}):typeof F=="string"&&B.addKey(r,F,{defaultValue:n});});});}}));}if(g.dialogue){let l=[];Array.isArray(g.dialogue)?l=[g.dialogue]:l=B.getConditionalsThenElse(g.dialogue),l.forEach(s=>{if(typeof s=="string")B.addKey(r,s,{defaultValue:n});else if("text"in s){let a=B.getConditionalsThenElse(s.text);typeof a=="string"&&(a=[a]),a.forEach(A=>{typeof A=="string"?B.addKey(r,A,{defaultValue:n}):B.getConditionalsThenElse(A).forEach(D=>{typeof D=="string"?B.addKey(r,D,{defaultValue:n}):Array.isArray(D)&&D.forEach(F=>{typeof F=="string"?B.addKey(r,F,{defaultValue:n}):B.getConditionalsThenElse(F).forEach(m=>{typeof m=="string"&&B.addKey(r,m,{defaultValue:n});});});});});}});}if(g.operations)for(let l of g.operations){if(l.type==="operationtoconvert"&&i){let s=zt(l),a=await i(s,g,{});if(!a)return;l=a;}switch(l.type){case "text":switch(l.operationType){case "show":B.addKey(r,l.text,{defaultValue:n});break}break}}g.conditionalStep&&B.getConditionalsThenElse(g.conditionalStep).forEach(l=>{Array.isArray(l)?B.generateJsonTranslation(l,r,u):B.generateJsonTranslation([l],r,u);});});return await Promise.all(p),r}};Je(Fe,"_beforeToTranslate"),Je(Fe,"_translate",t=>t),Je(Fe,"_afterToTranslate");var Ht=Fe,j=Ht;var Gt=Object.create,Re=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,qt=Object.getOwnPropertyNames,Yt=Object.getPrototypeOf,Qt=Object.prototype.hasOwnProperty,Xt=(t,e,r)=>e in t?Re(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r,st=(t=>typeof a<"u"?a:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof a<"u"?a:e)[r]}):t)(function(t){if(typeof a<"u")return a.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),pt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Kt=(t,e,r,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qt(e))!Qt.call(t,n)&&n!==r&&Re(t,n,{get:()=>e[n],enumerable:!(u=Ut(e,n))||u.enumerable});return t},Zt=(t,e,r)=>(r=t!=null?Gt(Yt(t)):{},Kt(Re(r,"default",{value:t,enumerable:true}),t)),ke=(t,e,r)=>Xt(t,typeof e!="symbol"?e+"":e,r),er=pt((t,e)=>{(function(r,u){typeof t=="object"?e.exports=t=u():typeof define=="function"&&define.amd?define([],u):r.CryptoJS=u();})(t,function(){var r=r||(function(u,n){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof st=="function")try{i=st("crypto");}catch{}var p=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},g=Object.create||(function(){function c(){}return function(o){var y;return c.prototype=o,y=new c,c.prototype=null,y}})(),l={},s=l.lib={},a=s.Base=(function(){return {extend:function(c){var o=g(this);return c&&o.mixIn(c),(!o.hasOwnProperty("init")||this.init===o.init)&&(o.init=function(){o.$super.init.apply(this,arguments);}),o.init.prototype=o,o.$super=this,o},create:function(){var c=this.extend();return c.init.apply(c,arguments),c},init:function(){},mixIn:function(c){for(var o in c)c.hasOwnProperty(o)&&(this[o]=c[o]);c.hasOwnProperty("toString")&&(this.toString=c.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),A=s.WordArray=a.extend({init:function(c,o){c=this.words=c||[],o!=n?this.sigBytes=o:this.sigBytes=c.length*4;},toString:function(c){return (c||F).stringify(this)},concat:function(c){var o=this.words,y=c.words,C=this.sigBytes,x=c.sigBytes;if(this.clamp(),C%4)for(var J=0;J<x;J++){var Oe=y[J>>>2]>>>24-J%4*8&255;o[C+J>>>2]|=Oe<<24-(C+J)%4*8;}else for(var Y=0;Y<x;Y+=4)o[C+Y>>>2]=y[Y>>>2];return this.sigBytes+=x,this},clamp:function(){var c=this.words,o=this.sigBytes;c[o>>>2]&=4294967295<<32-o%4*8,c.length=u.ceil(o/4);},clone:function(){var c=a.clone.call(this);return c.words=this.words.slice(0),c},random:function(c){for(var o=[],y=0;y<c;y+=4)o.push(p());return new A.init(o,c)}}),D=l.enc={},F=D.Hex={stringify:function(c){for(var o=c.words,y=c.sigBytes,C=[],x=0;x<y;x++){var J=o[x>>>2]>>>24-x%4*8&255;C.push((J>>>4).toString(16)),C.push((J&15).toString(16));}return C.join("")},parse:function(c){for(var o=c.length,y=[],C=0;C<o;C+=2)y[C>>>3]|=parseInt(c.substr(C,2),16)<<24-C%8*4;return new A.init(y,o/2)}},m=D.Latin1={stringify:function(c){for(var o=c.words,y=c.sigBytes,C=[],x=0;x<y;x++){var J=o[x>>>2]>>>24-x%4*8&255;C.push(String.fromCharCode(J));}return C.join("")},parse:function(c){for(var o=c.length,y=[],C=0;C<o;C++)y[C>>>2]|=(c.charCodeAt(C)&255)<<24-C%4*8;return new A.init(y,o)}},d=D.Utf8={stringify:function(c){try{return decodeURIComponent(escape(m.stringify(c)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(c){return m.parse(unescape(encodeURIComponent(c)))}},h=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new A.init,this._nDataBytes=0;},_append:function(c){typeof c=="string"&&(c=d.parse(c)),this._data.concat(c),this._nDataBytes+=c.sigBytes;},_process:function(c){var o,y=this._data,C=y.words,x=y.sigBytes,J=this.blockSize,Oe=J*4,Y=x/Oe;c?Y=u.ceil(Y):Y=u.max((Y|0)-this._minBufferSize,0);var Ee=Y*J,nt=u.min(Ee*4,x);if(Ee){for(var Ne=0;Ne<Ee;Ne+=J)this._doProcessBlock(C,Ne);o=C.splice(0,Ee),y.sigBytes-=nt;}return new A.init(o,nt)},clone:function(){var c=a.clone.call(this);return c._data=this._data.clone(),c},_minBufferSize:0});s.Hasher=h.extend({cfg:a.extend(),init:function(c){this.cfg=this.cfg.extend(c),this.reset();},reset:function(){h.reset.call(this),this._doReset();},update:function(c){return this._append(c),this._process(),this},finalize:function(c){c&&this._append(c);var o=this._doFinalize();return o},blockSize:16,_createHelper:function(c){return function(o,y){return new c.init(y).finalize(o)}},_createHmacHelper:function(c){return function(o,y){return new E.HMAC.init(c,y).finalize(o)}}});var E=l.algo={};return l})(Math);return r});}),tr=pt((t,e)=>{(function(r,u){typeof t=="object"?e.exports=t=u(er()):typeof define=="function"&&define.amd?define(["./core"],u):u(r.CryptoJS);})(t,function(r){return (function(){var u=r,n=u.lib,i=n.WordArray,p=n.Hasher,g=u.algo,l=[],s=g.SHA1=p.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(a,A){for(var D=this._hash.words,F=D[0],m=D[1],d=D[2],h=D[3],E=D[4],c=0;c<80;c++){if(c<16)l[c]=a[A+c]|0;else {var o=l[c-3]^l[c-8]^l[c-14]^l[c-16];l[c]=o<<1|o>>>31;}var y=(F<<5|F>>>27)+E+l[c];c<20?y+=(m&d|~m&h)+1518500249:c<40?y+=(m^d^h)+1859775393:c<60?y+=(m&d|m&h|d&h)-1894007588:y+=(m^d^h)-899497514,E=h,h=d,d=m<<30|m>>>2,m=F,F=y;}D[0]=D[0]+F|0,D[1]=D[1]+m|0,D[2]=D[2]+d|0,D[3]=D[3]+h|0,D[4]=D[4]+E|0;},_doFinalize:function(){var a=this._data,A=a.words,D=this._nDataBytes*8,F=a.sigBytes*8;return A[F>>>5]|=128<<24-F%32,A[(F+64>>>9<<4)+14]=Math.floor(D/4294967296),A[(F+64>>>9<<4)+15]=D,a.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var a=p.clone.call(this);return a._hash=this._hash.clone(),a}});u.SHA1=p._createHelper(s),u.HmacSHA1=p._createHmacHelper(s);})(),r.SHA1});}),se;(t=>(t.log=(e,...r)=>console.log(`[Pixi\u2019VN Json] ${e}`,...r),t.warn=(e,...r)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...r),t.error=(e,...r)=>console.error(`[Pixi\u2019VN Json] ${e}`,...r),t.info=(e,...r)=>console.info(`[Pixi\u2019VN Json] ${e}`,...r)))(se||(se={}));async function Le(t,e={}){let{operationStringConvert:r,skipEmptyDialogs:u}=e;if(!Array.isArray(t))if(typeof t=="object"||typeof t=="string")t=[t];else {se.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let n=t.map(async p=>{if(typeof p=="string")try{p=JSON.parse(p);}catch(g){se.error("Error parsing imported Pixi'VN JSON",g),p={};}return p}),i=(await Promise.all(n)).map(async p=>{let g=[];if(p.initialOperations){let l={};[...storage.storage.keys()].forEach((s,a)=>{l[s]=storage.storage.get(s);}),storage.startingStorage=l;}if(p.labels){let l=p.labels;for(let s in l)try{let a=l[s],A=new ir(s,a,void 0,e);RegisteredLabels.add(A);}catch(a){se.error(`Error creating JSON label ${s}`,a);}}return Promise.all(g)});await Promise.all(i);}var rr=Zt(tr()),lt="___param___";function ur(t){try{if(typeof t>"u")return t;let e=JSON.stringify(t);return JSON.parse(e)}catch(e){throw se.error("Error creating exportable element",t,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}function nr(t){let e="";return t.values.forEach(r=>{if(typeof r=="string")e+=r;else {let u=v.getLogichValue(r);e+=`${u}`;}}),e}async function ct(t,e){let r=v.getLogichValue(t);if(r)switch(r.type){case "sound":v.soundOperation(r);break;case "assets":case "bundle":await v.loadAssets(r);break;case "image":await v.imageOperation(r);break;case "video":await v.videoOperation(r);break;case "imagecontainer":await v.imageContainerOperation(r);break;case "text":await v.textOperation(r);break;case "canvaselement":await v.canvasElementOperation(r);break;case "value":v.setStorageValue(r);break;case "operationtoconvert":if(e){let u=nr(r),n=await e(u);n&&await ct(n,e);}break;case "input":case "dialogue":v.narrationOperation(r);break;case "fade":case "move":case "rotate":case "zoom":v.tickerOperation(r);break;case "shake":await v.effectOperation(r);break;case "animate":case "animate-sequence":v.animateOperation(r);break}}var ir=class extends LabelAbstract{constructor(t,e,r,u={}){r||(r={}),r.onLoadingLabel=async()=>{for(let n of e){let i;if(typeof n=="function"?i=n():i=n,i=v.getConditionalStep(i),i.operations){let p=i.operations.map(g=>v.loadAssets(g));await Promise.all(p);}}},super(t,r),ke(this,"_steps"),ke(this,"operationStringConvert"),ke(this,"skipEmptyDialogs",false),this._steps=e,this.operationStringConvert=u.operationStringConvert,this.skipEmptyDialogs=u.skipEmptyDialogs||false;}get steps(){return this._steps.map(t=>this.stepConverter(t))}get stepCount(){return this._steps.length}getStepById(t){if(t<0||t>=this._steps.length)return;let e=this._steps[t];return this.stepConverter(e)}getStepSha(t){if(t<0||t>=this.steps.length)return;let e=this._steps[t];return (0, rr.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(t){let e="";if(Array.isArray(t)){let r=[];t.forEach(u=>{if(typeof u=="string")r.push(u);else if(u&&typeof u=="object"){let n=v.getLogichValue(u);n?(n&&!Array.isArray(n)&&typeof n=="object"&&(n=v.getLogichValue(n)||""),Array.isArray(n)?r=r.map(i=>`${i}`).concat(n):r.push(`${n}`)):r.push(`${u}`);}else r.push(`${u}`);}),e=r;}else {let r=v.getLogichValue(t)||"";r&&!Array.isArray(r)&&typeof r=="object"&&(r=v.getLogichValue(r)||""),e=r;}return `${e}`}getDialogue(t){if(t==null)return;let e=v.getLogichValue(t);return e==null?"":typeof e=="object"&&"character"in e&&"text"in e?{character:e.character,text:j.t(this.getDialogueText(e.text))}:j.t(this.getDialogueText(e))}getChoices(t){return v.getLogichValue(t)?.map(e=>v.getLogichValue(e)).filter(e=>e!==void 0)}stepConverter(t){return async e=>{let r=typeof t=="function"?t():t;r=ur(r),r=v.getConditionalStep(r);let u=this.operationStringConvert?D=>this.operationStringConvert(D,r,e):void 0,{operations:n=[]}=r;for(let D of n)await ct(D,u);let{labelToOpen:i=[]}=r,p=this.getChoices(r.choices),g=v.getLogichValue(r.glueEnabled),l=this.getDialogue(r.dialogue),s=[];Array.isArray(i)||(i=[i]),i.forEach(D=>{let F=v.getLogichValue(D);F&&s.push(F);});let a=v.getLogichValue(r.goNextStep),A=v.getLogichValue(r.end);if(p){let D=p.map(F=>{let m="";if(Array.isArray(F.text)){let d=[];F.text.forEach(h=>{if(typeof h=="string")d.push(j.t(h));else if(h&&typeof h=="object"){let E=v.getLogichValue(h);E&&!Array.isArray(E)&&typeof E=="object"&&(E=v.getLogichValue(E)||""),E&&(Array.isArray(E)?d=d.concat(j.t(E)):d.push(j.t(E)));}}),m=d;}else typeof F.text=="string"&&(m=j.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.choiceMenuOptions=D;}else narration.choiceMenuOptions=void 0;l!==void 0&&(narration.dialogue=l,this.skipEmptyDialogs&&typeof l=="string"&&(l===""||RegExp(/^\s+$/).test(l))&&(a=true)),g?storage.setFlag(SYSTEM_RESERVED_STORAGE_KEYS.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,true):g===false&&storage.setFlag(SYSTEM_RESERVED_STORAGE_KEYS.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,false);for(let D of s){let F=D.label;typeof F=="object"&&(F=v.getLogichValue(F)||"");let m=D.params?.map(d=>v.getLogichValue(d));e={...e,...D.props},D.type==="jump"?(narration.openedLabels.length>0&&narration.closeCurrentLabel(),storage.setTempVariable(`${lt}${narration.openedLabels.length}`,m),await narration.callLabel(F,e)):(storage.setTempVariable(`${lt}${narration.openedLabels.length}`,m),await narration.callLabel(F,e));}A==="game_end"?(narration.closeAllLabels(),await narration.goNext(e,{runNow:true})):A==="label_end"&&narration.closeCurrentLabel(),a&&await narration.goNext(e,{runNow:true});}}};var _e="___param___";async function Pr(t){let e=v.getLogichValue(t);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 $;(t=>(t.log=(e,...r)=>console.log(`[Pixi\u2019VN Json] ${e}`,...r),t.warn=(e,...r)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...r),t.error=(e,...r)=>console.error(`[Pixi\u2019VN Json] ${e}`,...r),t.info=(e,...r)=>console.info(`[Pixi\u2019VN Json] ${e}`,...r)))($||($={}));async function xe(t,e,r){switch(r.type){case "fade":await showWithFade(e.alias,t,r.props,r.priority);break;case "dissolve":await showWithDissolve(e.alias,t,r.props,r.priority);break;case "movein":case "moveout":await moveIn(e.alias,t,r.props,r.priority);break;case "zoomin":case "zoomout":await zoomIn(e.alias,t,r.props,r.priority);break;case "pushin":case "pushout":await pushIn(e.alias,t,r.props,r.priority);break}}function de(t){if(t.transition)switch(t.transition.type){case "fade":removeWithFade(t.alias,t.transition.props,t.transition.priority);break;case "dissolve":removeWithDissolve(t.alias,t.transition.props,t.transition.priority);break;case "movein":case "moveout":moveOut(t.alias,t.transition.props,t.transition.priority);break;case "zoomin":case "zoomout":zoomOut(t.alias,t.transition.props,t.transition.priority);break;case "pushin":case "pushout":pushOut(t.alias,t.transition.props,t.transition.priority);break}else canvas.remove(t.alias);}async function wr(t){switch(t.operationType){case "show":if(t.transition){let r=new ImageSprite(t.props,t.url||t.alias);await xe(r,t,t.transition);}else await showImage(t.alias,t.url,t.props);break;case "edit":let e=canvas.find(t.alias);e?t.props&&await e.setMemory({...e.memory,...t.props}):$.error(`Image with alias ${t.alias} not found.`);break;case "remove":de(t);break}}async function Vr(t){switch(t.operationType){case "show":if(t.transition){let n=new VideoSprite(t.props,t.url||t.alias);await xe(n,t,t.transition);}else await showVideo(t.alias,t.url,t.props);break;case "edit":let e=canvas.find(t.alias);e?t.props&&await e.setMemory({...e.memory,...t.props}):$.error(`Video with alias ${t.alias} not found.`);break;case "remove":de(t);break;case "pause":let r=canvas.find(t.alias);r?r.paused=true:$.error(`Video with alias ${t.alias} not found.`);break;case "resume":let u=canvas.find(t.alias);u?u.paused=false:$.error(`Video with alias ${t.alias} not found.`);break}}async function Or(t){switch(t.operationType){case "show":if(t.transition){let r=new ImageContainer(t.props,t.urls);await xe(r,t,t.transition);}else await showImageContainer(t.alias,t.urls,t.props);break;case "edit":let e=canvas.find(t.alias);e?t.props&&await e.setMemory({...e.memory,...t.props}):$.error(`ImageContainer with alias ${t.alias} not found.`);break;case "remove":de(t);break}}async function Nr(t){switch(t.operationType){case "show":if(t.props=t.props||{},t.props.text=j.t(t.text),t.transition){let r=new Text(t.props);await xe(r,t,t.transition);}else showText(t.alias,t.text,t.props);break;case "edit":let e=canvas.find(t.alias);e?t.props&&await e.setMemory({...e.memory,...t.props}):$.error(`Text with alias ${t.alias} not found.`);break;case "remove":de(t);break}}async function Jr(t){switch(t.operationType){case "edit":try{let e=canvas.find(t.alias);e?t.props&&(e.memory={...e.memory,...t.props}):$.error(`Canvas Element with alias ${t.alias} not found.`);}catch(e){$.error(`There was an error while trying to edit the canvas element with alias ${t.alias}.`,e);}break;case "remove":de(t);break}}function kr(t){switch(t.type){case "fade":let e=new FadeAlphaTicker(t.props,t.duration,t.priority);canvas.addTicker(t.alias,e);break;case "move":let r=new MoveTicker(t.props,t.duration,t.priority);canvas.addTicker(t.alias,r);break;case "rotate":let u=new RotateTicker(t.props,t.duration,t.priority);canvas.addTicker(t.alias,u);break;case "zoom":let n=new ZoomTicker(t.props,t.duration,t.priority);canvas.addTicker(t.alias,n);break}}async function Rr(t){switch(t.type){case "shake":await shakeEffect(t.alias,t.props,t.priority);break}}function Lr(t){switch(t.type){case "animate":canvas.animate(t.alias,t.keyframes,t.options,t.priority);break;case "animate-sequence":canvas.animate(t.alias,t.sequence,t.options,t.priority);break}}function jr(t){switch(t.type){case "input":narration$1.requestInput({type:t.valueType},t.defaultValue);break;case "dialogue":narration$1.dialogue=void 0;break}}function _r(t){switch(t.operationType){case "play":sound.play(t.alias,t.props);break;case "stop":sound.stop(t.alias);break;case "pause":sound.pause(t.alias);break;case "resume":sound.resume(t.alias);break;case "volume":sound.volume(t.alias,t.value);break}}function Ir(t){try{if(typeof t>"u")return t;let e=JSON.stringify(t);return JSON.parse(e)}catch(e){throw $.error("Error creating exportable element",t,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}function $r(t){let e=V(t.value),r;switch(e&&typeof e=="object"&&"type"in e?r=V(e):r=e,t.storageType){case "flagStorage":storage.setFlag(t.key,t.value);break;case "storage":storage.setVariable(t.key,r);break;case "tempstorage":storage.setTempVariable(t.key,r);break;case "params":let u=storage.getVariable(`${_e}${narration.openedLabels.length-1}`)||[];u&&u.length-1>=t.key&&(u[t.key]=r),storage.setTempVariable(`${_e}${narration.openedLabels.length-1}`,u);break}}function V(t){let e=Ur(t);if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "value":return Hr(e);case "arithmetic":case "arithmeticsingle":return zr(e);case "compare":case "valueCondition":case "union":return Mr(e)}return e}function zr(t){let e=V(t.leftValue);switch(t.type){case "arithmetic":let r=V(t.rightValue);switch(t.operator){case "*":return e*r;case "/":return e/r;case "+":return e+r;case "-":return e-r;case "%":return e%r;case "POW":return Math.pow(e,r);case "RANDOM":return narration.getRandomNumber(e,r)}case "arithmeticsingle":switch(t.operator){case "INT":return parseInt(e);case "FLOOR":return Math.floor(e);case "FLOAT":return parseFloat(e)}break}}function Hr(t){if(t&&typeof t=="object"&&"type"in t&&t.type==="value"&&t.storageOperationType==="get")switch(t.storageType){case "storage":case "tempstorage":return storage.getVariable(t.key);case "flagStorage":return storage.getFlag(t.key);case "label":return narration.getTimesLabelOpened(t.label);case "choice":return narration.getTimesChoiceMade(t.index);case "logic":return V(t.operation);case "params":let e=storage.getVariable(`${_e}${narration.openedLabels.length-1}`)||[];if(e&&e.length>t.key)return e[t.key];$.warn("getValue params not found");return}return t}function Mr(t){if(!t)return false;if(typeof t!="object"||!("type"in t))return !!t;switch(t.type){case "compare":let e=V(t.leftValue),r=V(t.rightValue);switch(t.operator){case "==":return e===r;case "!=":return e!==r;case "<":return e<r;case "<=":return e<=r;case ">":return e>r;case ">=":return e>=r;case "CONTAINS":return e.toString().includes(r.toString())}break;case "valueCondition":return !!V(t.value);case "union":return Wr(t)}return !!t}function Wr(t){if(t.unionType==="not")return !V(t.condition);let e=t.unionType==="and";for(let r=0;r<t.conditions.length;r++)if(e=V(t.conditions[r])||false,t.unionType==="and"){if(!e)return false}else if(e)return true;return e}function Gr(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function Ur(t){if(Array.isArray(t)||!t)return t;if(t&&typeof t=="object"&&"type"in t)switch(t.type){case "resulttocombine":return qr(t);case "ifelse":return V(t.condition)?V(t.then):V(t.else);case "stepswitch":let e=V(t.elements)||[];if(e.length===0){$.error("getValueFromConditionalStatements elements.length === 0");return}switch(t.choiceType){case "random":let r=Gr(0,e.length-1);return V(e[r]);case "loop":let u=NarrationManagerStatic.getCurrentStepTimesCounter(t.nestedId)-1;return u>e.length-1&&(u=u%e.length),V(e[u]);case "sequential":let n,i=NarrationManagerStatic.getCurrentStepTimesCounter(t.nestedId)-1;return t.end=="lastItem"&&(n=V(e[e.length-1])),i>e.length-1?n:V(e[i]);case "sequentialrandom":let p=NarrationManagerStatic.getRandomNumber(0,e.length-1,{nestedId:t.nestedId,onceOnly:true});if(p==null&&t.end=="lastItem"){let g=NarrationManagerStatic.getCurrentStepTimesCounterData(t.nestedId);if(!g||!g?.usedRandomNumbers){$.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let l=g.usedRandomNumbers[`0-${e.length-1}`];return V(e[l[l.length-1]])}if(p==null){$.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return V(e[p])}}return t}function Ie(t){if(t.conditionalStep){let e=Ir(V(t.conditionalStep));if(e?.glueEnabled===void 0&&delete e?.glueEnabled,e?.goNextStep===void 0&&delete e?.goNextStep,e?.end===void 0&&delete e?.end,e?.choices===void 0&&delete e?.choices,e?.dialogue===void 0&&delete e?.dialogue,e?.labelToOpen===void 0&&delete e?.labelToOpen,e?.operations===void 0&&delete e?.operations,e){let r={...t,conditionalStep:void 0,...e};return Ie(r)}else storage.getFlag(SYSTEM_RESERVED_STORAGE_KEYS.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)&&storage.setFlag(SYSTEM_RESERVED_STORAGE_KEYS.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,false);}return t}function qr(t){let e=t.firstItem,r=[];t.secondConditionalItem?.forEach(n=>{if(Array.isArray(n))n.forEach(i=>{let p=V(i);r.push(p);});else {let i=V(n);r.push(i);}});let u=e?[e,...r]:r;if(u.length===0){$.warn("combinateResult toCheck.length === 0");return}if(typeof u[0]=="string")return j.t(u);if(typeof u[0]=="object"){let n=u,i,p=n.map((h,E)=>{h=Ie(h);let c=V(h.dialogue)||"";return E===0?(i=V(h.glueEnabled)||false,c):(typeof c=="object"&&"text"in c&&(c=c.character+": "+c.text),i===false&&(c=`
|
|
2
|
+
|
|
3
|
+
`+c),i=V(h.glueEnabled)||false,c)}),g=V(p[0]),l=typeof g=="object"&&"character"in g?g.character:void 0,s=p.flatMap(h=>{let E;h&&typeof h=="object"&&"text"in h?E=h.text:E=h;let c;return Array.isArray(E)?c=E.map(o=>{let y=V(o);return j.t(`${y}`)}):c=V(E)||"",j.t(c)}),a=n.find(h=>h.end),A=n.find(h=>h.choices),D=false,F=false;n.length>0&&(n[0].glueEnabled&&n[0].goNextStep&&n[0].dialogue===void 0&&storage.setFlag(SYSTEM_RESERVED_STORAGE_KEYS.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,true),D=n[n.length-1].glueEnabled,F=n.reverse().find(h=>!(h.operations&&(!h.dialogue||!h.choices)))?.goNextStep);let m=n.find(h=>h.labelToOpen),d=[];return n.forEach(h=>{h.operations&&d.forEach(E=>{d.push(E);});}),{dialogue:l?{character:l,text:s}:s,end:a?.end,choices:A?.choices,glueEnabled:D,goNextStep:F,labelToOpen:m?.labelToOpen,operations:d}}}function $e(){v.init({animateOperation:Lr,canvasElementOperation:Jr,effectOperation:Rr,imageContainerOperation:Or,imageOperation:wr,textOperation:Nr,narrationOperation:jr,loadAssets:Pr,soundOperation:_r,tickerOperation:kr,videoOperation:Vr,setStorageValue:$r,getLogichValue:V,getConditionalStep:Ie});}var Yr=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Qr=/[\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]/,Xr=/[\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]/,ze={Space_Separator:Yr,ID_Start:Qr,ID_Continue:Xr},L={isSpaceSeparator(t){return typeof t=="string"&&ze.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||ze.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||ze.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}},Me,H,Z,Te,te,q,_,Ue,Ce,Kr=function(e,r){Me=String(e),H="start",Z=[],Te=0,te=1,q=0,_=void 0,Ue=void 0,Ce=void 0;do _=Zr(),ru[H]();while(_.type!=="eof");return typeof r=="function"?We({"":Ce},"",r):Ce};function We(t,e,r){let u=t[e];if(u!=null&&typeof u=="object")if(Array.isArray(u))for(let n=0;n<u.length;n++){let i=String(n),p=We(u,i,r);p===void 0?delete u[i]:Object.defineProperty(u,i,{value:p,writable:true,enumerable:true,configurable:true});}else for(let n in u){let i=We(u,n,r);i===void 0?delete u[n]:Object.defineProperty(u,n,{value:i,writable:true,enumerable:true,configurable:true});}return r.call(t,e,u)}var S,b,Ae,K,P;function Zr(){for(S="default",b="",Ae=false,K=1;;){P=ee();let t=gt[S]();if(t)return t}}function ee(){if(Me[Te])return String.fromCodePoint(Me.codePointAt(Te))}function f(){let t=ee();return t===`
|
|
4
|
+
`?(te++,q=0):t?q+=t.length:q++,t&&(Te+=t.length),t}var gt={default(){switch(P){case " ":case "\v":case "\f":case " ":case "\xA0":case "\uFEFF":case `
|
|
5
|
+
`:case "\r":case "\u2028":case "\u2029":f();return;case "/":f(),S="comment";return;case void 0:return f(),k("eof")}if(L.isSpaceSeparator(P)){f();return}return gt[H]()},comment(){switch(P){case "*":f(),S="multiLineComment";return;case "/":f(),S="singleLineComment";return}throw R(f())},multiLineComment(){switch(P){case "*":f(),S="multiLineCommentAsterisk";return;case void 0:throw R(f())}f();},multiLineCommentAsterisk(){switch(P){case "*":f();return;case "/":f(),S="default";return;case void 0:throw R(f())}f(),S="multiLineComment";},singleLineComment(){switch(P){case `
|
|
6
|
+
`:case "\r":case "\u2028":case "\u2029":f(),S="default";return;case void 0:return f(),k("eof")}f();},value(){switch(P){case "{":case "[":return k("punctuator",f());case "n":return f(),oe("ull"),k("null",null);case "t":return f(),oe("rue"),k("boolean",true);case "f":return f(),oe("alse"),k("boolean",false);case "-":case "+":f()==="-"&&(K=-1),S="sign";return;case ".":b=f(),S="decimalPointLeading";return;case "0":b=f(),S="zero";return;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":b=f(),S="decimalInteger";return;case "I":return f(),oe("nfinity"),k("numeric",1/0);case "N":return f(),oe("aN"),k("numeric",NaN);case '"':case "'":Ae=f()==='"',b="",S="string";return}throw R(f())},identifierNameStartEscape(){if(P!=="u")throw R(f());f();let t=Ge();switch(t){case "$":case "_":break;default:if(!L.isIdStartChar(t))throw ft();break}b+=t,S="identifierName";},identifierName(){switch(P){case "$":case "_":case "\u200C":case "\u200D":b+=f();return;case "\\":f(),S="identifierNameEscape";return}if(L.isIdContinueChar(P)){b+=f();return}return k("identifier",b)},identifierNameEscape(){if(P!=="u")throw R(f());f();let t=Ge();switch(t){case "$":case "_":case "\u200C":case "\u200D":break;default:if(!L.isIdContinueChar(t))throw ft();break}b+=t,S="identifierName";},sign(){switch(P){case ".":b=f(),S="decimalPointLeading";return;case "0":b=f(),S="zero";return;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":b=f(),S="decimalInteger";return;case "I":return f(),oe("nfinity"),k("numeric",K*(1/0));case "N":return f(),oe("aN"),k("numeric",NaN)}throw R(f())},zero(){switch(P){case ".":b+=f(),S="decimalPoint";return;case "e":case "E":b+=f(),S="decimalExponent";return;case "x":case "X":b+=f(),S="hexadecimal";return}return k("numeric",K*0)},decimalInteger(){switch(P){case ".":b+=f(),S="decimalPoint";return;case "e":case "E":b+=f(),S="decimalExponent";return}if(L.isDigit(P)){b+=f();return}return k("numeric",K*Number(b))},decimalPointLeading(){if(L.isDigit(P)){b+=f(),S="decimalFraction";return}throw R(f())},decimalPoint(){switch(P){case "e":case "E":b+=f(),S="decimalExponent";return}if(L.isDigit(P)){b+=f(),S="decimalFraction";return}return k("numeric",K*Number(b))},decimalFraction(){switch(P){case "e":case "E":b+=f(),S="decimalExponent";return}if(L.isDigit(P)){b+=f();return}return k("numeric",K*Number(b))},decimalExponent(){switch(P){case "+":case "-":b+=f(),S="decimalExponentSign";return}if(L.isDigit(P)){b+=f(),S="decimalExponentInteger";return}throw R(f())},decimalExponentSign(){if(L.isDigit(P)){b+=f(),S="decimalExponentInteger";return}throw R(f())},decimalExponentInteger(){if(L.isDigit(P)){b+=f();return}return k("numeric",K*Number(b))},hexadecimal(){if(L.isHexDigit(P)){b+=f(),S="hexadecimalInteger";return}throw R(f())},hexadecimalInteger(){if(L.isHexDigit(P)){b+=f();return}return k("numeric",K*Number(b))},string(){switch(P){case "\\":f(),b+=eu();return;case '"':if(Ae)return f(),k("string",b);b+=f();return;case "'":if(!Ae)return f(),k("string",b);b+=f();return;case `
|
|
7
|
+
`:case "\r":throw R(f());case "\u2028":case "\u2029":uu(P);break;case void 0:throw R(f())}b+=f();},start(){switch(P){case "{":case "[":return k("punctuator",f())}S="value";},beforePropertyName(){switch(P){case "$":case "_":b=f(),S="identifierName";return;case "\\":f(),S="identifierNameStartEscape";return;case "}":return k("punctuator",f());case '"':case "'":Ae=f()==='"',S="string";return}if(L.isIdStartChar(P)){b+=f(),S="identifierName";return}throw R(f())},afterPropertyName(){if(P===":")return k("punctuator",f());throw R(f())},beforePropertyValue(){S="value";},afterPropertyValue(){switch(P){case ",":case "}":return k("punctuator",f())}throw R(f())},beforeArrayValue(){if(P==="]")return k("punctuator",f());S="value";},afterArrayValue(){switch(P){case ",":case "]":return k("punctuator",f())}throw R(f())},end(){throw R(f())}};function k(t,e){return {type:t,value:e,line:te,column:q}}function oe(t){for(let e of t){if(ee()!==e)throw R(f());f();}}function eu(){switch(ee()){case "b":return f(),"\b";case "f":return f(),"\f";case "n":return f(),`
|
|
8
|
+
`;case "r":return f(),"\r";case "t":return f()," ";case "v":return f(),"\v";case "0":if(f(),L.isDigit(ee()))throw R(f());return "\0";case "x":return f(),tu();case "u":return f(),Ge();case `
|
|
9
|
+
`:case "\u2028":case "\u2029":return f(),"";case "\r":return f(),ee()===`
|
|
10
|
+
`&&f(),"";case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":throw R(f());case void 0:throw R(f())}return f()}function tu(){let t="",e=ee();if(!L.isHexDigit(e)||(t+=f(),e=ee(),!L.isHexDigit(e)))throw R(f());return t+=f(),String.fromCodePoint(parseInt(t,16))}function Ge(){let t="",e=4;for(;e-- >0;){let r=ee();if(!L.isHexDigit(r))throw R(f());t+=f();}return String.fromCodePoint(parseInt(t,16))}var ru={start(){if(_.type==="eof")throw ae();He();},beforePropertyName(){switch(_.type){case "identifier":case "string":Ue=_.value,H="afterPropertyName";return;case "punctuator":be();return;case "eof":throw ae()}},afterPropertyName(){if(_.type==="eof")throw ae();H="beforePropertyValue";},beforePropertyValue(){if(_.type==="eof")throw ae();He();},beforeArrayValue(){if(_.type==="eof")throw ae();if(_.type==="punctuator"&&_.value==="]"){be();return}He();},afterPropertyValue(){if(_.type==="eof")throw ae();switch(_.value){case ",":H="beforePropertyName";return;case "}":be();}},afterArrayValue(){if(_.type==="eof")throw ae();switch(_.value){case ",":H="beforeArrayValue";return;case "]":be();}},end(){}};function He(){let t;switch(_.type){case "punctuator":switch(_.value){case "{":t={};break;case "[":t=[];break}break;case "null":case "boolean":case "numeric":case "string":t=_.value;break}if(Ce===void 0)Ce=t;else {let e=Z[Z.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,Ue,{value:t,writable:true,enumerable:true,configurable:true});}if(t!==null&&typeof t=="object")Z.push(t),Array.isArray(t)?H="beforeArrayValue":H="beforePropertyName";else {let e=Z[Z.length-1];e==null?H="end":Array.isArray(e)?H="afterArrayValue":H="afterPropertyValue";}}function be(){Z.pop();let t=Z[Z.length-1];t==null?H="end":Array.isArray(t)?H="afterArrayValue":H="afterPropertyValue";}function R(t){return Be(t===void 0?`JSON5: invalid end of input at ${te}:${q}`:`JSON5: invalid character '${dt(t)}' at ${te}:${q}`)}function ae(){return Be(`JSON5: invalid end of input at ${te}:${q}`)}function ft(){return q-=5,Be(`JSON5: invalid identifier character at ${te}:${q}`)}function uu(t){console.warn(`JSON5: '${dt(t)}' in strings is not valid ECMAScript; consider escaping`);}function dt(t){let e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){let r=t.charCodeAt(0).toString(16);return "\\x"+("00"+r).substring(r.length)}return t}function Be(t){let e=new SyntaxError(t);return e.lineNumber=te,e.columnNumber=q,e}var nu=function(e,r,u){let n=[],i="",p,g,l="",s;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(u=r.space,s=r.quote,r=r.replacer),typeof r=="function")g=r;else if(Array.isArray(r)){p=[];for(let d of r){let h;typeof d=="string"?h=d:(typeof d=="number"||d instanceof String||d instanceof Number)&&(h=String(d)),h!==void 0&&p.indexOf(h)<0&&p.push(h);}}return u instanceof Number?u=Number(u):u instanceof String&&(u=String(u)),typeof u=="number"?u>0&&(u=Math.min(10,Math.floor(u)),l=" ".substr(0,u)):typeof u=="string"&&(l=u.substr(0,10)),a("",{"":e});function a(d,h){let E=h[d];switch(E!=null&&(typeof E.toJSON5=="function"?E=E.toJSON5(d):typeof E.toJSON=="function"&&(E=E.toJSON(d))),g&&(E=g.call(h,d,E)),E instanceof Number?E=Number(E):E instanceof String?E=String(E):E instanceof Boolean&&(E=E.valueOf()),E){case null:return "null";case true:return "true";case false:return "false"}if(typeof E=="string")return A(E);if(typeof E=="number")return String(E);if(typeof E=="object")return Array.isArray(E)?m(E):D(E)}function A(d){let h={"'":.1,'"':.2},E={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},c="";for(let y=0;y<d.length;y++){let C=d[y];switch(C){case "'":case '"':h[C]++,c+=C;continue;case "\0":if(L.isDigit(d[y+1])){c+="\\x00";continue}}if(E[C]){c+=E[C];continue}if(C<" "){let x=C.charCodeAt(0).toString(16);c+="\\x"+("00"+x).substring(x.length);continue}c+=C;}let o=s||Object.keys(h).reduce((y,C)=>h[y]<h[C]?y:C);return c=c.replace(new RegExp(o,"g"),E[o]),o+c+o}function D(d){if(n.indexOf(d)>=0)throw TypeError("Converting circular structure to JSON5");n.push(d);let h=i;i=i+l;let E=p||Object.keys(d),c=[];for(let y of E){let C=a(y,d);if(C!==void 0){let x=F(y)+":";l!==""&&(x+=" "),x+=C,c.push(x);}}let o;if(c.length===0)o="{}";else {let y;if(l==="")y=c.join(","),o="{"+y+"}";else {let C=`,
|
|
11
|
+
`+i;y=c.join(C),o=`{
|
|
12
|
+
`+i+y+`,
|
|
13
|
+
`+h+"}";}}return n.pop(),i=h,o}function F(d){if(d.length===0)return A(d);let h=String.fromCodePoint(d.codePointAt(0));if(!L.isIdStartChar(h))return A(d);for(let E=h.length;E<d.length;E++)if(!L.isIdContinueChar(String.fromCodePoint(d.codePointAt(E))))return A(d);return d}function m(d){if(n.indexOf(d)>=0)throw TypeError("Converting circular structure to JSON5");n.push(d);let h=i;i=i+l;let E=[];for(let o=0;o<d.length;o++){let y=a(String(o),d);E.push(y!==void 0?y:"null");}let c;if(E.length===0)c="[]";else if(l==="")c="["+E.join(",")+"]";else {let o=`,
|
|
14
|
+
`+i,y=E.join(o);c=`[
|
|
15
|
+
`+i+y+`,
|
|
16
|
+
`+h+"]";}return n.pop(),i=h,c}},iu={parse:Kr,stringify:nu},ou=iu,Se=ou;var At="\xA7SPACE\xA7",Ct="\xA7DOUBLE_QUOTES\xA7",ht="\xA7QUOTES\xA7",Et="SPECIAL_\xA7QUOTES\xA7",Ft="\xA7CURLY_BRACKETS1\xA7",yt="\xA7CURLY_BRACKETS2\xA7",au=["add","play","pause","resume","remove","volume"],T=class T{static runCustomHashtagScript(e,r){return T._customHashtagScript(e,r,T.convertListStringToObj)}static set customHashtagScript(e){T._customHashtagScript=e;}static async generateOrRunOperationFromHashtagScript(e,r,u){try{e=e.replaceAll('\\"',Ct),e=e.replaceAll("\\'",ht),e=e.replaceAll("\\`",Et),e=e.replaceAll("\\{",Ft),e=e.replaceAll("\\}",yt),e=e.replaceAll("{"," { "),e=e.replaceAll("}"," } "),e=e.replaceAll(Ft,"{"),e=e.replaceAll(yt,"}");let n=[],i,p="";for(let a=0;a<e.length;a++){let A=e[a];A==='"'||A==="'"||A==="`"?i===void 0?(n.push(p),p="",i=A,p+=A):i===A?(i=void 0,p+=A,n.push(p),p=""):p+=A:p+=A;}p!==""&&n.push(p),n.forEach((a,A)=>{A%2===1&&(n[A]=a.replaceAll(" ",At));}),e=n.join(""),n=e.split(" ").filter(a=>a!==""),n=n.map(a=>a.replaceAll(At," ").replaceAll(Ct,'"').replaceAll(ht,"'").replaceAll(Et,"`"));let g=T.runCustomHashtagScript(n,u);if(g===!0)return;if(typeof g=="string")return g.startsWith("#")&&(g=g.substring(1)),T.generateOrRunOperationFromHashtagScript(g,r,u);let l=n.length>1?T.removeExtraDoubleQuotes(n[1]):"",s=n.length>0?T.removeExtraDoubleQuotes(n[0]):"";switch(l){case "image":case "imagecontainer":case "canvaselement":case "video":case "text":return l==="video"&&(s==="pause"||s==="resume")?{type:"video",operationType:s,alias:T.removeExtraDoubleQuotes(n[2])}:T.getCanvasOperationFromComment(n,l);case "sound":return T.getSoundOperationFromComment(n);case "input":if(s==="request"){let a={type:"input",operationType:"request"};if(n.length>2)try{let A=n.slice(2),D=T.convertListStringToObj(A);"type"in D&&typeof D.type=="string"&&(a.valueType=D.type),"default"in D&&(a.defaultValue=D.default);}catch{}return a}break;case "assets":case "bundle":switch(s){case "load":case "lazyload":return {type:l,operationType:s,aliases:n.slice(2)}}break;default:if(l)switch(s){case "call":case "jump":r.labelToOpen={label:l,type:s},r.goNextStep=void 0;return;case "fade":case "move":case "rotate":case "zoom":case "shake":let a={};if(n.length>2)try{a=T.convertListStringToObj(n.slice(2));}catch{}if(s=="move"&&"x"in a&&"y"in a&&(a.destination={x:a.x,y:a.y,type:"pixel"},delete a.x,delete a.y),s=="move"&&"xAlign"in a&&"yAlign"in a&&(a.destination={x:a.xAlign,y:a.yAlign,type:"align"},delete a.xAlign,delete a.yAlign),s=="move"&&"xPercentage"in a&&"yPercentage"in a&&(a.destination={x:a.xPercentage,y:a.yPercentage,type:"percentage"},delete a.xPercentage,delete a.yPercentage),s=="move"&&!("destination"in a)){d.error("The move operation don't have a destination or destination is not valid",a);return}return {alias:l,type:s,props:a};case "animate":let D={},F={};if(n.length>2){let d=n.slice(2),h=[];if(d.includes("options")){let E=d.indexOf("options");h=d.slice(E+1),d=d.slice(0,E);}try{D=T.convertListStringToObj(d);}catch{}if(h.length>0)try{F=T.convertListStringToObj(h);}catch{}}return {alias:l,type:s,keyframes:D,options:F}}else switch(s){case "pause":return "dialogue"in r&&delete r.dialogue,"goNextStep"in r&&delete r.goNextStep,{type:"dialogue",operationType:"clean"};case "continue":r.goNextStep=!0,r.glueEnabled=!1;return}}}catch(n){throw d.error("Error parsing ink hashtag-script",e),n}d.error("The operation is not valid",e);}static getCanvasOperationFromComment(e,r){let u=T.removeExtraDoubleQuotes(e[0]),n=T.removeExtraDoubleQuotes(e[2]),i=T.convertListStringToPropList(e.slice(3));switch(u){case "show":switch(r){case "image":case "video":return T.getImageOperationFromComment(r,n,i);case "imagecontainer":return T.getContainerOperationFromComment(r,n,i);case "text":return T.getTextOperationFromComment(r,n,i);case "canvaselement":default:d.error("This show operation is not valid for this type of element",r);}case "edit":return {type:r,operationType:"edit",alias:n,props:T.convertPropListStringToObj(i)};case "remove":let g={type:r,operationType:"remove",alias:n};if(i.length>1&&i[0]==="with"){let l=e[e.indexOf("with")+1],s=e.slice(e.indexOf("with")+2),a=T.getTransition(l,s);a!==void 0&&(g.transition=a);}return g;default:d.error("The operation type is not valid",u);}}static getImageOperationFromComment(e,r,u){let n,i;u.length%2===0?(n=r,i=u):(n=T.removeExtraDoubleQuotes(u[0]),i=u.slice(1));let p={type:e,operationType:"show",alias:r,url:n};return T.setShowProps(p,i)}static getTextOperationFromComment(e,r,u){let n,i;u.length%2===0?(n=r,i=u):(n=T.removeExtraDoubleQuotes(u[0]),i=u.slice(1));let p={type:e,operationType:"show",alias:r,text:n};return T.setShowProps(p,i)}static getContainerOperationFromComment(e,r,u){let n=[],i=u.findIndex(s=>s.startsWith("[")),p=u.findIndex(s=>s.endsWith("]"));if(i===-1||p===-1){d.error("Show imagecontainer must have a list of image ulrs",u);return}if(n=u.slice(i,p+1),n.length<2){d.error("Show imagecontainer must have a list of image ulrs",u);return}n[0]==="["?n.shift():n[0]=n[0].substring(1),n[n.length-1]==="]"?n.pop():n[n.length-1]=n[n.length-1].substring(0,n[n.length-1].length-1);let g={type:e,operationType:"show",alias:r,urls:n.map(s=>T.removeExtraDoubleQuotes(s))},l=u.slice(p+1);return T.setShowProps(g,l)}static getSoundOperationFromComment(e){let r=T.removeExtraDoubleQuotes(e[0]);if(!au.includes(r))return;let u=T.removeExtraDoubleQuotes(e[2]);switch(r){case "play":let n={type:"sound",operationType:"play",alias:u};if(e.length>3){let s=T.getSoundPlayOptions(e.slice(3));s!==void 0&&(n.props=s);}return n;case "pause":case "resume":return {type:"sound",operationType:r,alias:u};case "stop":case "remove":return {type:"sound",operationType:"stop",alias:u};case "volume":let g=parseFloat(e[3]);return {type:"sound",operationType:"volume",alias:u,value:g}}}static setShowProps(e,r){if(r.length>0){if(r.includes("with")&&r.length>r.indexOf("with")+1){let u=r[r.indexOf("with")+1],n=r.slice(r.indexOf("with")+2);r=r.slice(0,r.indexOf("with"));let i=T.getTransition(u,n);i!==void 0&&(e.transition=i);}if(r.length>0){let u=T.convertPropListStringToObj(r);e.props=u;}}return e}static getTransition(e,r){switch(e){case "dissolve":case "fade":case "movein":case "moveout":case "zoomin":case "zoomout":case "pushin":case "pushout":break;default:return}let u={type:e};if(r.length>0)try{let n=T.convertPropListStringToObj(r);u.props=n;}catch{}return u}static getSoundOption(e){try{return T.convertListStringToObj(e)}catch{return}}static getSoundPlayOptions(e){try{return T.convertListStringToObj(e)}catch{return}}static convertListStringToObj(e){let r=T.convertListStringToPropList(e);return T.convertPropListStringToObj(r)}static convertListStringToPropList(e){let r=[],u=0,n="";for(let i=0;i<e.length;i++){let p=e[i];p.startsWith("{")?(u++,n+=p):p.endsWith("}")&&u>0?(u--,n+=p,u===0&&(r.push(n),n="")):u>0?n+=p:r.push(p);}return r}static convertPropListStringToObj(e){if(e.length===0)return {};if(e.length%2!==0)throw d.error("The props list must have a pair number of elements",e),new Error("The props list must have a pair number of elements");let r="{";e.forEach((u,n)=>{if(n%2===0)r+=`"${u}": `;else {switch(u){case "null":case "undefined":case "true":case "false":r+=`${u}`;break;default:T.containExtraDoubleQuotes(u)?(u=T.removeExtraDoubleQuotes(u),r+=`"${u}"`):u.startsWith("{")&&u.endsWith("}")?r+=`${u}`:u.startsWith('"')&&u.endsWith('"')?r+=`${u}`:isNaN(parseFloat(u))?r+=`"${u}"`:r+=`${u}`;}n<e.length-1&&(r+=", ");}}),r+="}";try{return Se.parse(r)}catch(u){throw d.error("Error parsing ink json",r),u}}static removeExtraDoubleQuotes(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")||e.startsWith("`")&&e.endsWith("`")?e.substring(1,e.length-1):e}static containExtraDoubleQuotes(e){return !!(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")||e.startsWith("`")&&e.endsWith("`"))}};c(T,"_customHashtagScript",e=>false);var Q=T;function su(t){Q.customHashtagScript=t;}var rt=b$1(e(),1);var ve="global decl",re="___external_value___";function he(t,e){if(t.endsWith(".s"))return;if(new RegExp(/.*\.[0-9]+\..*$/).test(t)&&(t=t.split(".").filter(n=>!n.match(/^[0-9]+$/)).join("."),!t.startsWith(".")))return t.replaceAll(".","_|_");if(!new RegExp(/^\.\^.*$/).test(t)&&t.includes("g-")){let u=t.split("g-");return qe(e)+"_|_"+"g-"+u[u.length-1]}let r=0;for(;new RegExp(/^\.\^.*$/).test(t);)r++,t=t.substring(2);if(r=r-1,new RegExp(/^\..*$/).test(t)&&e){let u=t.substring(1);return qe(e,r)+"_|_"+u.replaceAll(".","_|_")}return t.replaceAll(".","_|_")||qe(e,r).replaceAll(".","_|_")}function qe(t,e=0){let r=t.split("_|_");for(;r.length>1&&e>0;)r.pop()?.includes("g-")&&e--,e--;return r.join("_|_")}var mt="\xA7DOUBLE_SLASH_CONVERTOR\xA7";function X(t){return t.startsWith("^")&&(t=t.substring(1)),t=t.replaceAll("\\\\",mt),t=t.replaceAll("\\n",`
|
|
17
|
+
`),t=t.replaceAll("\\t"," "),t=t.replaceAll(" "," "),t=t.replaceAll(mt,"\\\\"),t}var xt=["+","-","/","*","%","_","==",">","<",">=","<=","!=","!","&&","||","MIN","MAX"],bt=["+","-","/","*","%","POW","RANDOM"],Tt=["INT","FLOOR","FLOAT"],Bt=["==",">","<",">=","<=","!=","CONTAINS"];function pe(t,e,r){t=t.map(n=>{if(typeof n=="string"){if(n==="rnd")return "RANDOM";if(n==="?")return "CONTAINS"}return n});let u=[];return t.forEach(n=>{if(typeof n=="object"&&"CNT?"in n)if(new RegExp(/.*\.[0-9]\..*/).test(n["CNT?"])){let i=n["CNT?"].split("."),p=i.pop(),g=i.pop();if(g===void 0||p===void 0){d.error("Error parsing ink file: Conditional statement is not valid",t);return}let l=parseInt(g),s=i.join(".");if(s.includes("^.")){let A=s.split("."),D=A[A.length-1].replaceAll(".","_|_");A.pop(),s=A.join(".")+"."+D,p.includes("c-")&&(s=s+"_|_"+p);}else s=s.replaceAll(".","_|_");let a=he(s,e);if(!a)return;u.push({type:"compare",leftValue:St(a),operator:">=",rightValue:{type:"value",value:l}});}else {let i=he(n["CNT?"],e);if(!i)return;u.push(St(i));}else if(typeof n=="object"&&"VAR?"in n)u.push(ce(n["VAR?"],r));else if(n==="&&"||n==="||"){if(u.length>=2){let i={type:"union",unionType:n==="&&"?"and":"or",conditions:[u[u.length-2],u[u.length-1]]};u.pop(),u.pop(),u.push(i);}}else if(n==="!")if(u.length===0)d.error("Error parsing ink file: Conditional statement is not valid",t);else {let i={type:"union",unionType:"not",condition:u[u.length-1]};u[u.length-1]=i;}else if(n&&typeof n=="string"&&Bt.includes(n))if(u.length<2)d.error("Error parsing ink file: Conditional statement is not valid",t);else {let i={type:"compare",operator:n,rightValue:u[u.length-1],leftValue:u[u.length-2]};u.pop(),u.pop(),u.push(i);}else if(n&&typeof n=="string"&&bt.includes(n))if(u.length<2)d.error("Error parsing ink file: Conditional statement is not valid",t);else {let i={type:"arithmetic",operator:n,rightValue:u[u.length-1],leftValue:u[u.length-2]};u.pop(),u.pop(),u.push(i);}else if(n&&typeof n=="string"&&Tt.includes(n)){let i={type:"arithmeticsingle",operator:n,leftValue:u[u.length-1]};u.pop(),u.push(i);}else n&&typeof n=="string"?n.startsWith("^")&&u.push(X(n)):typeof n=="object"&&"^->"in n?n["^->"].includes("$r")||u.push(n["^->"]):u.push(n);}),u}function St(t){return {type:"value",storageType:"label",storageOperationType:"get",label:t}}function vt(t,e,r){return pe(t,e,r)}function ce(t,e,r="storage"){let u=e.indexOf(t);return u>=0?{type:"value",storageType:"params",storageOperationType:"get",key:u}:{type:"value",storageOperationType:"get",storageType:r,key:t}}function Ye(t,e,r,u="storage"){let n=e.indexOf(t);return n>=0?{type:"value",storageType:"params",storageOperationType:"set",key:n,value:r}:{type:"value",storageOperationType:"set",storageType:u,key:t,value:r}}function Qe(t,e){return e||t.includes("_|_")?"call":"jump"}function Pe(t,e){e&&(typeof e=="string"?e.startsWith("^")&&t.push(X(e)):typeof e=="object"&&"type"in e&&e.type!=="value"&&t.push(e));}function Xe(t,e,r,u,n={}){let{isNewLine:i=true,isHashtagScript:p=false,isThreads:g=false}=n;return pu(t,e,r,u,{isNewLine:i,isHashtagScript:p,isThreads:g})}function pu(t,e,r,u,n){if(!e)return;let{isNewLine:i,isHashtagScript:p=false,isThreads:g}=n;if(p)Array.isArray(e)&&e.length>0&&t.push({operations:[{type:"operationtoconvert",values:e}],goNextStep:true});else if(typeof e=="string"&&e.startsWith("^")||e&&typeof e=="object"&&"type"in e&&e.type=="value"&&e.storageOperationType==="get"){if(!i&&t.length>0){let l=t[t.length-1];!l.glueEnabled&&!l.operations&&(l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true)),t[t.length-1]=l;}typeof e=="string"?t.push(cu(X(e))):t.push({dialogue:e});}else if(typeof e=="string"){if(e==="end")t.push({end:"game_end"});else if(e==="done")t.push({end:"label_end",goNextStep:true});else if(e=="<>")if(t.length>0){let l=t[t.length-1];l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true),t[t.length-1]=l;}else t.push({glueEnabled:true,goNextStep:false});}else if(typeof e=="object"){if("type"in e&&e.type!=="value"){if(!i&&t.length>0){let l=t[t.length-1];!l.glueEnabled&&!l.operations&&(l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true)),t[t.length-1]=l;}t.push({conditionalStep:e});}else if("->"in e){let l=i?void 0:true;if(!i&&t.length>0){let s=t[t.length-1];s.labelToOpen||(s.goNextStep=true),t[t.length-1]=s;}if(e.params&&e.params.length===0&&(e.params=void 0),e.var)t.push({labelToOpen:{label:ce(e["->"],u),type:g?"call":"jump",params:e.params},glueEnabled:l});else {let s=he(e["->"],r);if(!s)return;t.push({labelToOpen:{label:s,type:Qe(s,g),params:e.params},glueEnabled:l});}}"type"in e&&e.type=="value"&&e.storageOperationType==="set"&&(typeof e.value=="string"&&e.value.startsWith("^")&&(e.value=X(e.value)),t.push({goNextStep:true,operations:[e]}));}}function cu(t){let e;if(t.includes(": ")){let r=t.split(": "),u=r[0],n=r.slice(1).join(": ");RegisteredCharacters.get(u)&&(e=u,t=n);}return e?{dialogue:{character:e,text:t}}:{dialogue:t}}function Ke(t,e,r,u=true,n=false){return Du(t,e,r,u,n)}function Du(t,e,r,u,n=false){e&&(typeof e=="string"&&e.startsWith("^")||e&&typeof e=="object"&&"type"in e&&e.type=="value"&&e.storageOperationType==="get"?typeof e=="string"?t.push(X(e)):t.push(e):typeof e=="object"&&"type"in e&&t.push(e));}function we(t,e,r){if(t.length===0){d.error("Error parsing ink file: Arithmetic statement is not valid",t);return}let u=pe(t,e,r);if(u.length===1){let n=u[0];return n&&typeof n=="object"&&"type"in n?{type:"value",storageType:"logic",storageOperationType:"get",operation:n}:n}}function De(t,e,r,u="",n,i,p=void 0){let g=[],l="sequential",s=false,a=true;t.forEach(F=>{F==="%"&&(l="loop"),F==="seq"&&(l="random"),F==="MIN"&&(s=true);});let A=t[t.length-1];return Object.keys(A).forEach(F=>{let m=A[F];if(Array.isArray(m)&&m.length>3){m=m.slice(1,m.length-2);let d=[];ue(m,u,n,d,e,e,r,fe,p,true,i),d.length===1?g.push(d[0]):g.push({type:"resulttocombine",combine:"cross",secondConditionalItem:d});}else Array.isArray(m)&&m.length===3&&(a=false);}),l==="sequential"?{type:"stepswitch",elements:g,choiceType:l,end:a?"lastItem":void 0,nestedId:p}:s&&l==="random"?{type:"stepswitch",elements:g,choiceType:"sequentialrandom",end:a?"lastItem":void 0,nestedId:p}:{type:"stepswitch",elements:g,choiceType:l}}function Ze(t="",e=""){let r=Array.isArray(t)?t:[t],u=Array.isArray(e)?e:[e];return [...new Set([...r,...u])]}function fe(t,e,r,u,n){if(t.length>0){let i={};Pt(t,i,n);for(let[p,g]of Object.entries(i)){let l=r+"_|_"+p,s={text:g.text.length===1?g.text[0]:g.text,label:l,props:{},type:Qe(l,false),oneTime:g.onetime};g.text.length===0&&(s.onlyHaveNoChoice=true,s.autoSelect=true),s.oneTime===false&&delete s.oneTime;let a=et(s,g.conditions,n,r)||s,A=e[e.length-1];if(typeof A=="object"&&A&&"type"in A&&(A={conditionalStep:A}),e.length>0&&typeof A=="object"&&A&&"choices"in A&&A.choices){let D=A.choices;D&&Array.isArray(D)?D.push(a):d.error("Unhandled case: choices is PixiVNJsonConditionalStatements<PixiVNJsonChoices> | undefined",g,D),A.choices=D.sort((F,m)=>{try{let d=F.label.split("."),h=d[d.length-1].replaceAll(".","_|_"),E=m.label.split("."),c=E[E.length-1].replaceAll(".","_|_");if(h.includes("c-")&&c.includes("c-")){let o=h.split("c-")[1],y=parseInt(o),C=c.split("c-")[1],x=parseInt(C);return y-x}}catch{}return 0});}else e.push({choices:[a]});g.preDialog&&(u.preDialog[l]={...g.preDialog});}}}function Pt(t,e,r,u){let n=[],i="",p="",g=false,l=[];for(let s=0;s<t.length;s++){let a=t[s];if(typeof a=="string")a.startsWith("^")?n.push(X(a)):xt.includes(a)&&l.push(a);else if(Array.isArray(a)&&a.includes("visit")){let A=De(a,Pe,(D,F,m)=>{},u,{preDialog:{}},r);n.push(A);}else if(a&&typeof a=="object")if("*"in a&&typeof a["*"]&&typeof a["*"]=="string")a["*"].includes("c")&&(i="c"+a["*"].split("c")[1],a.flg&16&&(g=true));else if("s"in a&&a.s instanceof Array){let A=wt(a.s),D=a.s.includes("<>");A&&(u&&e[u]?(e[u].preDialog={text:A,glue:D},e[u].text=Ze(A,e[u].text)):(n.push(A),p=A));}else "CNT?"in a&&l.push(a);else l.push(a);if(i){e[i]?e[i].text=Ze(n,e[i].text):e[i]={text:n,onetime:g,conditions:l},p&&(e[i].preDialog={text:p,glue:false});let A=t.slice(s+1);Pt(A,e,r,i);return}}}function wt(t){for(let e of t)if(typeof e=="string"){if(e.startsWith("^"))return X(e)}else if(e instanceof Array){let r=wt(e);if(r)return r}}function et(t,e,r,u,n){if(e.length===0)return;let i=pe(e,u,r);if(i.length===1){let p={type:"ifelse",condition:i[0],then:t,else:n};return p.else||delete p.else,p}else if(i.length>1){let p={type:"ifelse",condition:{type:"union",unionType:"and",conditions:i},then:t,else:n};return p.else||delete p.else,p}}function Vt(t,e,r,u,n,i,p=void 0){if(t.length===0){d.error("Error parsing ink file: Conditional statement is not valid",t);return}let g=[],l=[];if(t.forEach(A=>{Array.isArray(A)?l.push(A):typeof A=="string"&&A==="du"?n.du?g.push(n.du):n.du=g[g.length-1]:(typeof A!="string"||A!=="/ev")&&g.push(A);}),l.length===0){d.error("Error parsing ink file: Conditional statement is not valid",l);return}let s=tt(l[0],e,r,u+"_|_"+"then",n,i,`${p||""}then`),a;return l.length===2?a=tt(l[1],e,r,u+"_|_"+"else",n,i,`${p||""}else`):l.length>2&&(l.shift(),l.push("nop"),l=[{b:l}],a=tt(l,e,r,u+"_|_"+"else",n,i,`${p||""}else`)),n.du=void 0,et(s,g,i,u,a)}function tt(t,e,r,u,n,i,p=void 0){let g=[];for(let s of t)typeof s=="object"&&"b"in s&&(s.b=s.b.filter(a=>a!==null&&!(typeof a=="object"&&"->"in a&&new RegExp(/.*\.[0-9]/).test(a["->"]))),ue(s.b,u,n,g,e,e,r,fe,p,true,i));return g.length===1?g[0]:{type:"resulttocombine",combine:"cross",secondConditionalItem:g}}function ue(t,e,r,u=[],n,i,p,g,l=void 0,s=true,a=[]){let A=false,D=[],F=false,m=false,d$1=false,h=[],E=[];if(r.preDialog[e]&&(s=false,n(u,"^"+r.preDialog[e].text,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),r.preDialog[e].glue&&n(u,"<>",e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),delete r.preDialog[e]),t.includes("visit")){let o=De(t,i,p,e,r,a,l);o&&(!s&&u.length>0&&n(u,"<>",e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),n(u,o,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}));return}let c=t[0];if(c&&typeof c=="object"&&"temp="in c){for(;t[0]&&typeof t[0]=="object"&&"temp="in t[0];)a.push(t[0]["temp="]),t.shift();a=a.reverse();}if(t.forEach((o,y)=>{if(m){if(typeof o=="string"&&o=="/#"){let C=[];ue(E,e,r,C,Ke,Ke,p,g,l,s),n(u,C,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),m=false,E=[];}else E.push(o);return}else if(A)if(Array.isArray(o))D.push(o);else if(o&&typeof o=="object")if("CNT?"in o)y>0&&t[y-1]=="ev"?(F=true,h.push(o)):F?h.push(o):(D.push(o),s=false);else if("VAR="in o||"temp="in o){let C=Ye("VAR="in o?o["VAR="]:o["temp="],a,t[y-1],"VAR="in o?"storage":"tempstorage");if(C.value&&typeof C.value=="string"&&C.value=="/str"&&(C.value=t[y-2]),C.value&&typeof C.value=="object"&&"^->"in C.value&&(C.value=C.value["^->"]),D.length>1){let x=we(D,e,a);D=[],x&&typeof x=="object"&&"type"in x&&x.type=="value"&&"storageType"in x&&x.storageType=="logic"&&(C.value=x.operation);}(typeof C.key!="string"||!C.key.includes("$r"))&&(n(u,C,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),s=true);}else "VAR?"in o?D.push(o):"^->"in o&&(o["^->"].includes("$r")||D.push(o));else if(typeof o=="string"&&o=="/ev")F&&h.push(o),A=false,D.push(o);else if(typeof o=="string"&&o=="out"){if(D.length>0){let C=D[D.length-1];if(C&&typeof C=="object"&&"VAR?"in C){D.pop();let x=ce(C["VAR?"],a,"storage");n(u,x,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1});}else {let x=[];for(;D.length>0&&D[D.length-1]!="/ev";)x.push(D.pop());x=x.reverse();let J=we(x,e,a);D=[],J&&typeof J=="object"&&"type"in J&&J.type=="value"&&"storageType"in J&&J.storageType=="logic"?n(u,{storageOperationType:"get",storageType:"logic",operation:J.operation,type:"value"},e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}):(n(u,"<>",e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),J=`^${J}`,n(u,J,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}));}s=false;}}else D.push(o);else if(typeof o=="string")if(o.startsWith("^"))n(u,o,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),s=false;else if(o=="ev")A=true;else if(o==`
|
|
18
|
+
`)s=true;else if(o=="done"||o=="end")n(u,o,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),s=false;else if(o=="<>")n(u,o,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),s=false;else if(o=="nop"&&F){let C=Vt(h,i,p,e,r,a,l);C&&n(u,C,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),F=false,h=[];}else o=="#"?m=true:o=="thread"&&(d$1=true);else if(o instanceof Array)if(F)h.push(o);else if(o.length>1&&typeof o[o.length-2]=="object"&&o[o.length-2]&&"c"in o[o.length-2]&&typeof o[o.length-1]=="object"&&o[o.length-1]&&"b"in o[o.length-1]){D.pop();let C=[],x=[];for(;D.length>0&&D[D.length-1]!="/ev";)C.push(D.pop());h=[...h,...C.reverse()],F=true,x.push(o.pop()),x.push(o.pop()),h=[...h,...o],h.push(x);}else if(o.length>1&&typeof o[o.length-1]=="object"&&o[o.length-1]&&"#n"in o[o.length-1]){let C=o.pop();if(!C){d.error("Error parsing ink file: el is undefined");return}let x=C["#n"];delete C["#n"],o.push(C),n(u,{"->":e?e+"_|_"+x:x},e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),p({[x]:o},e,r);}else ue(o,e,r,u,n,i,p,g,l,s);else if(o&&typeof o=="object")if("->"in o&&typeof o["->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(o["->"])){let C=[];D.length>0&&(C=vt(["ev",...D],e,a)),o.params=C,n(u,o,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),s=false;}else if("*"in o&&typeof o["*"]=="string")o["*"].includes("c")&&(D.push(o),s=false);else if("s"in o&&o.s instanceof Array)D.push(o),s=false;else if("CNT?"in o)D.push(o),s=false;else if("VAR="in o||"temp="in o){let C=[],x=Ye("VAR="in o?o["VAR="]:o["temp="],a,void 0,"VAR="in o?"storage":"tempstorage");if(x.key!=="$r"){for(D.pop(),D[D.length-1]=="/ev"&&D.pop();D.length>0&&D[D.length-1]!="/ev";)C.push(D.pop());C=C.reverse(),x.value=we(C,e,a),D=[],(x.value!==void 0||x.value!==null)&&n(u,x,e,a,{isNewLine:s,isHashtagScript:m,isThreads:d$1}),s=false;}}else p(o,e,r);}),g(D,u,e,r,a),e.includes("_|_")&&u.length==2){let o=u[0],y=u[1];o&&y&&typeof o=="object"&&"dialogue"in o&&typeof y=="object"&&"labelToOpen"in y&&o.dialogue==" "&&y.labelToOpen&&(u.shift(),delete y.glueEnabled,u[0]=y);}}function Ot(t){try{let e={};return Nt(t,e),e}catch(e){d.error("Error parsing ink file",e);}}function Nt(t,e,r={externalSwitch:void 0}){for(let u of t)if(u)if(u instanceof Array)if(u.includes("visit")){let n=De(u,Pe,(i,p,g)=>{},"",{preDialog:{}},[]);n&&(r.externalSwitch=n);}else Nt(u,e,r);else typeof u=="object"&&(u&&"VAR="in u&&r.externalSwitch&&(e[re]||(e[re]=[]),e[re].push({operations:[{type:"value",value:r.externalSwitch,key:u["VAR="],storageType:"storage",storageOperationType:"set"}]})),Jt(u,e));}function Jt(t,e,r="",u={preDialog:{}}){if(t!==null){for(let[n,i]of Object.entries(t))if(i instanceof Array){let p=[],g={},l=(r?r+"_|_":"")+n;ue(i,l,u,p,Xe,Xe,(s,a,A)=>{Jt(s,g,a,A);},fe);for(let[s,a]of Object.entries(g))e[s]=a;p.length>0&&(e[l]=p);}}}function Ve(t){let{json:e,labelToRemove:r,issues:u,initialVarsToRemove:n}=f$1(t);if(u.forEach(({message:p,type:g})=>{g===rt.ErrorType.Error?d.error("Ink compilation error: "+p):g===rt.ErrorType.Warning?d.warn("Ink compilation warning: "+p):d.info("Ink compilation info: "+p);}),!e){d.error("No JSON generated from ink file");return}let i;try{i=Se.parse(e);}catch{d.error("Error parsing ink file");return}return kt(i,{labelToRemove:r,initialVarsToRemove:n})}function kt(t,e={}){let{labelToRemove:r=[],initialVarsToRemove:u=[]}=e,n={};if(n.labels=Ot(t.root),n.labels&&ve in n.labels){let i=n.labels[ve];delete n.labels[ve],i.forEach(p=>{p.operations&&(n.initialOperations=n.initialOperations?[...n.initialOperations,...p.operations]:[...p.operations]);});}if(n.labels&&re in n.labels){let i=n.labels[re];delete n.labels[re],i.forEach(p=>{p.operations&&(n.initialOperations=n.initialOperations?[...n.initialOperations,...p.operations]:[...p.operations]);});}return r.forEach(i=>{n.labels&&i in n.labels&&delete n.labels[i];}),u.forEach(i=>{n.initialOperations&&(n.initialOperations=n.initialOperations.filter(p=>!(p.type==="value"&&p.key===i)));}),n}async function fu(t){Array.isArray(t)||(t=[t]),$e();let e=t.map(async r=>{let u=Ve(r);return u&&await Le(u,{operationStringConvert:Q.generateOrRunOperationFromHashtagScript,skipEmptyDialogs:true}),r});return await Promise.all(e)}async function gu(t){return $e(),await Le(t,{operationStringConvert:Q.generateOrRunOperationFromHashtagScript,skipEmptyDialogs:true})}function du(t){j.afterToTranslate=e=>ut(e,t);}function Au(t){j.beforeToTranslate=e=>ut(e,t);}function ut(t,e){let r=t.match(/\[([^\]]+)\]/);if(r){let u=r[1],n=e(u);return n&&(t=t.replaceAll(r[0],n)),ut(t,e)}return t}function Cu(t){j.translate=t;}async function hu(t,e={},r={}){let u=[];return t.labels&&Object.values(t.labels).forEach(n=>{u=u.concat(n);}),await j.generateJsonTranslation(u,e,{...r,operationStringConvert:Q.generateOrRunOperationFromHashtagScript})}export{su as a,Ve as b,kt as c,fu as d,gu as e,du as f,Au as g,Cu as h,hu as i};
|