@drincs/pixi-vn-json 1.13.8 → 1.13.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  Pixi’VN can be integrated with JSON files to create a visual novel. This method is useful for:
14
14
 
15
- - Add a new narrative to Pixi’VN (It was used to create the integration with <DynamicLink href="/ink">**_ink_**</DynamicLink> and <DynamicLink href="/renpy">Ren'Py</DynamicLink>)
15
+ - Add a new narrative to Pixi’VN (It was used to create the integration with **_ink_**
16
16
  - Create a external tool to create visual novels with Pixi’VN
17
17
 
18
18
  ( In both these cases it is advisable to notify the developers of Pixi’VN to add the new feature to be helped )
@@ -1,4 +1,4 @@
1
- import { StorageElementType, CanvasBaseInterface, ImageSprite, ShakeEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, MoveInOutProps, ZoomInOutProps, PushInOutProps, ImageContainerOptions, ImageSpriteOptions, TextOptions, ImageSpriteMemory, VideoSpriteMemory, ImageContainerMemory, TextMemory, ContainerOptions, ContainerMemory, SoundPlayOptionsWithChannel, MediaInterface, LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
1
+ import { StorageElementType, CanvasBaseInterface, ImageSprite, ShakeEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, MoveInOutProps, ZoomInOutProps, PushInOutProps, ContainerOptions, ImageContainerOptions, ImageSpriteOptions, TextOptions, ImageSpriteMemory, VideoSpriteMemory, ImageContainerMemory, TextMemory, ContainerMemory, SoundPlayOptionsWithChannel, MediaInterface, LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
2
2
  import { KeyframesType, AnimationOptions, ObjectSegment, ObjectSegmentWithTransition, SequenceOptions } from '@drincs/pixi-vn/motion';
3
3
  import { UPDATE_PRIORITY } from 'pixi.js';
4
4
 
@@ -996,4 +996,4 @@ type PixiVNJsonLabelStep = {
996
996
  conditionalStep?: PixiVNJsonConditionalStatements<PixiVNJsonLabelStep | PixiVNJsonLabelStep[]>;
997
997
  };
998
998
 
999
- export type { PixiVNJsonValueGet as $, PixiVNJsonIfElse as A, PixiVNJsonImageContainerEdit as B, PixiVNJsonImageEdit as C, PixiVNJsonInputRequest as D, PixiVNJsonLabelGet as E, PixiVNJsonLabelStep as F, PixiVNJsonLabelToOpen as G, PixiVNJsonLogicGet as H, PixiVNJsonMediaTransiotions as I, PixiVNJsonNarration as J, PixiVNJsonOnlyStorageSet as K, PixiVNJsonOperation as L, PixiVNJsonOperationString as M, PixiVNJsonParamGet as N, PixiVNJsonSound as O, PixiVNJsonAnimateBase as P, PixiVNJsonSoundEdit as Q, PixiVNJsonSoundPauseResume as R, PixiVNJsonSoundPlay as S, PixiVNJsonSoundRemove as T, PixiVNJsonStepSwitch as U, PixiVNJsonStepSwitchElementType as V, PixiVNJsonStepSwitchElementsType as W, PixiVNJsonStorageGet as X, PixiVNJsonTextEdit as Y, PixiVNJsonUnionCondition as Z, PixiVNJsonUnknownEdit as _, PixiVNJsonAnimateSequence as a, PixiVNJsonValueSet as a0, PixiVNJsonVideoEdit as a1, PixiVNJsonVideoPauseResume as a2, PixiVNJsonArithmeticOperations as b, PixiVNJsonArithmeticOperationsArithmetic as c, PixiVNJsonArithmeticOperationsArithmeticSingle as d, PixiVNJsonCanvas as e, PixiVNJsonCanvasAnimate as f, PixiVNJsonCanvasEdit as g, PixiVNJsonCanvasEffect as h, PixiVNJsonCanvasImageContainerShow as i, PixiVNJsonCanvasImageVideoShow as j, PixiVNJsonCanvasRemove as k, PixiVNJsonCanvasShow as l, PixiVNJsonCanvasTextShow as m, PixiVNJsonChoice as n, PixiVNJsonChoiceGet as o, PixiVNJsonChoices as p, PixiVNJsonComparation as q, PixiVNJsonComparationOperatorsType as r, PixiVNJsonConditionalOperation as s, PixiVNJsonConditionalResultToCombine as t, PixiVNJsonConditionalStatements as u, PixiVNJsonConditions as v, PixiVNJsonDialog as w, PixiVNJsonDialogText as x, PixiVNJsonDialogue as y, PixiVNJsonFunction as z };
999
+ export type { PixiVNJsonStepSwitchElementType as $, PixiVNJsonArithmeticOperationsArithmetic as A, PixiVNJsonArithmeticOperationsArithmeticSingle as B, PixiVNJsonCanvas as C, PixiVNJsonCanvasEdit as D, PixiVNJsonCanvasShow as E, PixiVNJsonChoice as F, PixiVNJsonChoiceGet as G, PixiVNJsonChoices as H, PixiVNJsonComparation as I, PixiVNJsonConditionalOperation as J, PixiVNJsonConditionalResultToCombine as K, PixiVNJsonDialog as L, PixiVNJsonDialogText as M, PixiVNJsonDialogue as N, PixiVNJsonFunction as O, PixiVNJsonOperation as P, PixiVNJsonInputRequest as Q, PixiVNJsonLabelGet as R, PixiVNJsonLabelToOpen as S, PixiVNJsonLogicGet as T, PixiVNJsonMediaTransiotions as U, PixiVNJsonParamGet as V, PixiVNJsonSoundEdit as W, PixiVNJsonSoundPauseResume as X, PixiVNJsonSoundPlay as Y, PixiVNJsonSoundRemove as Z, PixiVNJsonStepSwitch as _, PixiVNJsonIfElse as a, PixiVNJsonStepSwitchElementsType as a0, PixiVNJsonStorageGet as a1, PixiVNJsonUnionCondition as a2, PixiVNJsonOperationString as b, PixiVNJsonSound as c, PixiVNJsonCanvasImageVideoShow as d, PixiVNJsonImageEdit as e, PixiVNJsonCanvasRemove as f, PixiVNJsonVideoEdit as g, PixiVNJsonVideoPauseResume as h, PixiVNJsonCanvasImageContainerShow as i, PixiVNJsonImageContainerEdit as j, PixiVNJsonCanvasTextShow as k, PixiVNJsonTextEdit as l, PixiVNJsonUnknownEdit as m, PixiVNJsonValueSet as n, PixiVNJsonOnlyStorageSet as o, PixiVNJsonNarration as p, PixiVNJsonCanvasEffect as q, PixiVNJsonCanvasAnimate as r, PixiVNJsonValueGet as s, PixiVNJsonArithmeticOperations as t, PixiVNJsonConditions as u, PixiVNJsonConditionalStatements as v, PixiVNJsonLabelStep as w, PixiVNJsonComparationOperatorsType as x, PixiVNJsonAnimateBase as y, PixiVNJsonAnimateSequence as z };
@@ -1,4 +1,4 @@
1
- import { StorageElementType, CanvasBaseInterface, ImageSprite, ShakeEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, MoveInOutProps, ZoomInOutProps, PushInOutProps, ImageContainerOptions, ImageSpriteOptions, TextOptions, ImageSpriteMemory, VideoSpriteMemory, ImageContainerMemory, TextMemory, ContainerOptions, ContainerMemory, SoundPlayOptionsWithChannel, MediaInterface, LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
1
+ import { StorageElementType, CanvasBaseInterface, ImageSprite, ShakeEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, MoveInOutProps, ZoomInOutProps, PushInOutProps, ContainerOptions, ImageContainerOptions, ImageSpriteOptions, TextOptions, ImageSpriteMemory, VideoSpriteMemory, ImageContainerMemory, TextMemory, ContainerMemory, SoundPlayOptionsWithChannel, MediaInterface, LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
2
2
  import { KeyframesType, AnimationOptions, ObjectSegment, ObjectSegmentWithTransition, SequenceOptions } from '@drincs/pixi-vn/motion';
3
3
  import { UPDATE_PRIORITY } from 'pixi.js';
4
4
 
@@ -996,4 +996,4 @@ type PixiVNJsonLabelStep = {
996
996
  conditionalStep?: PixiVNJsonConditionalStatements<PixiVNJsonLabelStep | PixiVNJsonLabelStep[]>;
997
997
  };
998
998
 
999
- export type { PixiVNJsonValueGet as $, PixiVNJsonIfElse as A, PixiVNJsonImageContainerEdit as B, PixiVNJsonImageEdit as C, PixiVNJsonInputRequest as D, PixiVNJsonLabelGet as E, PixiVNJsonLabelStep as F, PixiVNJsonLabelToOpen as G, PixiVNJsonLogicGet as H, PixiVNJsonMediaTransiotions as I, PixiVNJsonNarration as J, PixiVNJsonOnlyStorageSet as K, PixiVNJsonOperation as L, PixiVNJsonOperationString as M, PixiVNJsonParamGet as N, PixiVNJsonSound as O, PixiVNJsonAnimateBase as P, PixiVNJsonSoundEdit as Q, PixiVNJsonSoundPauseResume as R, PixiVNJsonSoundPlay as S, PixiVNJsonSoundRemove as T, PixiVNJsonStepSwitch as U, PixiVNJsonStepSwitchElementType as V, PixiVNJsonStepSwitchElementsType as W, PixiVNJsonStorageGet as X, PixiVNJsonTextEdit as Y, PixiVNJsonUnionCondition as Z, PixiVNJsonUnknownEdit as _, PixiVNJsonAnimateSequence as a, PixiVNJsonValueSet as a0, PixiVNJsonVideoEdit as a1, PixiVNJsonVideoPauseResume as a2, PixiVNJsonArithmeticOperations as b, PixiVNJsonArithmeticOperationsArithmetic as c, PixiVNJsonArithmeticOperationsArithmeticSingle as d, PixiVNJsonCanvas as e, PixiVNJsonCanvasAnimate as f, PixiVNJsonCanvasEdit as g, PixiVNJsonCanvasEffect as h, PixiVNJsonCanvasImageContainerShow as i, PixiVNJsonCanvasImageVideoShow as j, PixiVNJsonCanvasRemove as k, PixiVNJsonCanvasShow as l, PixiVNJsonCanvasTextShow as m, PixiVNJsonChoice as n, PixiVNJsonChoiceGet as o, PixiVNJsonChoices as p, PixiVNJsonComparation as q, PixiVNJsonComparationOperatorsType as r, PixiVNJsonConditionalOperation as s, PixiVNJsonConditionalResultToCombine as t, PixiVNJsonConditionalStatements as u, PixiVNJsonConditions as v, PixiVNJsonDialog as w, PixiVNJsonDialogText as x, PixiVNJsonDialogue as y, PixiVNJsonFunction as z };
999
+ export type { PixiVNJsonStepSwitchElementType as $, PixiVNJsonArithmeticOperationsArithmetic as A, PixiVNJsonArithmeticOperationsArithmeticSingle as B, PixiVNJsonCanvas as C, PixiVNJsonCanvasEdit as D, PixiVNJsonCanvasShow as E, PixiVNJsonChoice as F, PixiVNJsonChoiceGet as G, PixiVNJsonChoices as H, PixiVNJsonComparation as I, PixiVNJsonConditionalOperation as J, PixiVNJsonConditionalResultToCombine as K, PixiVNJsonDialog as L, PixiVNJsonDialogText as M, PixiVNJsonDialogue as N, PixiVNJsonFunction as O, PixiVNJsonOperation as P, PixiVNJsonInputRequest as Q, PixiVNJsonLabelGet as R, PixiVNJsonLabelToOpen as S, PixiVNJsonLogicGet as T, PixiVNJsonMediaTransiotions as U, PixiVNJsonParamGet as V, PixiVNJsonSoundEdit as W, PixiVNJsonSoundPauseResume as X, PixiVNJsonSoundPlay as Y, PixiVNJsonSoundRemove as Z, PixiVNJsonStepSwitch as _, PixiVNJsonIfElse as a, PixiVNJsonStepSwitchElementsType as a0, PixiVNJsonStorageGet as a1, PixiVNJsonUnionCondition as a2, PixiVNJsonOperationString as b, PixiVNJsonSound as c, PixiVNJsonCanvasImageVideoShow as d, PixiVNJsonImageEdit as e, PixiVNJsonCanvasRemove as f, PixiVNJsonVideoEdit as g, PixiVNJsonVideoPauseResume as h, PixiVNJsonCanvasImageContainerShow as i, PixiVNJsonImageContainerEdit as j, PixiVNJsonCanvasTextShow as k, PixiVNJsonTextEdit as l, PixiVNJsonUnknownEdit as m, PixiVNJsonValueSet as n, PixiVNJsonOnlyStorageSet as o, PixiVNJsonNarration as p, PixiVNJsonCanvasEffect as q, PixiVNJsonCanvasAnimate as r, PixiVNJsonValueGet as s, PixiVNJsonArithmeticOperations as t, PixiVNJsonConditions as u, PixiVNJsonConditionalStatements as v, PixiVNJsonLabelStep as w, PixiVNJsonComparationOperatorsType as x, PixiVNJsonAnimateBase as y, PixiVNJsonAnimateSequence as z };
@@ -0,0 +1,36 @@
1
+ import { StorageElementType, StepLabelPropsType } from '@drincs/pixi-vn';
2
+
3
+ /**
4
+ * A middleware handler that can intercept and transform a logic value before it is
5
+ * returned by {@link VariableGetter.getLogichValue}.
6
+ *
7
+ * Handlers are called in registration order, each receiving the current value and a
8
+ * `next` function to invoke the rest of the chain (including the built-in resolver).
9
+ * Return `undefined` to fall through to `next`.
10
+ */
11
+ type VariableGetterHandler = <T = StorageElementType>(value: T, next: (value: T) => T | undefined) => T | undefined;
12
+
13
+ declare namespace VariableGetter {
14
+ /**
15
+ * Registers a new middleware handler into the resolution chain.
16
+ * Handlers are invoked in the order they were added.
17
+ *
18
+ * @param handler - The middleware handler to register.
19
+ */
20
+ function add(handler: VariableGetterHandler): void;
21
+ /**
22
+ * Removes all registered middleware handlers, restoring the default resolution behaviour.
23
+ */
24
+ function clear(): void;
25
+ /**
26
+ * Resolves a JSON logic value, running it through all registered middleware handlers
27
+ * before falling back to the built-in storage/arithmetic/condition evaluator.
28
+ *
29
+ * @param value - The value or logic expression to resolve.
30
+ * @param props - The current step label props passed to each handler.
31
+ * @returns The resolved value, or `undefined`.
32
+ */
33
+ function getLogichValue<T = StorageElementType>(value: any, props?: StepLabelPropsType): T | undefined;
34
+ }
35
+
36
+ export { VariableGetter as V, type VariableGetterHandler as a };
@@ -0,0 +1,36 @@
1
+ import { StorageElementType, StepLabelPropsType } from '@drincs/pixi-vn';
2
+
3
+ /**
4
+ * A middleware handler that can intercept and transform a logic value before it is
5
+ * returned by {@link VariableGetter.getLogichValue}.
6
+ *
7
+ * Handlers are called in registration order, each receiving the current value and a
8
+ * `next` function to invoke the rest of the chain (including the built-in resolver).
9
+ * Return `undefined` to fall through to `next`.
10
+ */
11
+ type VariableGetterHandler = <T = StorageElementType>(value: T, next: (value: T) => T | undefined) => T | undefined;
12
+
13
+ declare namespace VariableGetter {
14
+ /**
15
+ * Registers a new middleware handler into the resolution chain.
16
+ * Handlers are invoked in the order they were added.
17
+ *
18
+ * @param handler - The middleware handler to register.
19
+ */
20
+ function add(handler: VariableGetterHandler): void;
21
+ /**
22
+ * Removes all registered middleware handlers, restoring the default resolution behaviour.
23
+ */
24
+ function clear(): void;
25
+ /**
26
+ * Resolves a JSON logic value, running it through all registered middleware handlers
27
+ * before falling back to the built-in storage/arithmetic/condition evaluator.
28
+ *
29
+ * @param value - The value or logic expression to resolve.
30
+ * @param props - The current step label props passed to each handler.
31
+ * @returns The resolved value, or `undefined`.
32
+ */
33
+ function getLogichValue<T = StorageElementType>(value: any, props?: StepLabelPropsType): T | undefined;
34
+ }
35
+
36
+ export { VariableGetter as V, type VariableGetterHandler as a };
package/dist/actions.cjs CHANGED
@@ -1,3 +1,3 @@
1
- 'use strict';var core=require('@drincs/pixi-vn-json/core'),canvas=require('@drincs/pixi-vn/canvas'),translator=require('@drincs/pixi-vn-json/translator'),narration=require('@drincs/pixi-vn/narration'),sound=require('@drincs/pixi-vn/sound'),pixiVn=require('@drincs/pixi-vn'),storage=require('@drincs/pixi-vn/storage');var q=Object.defineProperty;var W=(e,t,i)=>t in e?q(e,t,{enumerable:true,configurable:true,writable:true,value:i}):e[t]=i;var u=(e,t,i)=>W(e,typeof t!="symbol"?t+"":t,i);async function Te(e){let t=core.JsonUnifier.getLogichValue(e,{});if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await canvas.Assets.load(t.aliases);break;case "lazyload":canvas.Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await canvas.Assets.loadBundle(t.aliases);break;case "lazyload":canvas.Assets.backgroundLoadBundle(t.aliases);break}break}}var o;(s=>(s.log=(c,...p)=>console.log(`[Pixi\u2019VN Json] ${c}`,...p),s.warn=(c,...p)=>console.warn(`[Pixi\u2019VN Json] ${c}`,...p),s.error=(c,...p)=>console.error(`[Pixi\u2019VN Json] ${c}`,...p),s.info=(c,...p)=>console.info(`[Pixi\u2019VN Json] ${c}`,...p)))(o||(o={}));async function v(e,t,i){switch(i.type){case "fade":await canvas.showWithFade(t.alias,e,i.props,i.priority);break;case "dissolve":await canvas.showWithDissolve(t.alias,e,i.props,i.priority);break;case "movein":case "moveout":await canvas.moveIn(t.alias,e,i.props,i.priority);break;case "zoomin":case "zoomout":await canvas.zoomIn(t.alias,e,i.props,i.priority);break;case "pushin":case "pushout":await canvas.pushIn(t.alias,e,i.props,i.priority);break}}function P(e){if(e.transition)switch(e.transition.type){case "fade":canvas.removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":canvas.removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":canvas.moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":canvas.zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":canvas.pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.canvas.remove(e.alias);}async function Le(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.ImageSprite(e.props,e.url||e.alias);await v(t,e,e.transition);}else await canvas.showImage(e.alias,e.url,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):o.error(`Image with alias ${e.alias} not found.`);break}case "remove":P(e);break}}async function Ie(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.VideoSprite(e.props,e.url||e.alias);await v(t,e,e.transition);}else await canvas.showVideo(e.alias,e.url,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):o.error(`Video with alias ${e.alias} not found.`);break}case "remove":P(e);break;case "pause":case "resume":{let t=canvas.canvas.find(e.alias);t?t.paused=e.operationType==="pause":o.error(`Video with alias ${e.alias} not found.`);break}}}async function Ee(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.ImageContainer(e.props,e.urls);await v(t,e,e.transition);}else await canvas.showImageContainer(e.alias,e.urls,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):o.error(`ImageContainer with alias ${e.alias} not found.`);break}case "remove":P(e);break}}async function Re(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=translator.translator.t(e.text),e.transition){let t=new canvas.Text(e.props);await v(t,e,e.transition);}else canvas.showText(e.alias,e.text,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):o.error(`Text with alias ${e.alias} not found.`);break}case "remove":P(e);break}}async function ze(e){switch(e.operationType){case "edit":try{let t=canvas.canvas.find(e.alias);t?e.props&&t.setMemory({...t.memory,...e.props}):o.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){o.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":P(e);break}}async function Me(e){e.type==="shake"&&await canvas.shakeEffect(e.alias,e.props,e.priority);}function _e(e){switch(e.type){case "animate":canvas.canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function De(e){switch(e.type){case "input":narration.narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.narration.dialogue=void 0;break}}function We(e){switch(e.operationType){case "play":e.url?sound.sound.play(e.alias,e.url,e.props):sound.sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.sound.stop(e.alias);break;case "all":sound.sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.sound.pause(e.alias);break;case "channel":sound.sound.findChannel(e.alias).pauseAll();break;case "all":sound.sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.sound.resume(e.alias);break;case "channel":sound.sound.findChannel(e.alias).resumeAll();break;case "all":sound.sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,i])=>{let a=sound.sound.find(e.alias);a&&(t==="volume"?a.volume.value=i:a.paused=i);});break}}var J="___param___";var n=class n{static init(t){t.loadAssets&&(n._loadAssets=t.loadAssets),t.soundOperation&&(n._soundOperation=t.soundOperation),t.imageOperation&&(n._imageOperation=t.imageOperation),t.videoOperation&&(n._videoOperation=t.videoOperation),t.imageContainerOperation&&(n._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(n._textOperation=t.textOperation),t.canvasElementOperation&&(n._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(n._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(n._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(n._narrationOperation=t.narrationOperation),t.effectOperation&&(n._effectOperation=t.effectOperation),t.animateOperation&&(n._animateOperation=t.animateOperation),t.getLogichValue&&(n._getLogichValue=t.getLogichValue),t.getConditionalStep&&(n._getConditionalStep=t.getConditionalStep);}static get loadAssets(){return n._loadAssets}static get soundOperation(){return n._soundOperation}static get imageOperation(){return n._imageOperation}static get videoOperation(){return n._videoOperation}static get imageContainerOperation(){return n._imageContainerOperation}static get textOperation(){return n._textOperation}static get canvasElementOperation(){return n._canvasElementOperation}static get setStorageValue(){return n._setStorageValue}static get setInitialStorageValue(){return n._setInitialStorageValue}static get narrationOperation(){return n._narrationOperation}static get effectOperation(){return n._effectOperation}static get animateOperation(){return n._animateOperation}static get getLogichValue(){return n._getLogichValue}static get getConditionalStep(){return n._getConditionalStep}};u(n,"_loadAssets",()=>{}),u(n,"_soundOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_imageOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_videoOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_imageContainerOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_textOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_canvasElementOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_setStorageValue",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_setInitialStorageValue",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_narrationOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_effectOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_animateOperation",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_getLogichValue",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),u(n,"_getConditionalStep",()=>{throw o.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")});var h=n;function R(e,t){if(t&&typeof t=="object"&&typeof e.functionName=="string"&&e.functionName in t){let i=t[e.functionName];if(typeof i=="function"){let a=e.args.map(s=>h.getLogichValue(s,t));return i(...a)}else o.warn(`getLogichValue function ${e.functionName} not found in props`);}}function z(e,t){let i=core.JsonUnifier.getLogichValue(e,t);return i&&typeof i=="object"&&"type"in i?core.JsonUnifier.getLogichValue(i,t):i}function gi(e,t={}){let i=z(e.value,t);switch(e.storageType){case "flagStorage":storage.storage.setFlag(e.key,e.value);break;case "storage":storage.storage.set(e.key,i);break;case "tempstorage":storage.storage.setTempVariable(e.key,i);break;case "params":{let a=storage.storage.get(`${J}${narration.narration.openedLabels.length-1}`)||[];a.length>e.key&&(a[e.key]=i),storage.storage.setTempVariable(`${J}${narration.narration.openedLabels.length-1}`,a);break}}}function xi(e,t={}){let i=z(e.value,t);switch(e.storageType){case "storage":case "tempstorage":storage.storage.default={[e.key]:i};break}}function xe(e,t={}){let i=Ne(e,t);if(i&&typeof i=="object"&&"type"in i)switch(i.type){case "value":return fe(i,t);case "arithmetic":case "arithmeticsingle":return Ve(i,t);case "compare":case "union":return ye(i,t);case "function":return R(i,t)}return i}function Ve(e,t){let i=core.JsonUnifier.getLogichValue(e.leftValue,t);switch(e.type){case "arithmetic":{let a=core.JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "*":return i*a;case "/":return i/a;case "+":return typeof i=="string"||typeof a=="string"?`${i}${a}`:Array.isArray(i)&&Array.isArray(a)?[...i,...a]:Array.isArray(i)?[...i,a]:Array.isArray(a)?[i,...a]:i+a;case "-":if(Array.isArray(i)&&Array.isArray(a))return i.filter(s=>!a.includes(s));if(Array.isArray(i))return i.filter(s=>s!==a);if(Array.isArray(a)){o.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return i-a;case "%":return i%a;case "POW":return i**a;case "RANDOM":return narration.narration.getRandomNumber(i,a);case "INTERSECTION":if(Array.isArray(i)&&Array.isArray(a))return i.filter(s=>a.includes(s));o.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:o.warn("getValueFromArithmeticOperations unknown operator",e);return}}case "arithmeticsingle":switch(e.operator){case "INT":return Number(i);case "FLOOR":return Math.floor(i);}break}}function fe(e,t){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.narration.inputValue:storage.storage.get(e.key);case "flagStorage":return storage.storage.getFlag(e.key);case "label":return narration.narration.getTimesLabelOpened(e.label);case "choice":return narration.narration.getTimesChoiceMade(e.index);case "logic":return core.JsonUnifier.getLogichValue(e.operation,t);case "params":{let i=storage.storage.get(`${J}${narration.narration.openedLabels.length-1}`)||[];if(i&&i.length>e.key)return i[e.key];o.warn("getValue params not found");return}}return e}function ye(e,t){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":{let i=core.JsonUnifier.getLogichValue(e.leftValue,t),a=core.JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "==":return Array.isArray(i)&&Array.isArray(a)?i.length===a.length&&i.every(s=>a.includes(s)):i===a;case "!=":return Array.isArray(i)&&Array.isArray(a)?i.length!==a.length||!i.every(s=>a.includes(s)):i!==a;case "<":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)<0:Array.isArray(i)&&Array.isArray(a)?i.length<a.length:i<a;case "<=":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)<=0:Array.isArray(i)&&Array.isArray(a)?i.length<=a.length:i<=a;case ">":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)>0:Array.isArray(i)&&Array.isArray(a)?i.length>a.length:i>a;case ">=":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)>=0:Array.isArray(i)&&Array.isArray(a)?i.length>=a.length:i>=a;case "CONTAINS":return Array.isArray(i)&&Array.isArray(a)?a.every(s=>i.includes(s)):Array.isArray(i)?i.includes(a):i.toString().includes(a.toString())}break}case "value":{let i=core.JsonUnifier.getLogichValue(e,t);return Array.isArray(i)?i.length>0:i&&typeof i=="object"?Object.keys(i).length>0:!!i}case "union":return he(e,t)}return !!e}function he(e,t){if(e.unionType==="not"){let a=xe(e.condition,t);return Array.isArray(a)?a.length===0:a&&typeof a=="object"?Object.keys(a).length===0:!a}let i=a=>core.JsonUnifier.getLogichValue(a,t)||false;return e.unionType==="and"?e.conditions.every(i):e.conditions.some(i)}function Pe(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function Ne(e,t={}){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return ve(e,t);case "ifelse":return core.JsonUnifier.getLogichValue(e.condition,t)?core.JsonUnifier.getLogichValue(e.then,t):core.JsonUnifier.getLogichValue(e.else,t);case "stepswitch":{let i=core.JsonUnifier.getLogichValue(e.elements,t)||[];if(i.length===0){o.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":{let a=Pe(0,i.length-1);return core.JsonUnifier.getLogichValue(i[a],t)}case "loop":{let a=narration.NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return a>i.length-1?(a=a%i.length,core.JsonUnifier.getLogichValue(i[a],t)):core.JsonUnifier.getLogichValue(i[a],t)}case "sequential":{let a,s=narration.NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end==="lastItem"&&(a=core.JsonUnifier.getLogichValue(i[i.length-1],t)),s>i.length-1?a:core.JsonUnifier.getLogichValue(i[s],t)}case "sequentialrandom":{let a=narration.NarrationManagerStatic.getRandomNumber(0,i.length-1,{nestedId:e.nestedId,onceOnly:true});if(a===void 0&&e.end==="lastItem"){let s=narration.NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!s?.usedRandomNumbers){o.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let c=s.usedRandomNumbers[`0-${i.length-1}`];return core.JsonUnifier.getLogichValue(i[c[c.length-1]],t)}if(a===void 0){o.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return core.JsonUnifier.getLogichValue(i[a],t)}}}}return e}function M(e,t={}){if(e.conditionalStep){let i=pixiVn.createExportableElement(core.JsonUnifier.getLogichValue(e.conditionalStep,t));if(i?.glueEnabled===void 0&&delete i?.glueEnabled,i?.goNextStep===void 0&&delete i?.goNextStep,i?.end===void 0&&delete i?.end,i?.choices===void 0&&delete i?.choices,i?.dialogue===void 0&&delete i?.dialogue,i?.labelToOpen===void 0&&delete i?.labelToOpen,i?.operations===void 0&&delete i?.operations,i){let a={...e,conditionalStep:void 0,...i};return M(a,t)}else narration.narration.dialogGlue&&(narration.narration.dialogGlue=false);}return e}function ve(e,t){let i=e.firstItem,a=(e.secondConditionalItem??[]).flatMap(c=>Array.isArray(c)?c.map(p=>core.JsonUnifier.getLogichValue(p,t)):[core.JsonUnifier.getLogichValue(c,t)]),s=i?[i,...a]:a;if(s.length===0){o.warn("combinateResult toCheck.length === 0");return}if(typeof s[0]=="string")return translator.translator.t(s);if(typeof s[0]=="object"){let c=s,p,C=false,O=c.map((l,y)=>{l=M(l,t);let d=core.JsonUnifier.getLogichValue(l.dialogue,t)||"";return y===0?(p=core.JsonUnifier.getLogichValue(l.glueEnabled,t)||false,d):(typeof d=="object"&&"text"in d&&(d=`${d.character}: ${d.text}`),p===false&&C&&(d=`
1
+ 'use strict';var core=require('@drincs/pixi-vn-json/core'),canvas=require('@drincs/pixi-vn/canvas'),translator=require('@drincs/pixi-vn-json/translator'),narration=require('@drincs/pixi-vn/narration'),sound=require('@drincs/pixi-vn/sound'),pixiVn=require('@drincs/pixi-vn'),storage=require('@drincs/pixi-vn/storage');async function Je(e){let t=core.JsonUnifier.getLogichValue(e,{});if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await canvas.Assets.load(t.aliases);break;case "lazyload":canvas.Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await canvas.Assets.loadBundle(t.aliases);break;case "lazyload":canvas.Assets.backgroundLoadBundle(t.aliases);break}break}}var a;(o=>(o.log=(r,...c)=>console.log(`[Pixi\u2019VN Json] ${r}`,...c),o.warn=(r,...c)=>console.warn(`[Pixi\u2019VN Json] ${r}`,...c),o.error=(r,...c)=>console.error(`[Pixi\u2019VN Json] ${r}`,...c),o.info=(r,...c)=>console.info(`[Pixi\u2019VN Json] ${r}`,...c)))(a||={});async function b(e,t,i){switch(i.type){case "fade":await canvas.showWithFade(t.alias,e,i.props,i.priority);break;case "dissolve":await canvas.showWithDissolve(t.alias,e,i.props,i.priority);break;case "movein":case "moveout":await canvas.moveIn(t.alias,e,i.props,i.priority);break;case "zoomin":case "zoomout":await canvas.zoomIn(t.alias,e,i.props,i.priority);break;case "pushin":case "pushout":await canvas.pushIn(t.alias,e,i.props,i.priority);break}}function v(e){if(e.transition)switch(e.transition.type){case "fade":canvas.removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":canvas.removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":canvas.moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":canvas.zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":canvas.pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.canvas.remove(e.alias);}async function Oe(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.ImageSprite(e.props,e.url||e.alias);await b(t,e,e.transition);}else await canvas.showImage(e.alias,e.url,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Image with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Ae(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.VideoSprite(e.props,e.url||e.alias);await b(t,e,e.transition);}else await canvas.showVideo(e.alias,e.url,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Video with alias ${e.alias} not found.`);break}case "remove":v(e);break;case "pause":case "resume":{let t=canvas.canvas.find(e.alias);t?t.paused=e.operationType==="pause":a.error(`Video with alias ${e.alias} not found.`);break}}}async function ke(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.ImageContainer(e.props,e.urls);await b(t,e,e.transition);}else await canvas.showImageContainer(e.alias,e.urls,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`ImageContainer with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Le(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=translator.translator.t(e.text),e.transition){let t=new canvas.Text(e.props);await b(t,e,e.transition);}else canvas.showText(e.alias,e.text,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Text with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function je(e){switch(e.operationType){case "edit":try{let t=canvas.canvas.find(e.alias);t?e.props&&t.setMemory({...t.memory,...e.props}):a.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){a.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":v(e);break}}async function Ie(e){e.type==="shake"&&await canvas.shakeEffect(e.alias,e.props,e.priority);}function Ee(e){switch(e.type){case "animate":canvas.canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function ze(e){switch(e.type){case "input":narration.narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.narration.dialogue=void 0;break}}function $e(e){switch(e.operationType){case "play":e.url?sound.sound.play(e.alias,e.url,e.props):sound.sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.sound.stop(e.alias);break;case "all":sound.sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.sound.pause(e.alias);break;case "channel":sound.sound.findChannel(e.alias).pauseAll();break;case "all":sound.sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.sound.resume(e.alias);break;case "channel":sound.sound.findChannel(e.alias).resumeAll();break;case "all":sound.sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,i])=>{let n=sound.sound.find(e.alias);n&&(t==="volume"?n.volume.value=i:n.paused=i);});break}}var T="___param___";var h=class e{static init(t){t.loadAssets&&(e._loadAssets=t.loadAssets),t.soundOperation&&(e._soundOperation=t.soundOperation),t.imageOperation&&(e._imageOperation=t.imageOperation),t.videoOperation&&(e._videoOperation=t.videoOperation),t.imageContainerOperation&&(e._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(e._textOperation=t.textOperation),t.canvasElementOperation&&(e._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(e._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(e._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(e._narrationOperation=t.narrationOperation),t.effectOperation&&(e._effectOperation=t.effectOperation),t.animateOperation&&(e._animateOperation=t.animateOperation),t.getLogichValue&&(e._getLogichValue=t.getLogichValue),t.getConditionalStep&&(e._getConditionalStep=t.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._soundOperation}static _imageOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._imageOperation}static _videoOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._videoOperation}static _imageContainerOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._imageContainerOperation}static _textOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._textOperation}static _canvasElementOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._canvasElementOperation}static _setStorageValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._setStorageValue}static _setInitialStorageValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._setInitialStorageValue}static _narrationOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._narrationOperation}static _effectOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._effectOperation}static _animateOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._animateOperation}static _getLogichValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._getLogichValue}static _getConditionalStep=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._getConditionalStep}};function _(e,t){if(t&&typeof t=="object"&&typeof e.functionName=="string"&&e.functionName in t){let i=t[e.functionName];if(typeof i=="function"){let n=e.args.map(o=>h.getLogichValue(o,t));return i(...n)}else a.warn(`getLogichValue function ${e.functionName} not found in props`);}}function z(e,t){let i=core.JsonUnifier.getLogichValue(e,t);return i&&typeof i=="object"&&"type"in i?core.JsonUnifier.getLogichValue(i,t):i}function ci(e,t={}){let i=z(e.value,t);switch(e.storageType){case "flagStorage":storage.storage.setFlag(e.key,e.value);break;case "storage":storage.storage.set(e.key,i);break;case "tempstorage":storage.storage.setTempVariable(e.key,i);break;case "params":{let n=storage.storage.get(`${T}${narration.narration.openedLabels.length-1}`)||[];n.length>e.key&&(n[e.key]=i),storage.storage.setTempVariable(`${T}${narration.narration.openedLabels.length-1}`,n);break}}}function ui(e,t={}){let i=z(e.value,t);switch(e.storageType){case "storage":case "tempstorage":storage.storage.default={[e.key]:i};break}}function k(e,t={}){let i=L(e,t);if(i&&typeof i=="object"&&"type"in i)switch(i.type){case "value":return ge(i,t);case "arithmetic":case "arithmeticsingle":return me(i,t);case "compare":case "union":return xe(i,t);case "function":return _(i,t)}return i}function me(e,t){let i=core.JsonUnifier.getLogichValue(e.leftValue,t);switch(e.type){case "arithmetic":{let n=core.JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "*":return i*n;case "/":return i/n;case "+":return typeof i=="string"||typeof n=="string"?`${i}${n}`:Array.isArray(i)&&Array.isArray(n)?[...i,...n]:Array.isArray(i)?[...i,n]:Array.isArray(n)?[i,...n]:i+n;case "-":if(Array.isArray(i)&&Array.isArray(n))return i.filter(o=>!n.includes(o));if(Array.isArray(i))return i.filter(o=>o!==n);if(Array.isArray(n)){a.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return i-n;case "%":return i%n;case "POW":return i**n;case "RANDOM":return narration.narration.getRandomNumber(i,n);case "INTERSECTION":if(Array.isArray(i)&&Array.isArray(n))return i.filter(o=>n.includes(o));a.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:a.warn("getValueFromArithmeticOperations unknown operator",e);return}}case "arithmeticsingle":switch(e.operator){case "INT":return Number(i);case "FLOOR":return Math.floor(i);}break}}function ge(e,t){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.narration.inputValue:storage.storage.get(e.key);case "flagStorage":return storage.storage.getFlag(e.key);case "label":return narration.narration.getTimesLabelOpened(e.label);case "choice":return narration.narration.getTimesChoiceMade(e.index);case "logic":return core.JsonUnifier.getLogichValue(e.operation,t);case "params":{let i=storage.storage.get(`${T}${narration.narration.openedLabels.length-1}`)||[];if(i&&i.length>e.key)return i[e.key];a.warn("getValue params not found");return}}return e}function xe(e,t){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":{let i=core.JsonUnifier.getLogichValue(e.leftValue,t),n=core.JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "==":return Array.isArray(i)&&Array.isArray(n)?i.length===n.length&&i.every(o=>n.includes(o)):i===n;case "!=":return Array.isArray(i)&&Array.isArray(n)?i.length!==n.length||!i.every(o=>n.includes(o)):i!==n;case "<":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)<0:Array.isArray(i)&&Array.isArray(n)?i.length<n.length:i<n;case "<=":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)<=0:Array.isArray(i)&&Array.isArray(n)?i.length<=n.length:i<=n;case ">":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)>0:Array.isArray(i)&&Array.isArray(n)?i.length>n.length:i>n;case ">=":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)>=0:Array.isArray(i)&&Array.isArray(n)?i.length>=n.length:i>=n;case "CONTAINS":return Array.isArray(i)&&Array.isArray(n)?n.every(o=>i.includes(o)):Array.isArray(i)?i.includes(n):i.toString().includes(n.toString())}break}case "value":{let i=core.JsonUnifier.getLogichValue(e,t);return Array.isArray(i)?i.length>0:i&&typeof i=="object"?Object.keys(i).length>0:!!i}case "union":return Ve(e,t)}return !!e}function Ve(e,t){if(e.unionType==="not"){let n=k(e.condition,t);return Array.isArray(n)?n.length===0:n&&typeof n=="object"?Object.keys(n).length===0:!n}let i=n=>core.JsonUnifier.getLogichValue(n,t)||false;return e.unionType==="and"?e.conditions.every(i):e.conditions.some(i)}function fe(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function L(e,t={}){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return ye(e,t);case "ifelse":return core.JsonUnifier.getLogichValue(e.condition,t)?core.JsonUnifier.getLogichValue(e.then,t):core.JsonUnifier.getLogichValue(e.else,t);case "stepswitch":{let i=core.JsonUnifier.getLogichValue(e.elements,t)||[];if(i.length===0){a.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":{let n=fe(0,i.length-1);return core.JsonUnifier.getLogichValue(i[n],t)}case "loop":{let n=narration.NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return n>i.length-1?(n=n%i.length,core.JsonUnifier.getLogichValue(i[n],t)):core.JsonUnifier.getLogichValue(i[n],t)}case "sequential":{let n,o=narration.NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end==="lastItem"&&(n=core.JsonUnifier.getLogichValue(i[i.length-1],t)),o>i.length-1?n:core.JsonUnifier.getLogichValue(i[o],t)}case "sequentialrandom":{let n=narration.NarrationManagerStatic.getRandomNumber(0,i.length-1,{nestedId:e.nestedId,onceOnly:true});if(n===void 0&&e.end==="lastItem"){let o=narration.NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!o?.usedRandomNumbers){a.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let r=o.usedRandomNumbers[`0-${i.length-1}`];return core.JsonUnifier.getLogichValue(i[r[r.length-1]],t)}if(n===void 0){a.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return core.JsonUnifier.getLogichValue(i[n],t)}}}}return e}function M(e,t={}){if(e.conditionalStep){let i=pixiVn.createExportableElement(core.JsonUnifier.getLogichValue(e.conditionalStep,t));if(i?.glueEnabled===void 0&&delete i?.glueEnabled,i?.goNextStep===void 0&&delete i?.goNextStep,i?.end===void 0&&delete i?.end,i?.choices===void 0&&delete i?.choices,i?.dialogue===void 0&&delete i?.dialogue,i?.labelToOpen===void 0&&delete i?.labelToOpen,i?.operations===void 0&&delete i?.operations,i){let n={...e,conditionalStep:void 0,...i};return M(n,t)}else narration.narration.dialogGlue&&(narration.narration.dialogGlue=false);}return e}function ye(e,t){let i=e.firstItem,n=(e.secondConditionalItem??[]).flatMap(r=>Array.isArray(r)?r.map(c=>core.JsonUnifier.getLogichValue(c,t)):[core.JsonUnifier.getLogichValue(r,t)]),o=i?[i,...n]:n;if(o.length===0){a.warn("combinateResult toCheck.length === 0");return}if(typeof o[0]=="string")return translator.translator.t(o);if(typeof o[0]=="object"){let r=o,c,P=false,N=r.map((l,f)=>{l=M(l,t);let u=core.JsonUnifier.getLogichValue(l.dialogue,t)||"";return f===0?(c=core.JsonUnifier.getLogichValue(l.glueEnabled,t)||false,u):(typeof u=="object"&&"text"in u&&(u=`${u.character}: ${u.text}`),c===false&&P&&(u=`
2
2
 
3
- ${d}`),d&&(C=true),p=core.JsonUnifier.getLogichValue(l.glueEnabled,t)||false,d)}),w=core.JsonUnifier.getLogichValue(O[0],t),A=typeof w=="object"&&"character"in w?w.character:void 0,k=O.flatMap(l=>{let y;l&&typeof l=="object"&&"text"in l?y=l.text:y=l;let d;return Array.isArray(y)?d=y.map(D=>{let F=core.JsonUnifier.getLogichValue(D,t);return translator.translator.t(`${F}`)}):d=core.JsonUnifier.getLogichValue(y,t)||"",translator.translator.t(d)}),_=c.find(l=>l.end),$=c.find(l=>l.choices),j=false,L=false;c.length>0&&(c[0].glueEnabled&&c[0].goNextStep&&c[0].dialogue===void 0&&(narration.narration.dialogGlue=true),j=c[c.length-1].glueEnabled,L=c.reverse().find(l=>!(l.operations&&(!l.dialogue||!l.choices)))?.goNextStep);let G=c.find(l=>l.labelToOpen),b=[];return c.forEach(l=>{l.operations&&(b=[...b,...l.operations]);}),{dialogue:A?{character:A,text:k}:k,end:_?.end,choices:$?.choices,glueEnabled:j,goNextStep:L,labelToOpen:G?.labelToOpen,operations:b}}}exports.animateOperation=_e;exports.canvasElementOperation=ze;exports.effectOperation=Me;exports.getConditionalStep=M;exports.getLogichValue=xe;exports.getValueFromConditionalStatements=Ne;exports.imageContainerOperation=Ee;exports.imageOperation=Le;exports.loadAssets=Te;exports.narrationOperation=De;exports.setInitialStorageValue=xi;exports.setStorageValue=gi;exports.soundOperation=We;exports.textOperation=Re;exports.videoOperation=Ie;
3
+ ${u}`),u&&(P=true),c=core.JsonUnifier.getLogichValue(l.glueEnabled,t)||false,u)}),V=core.JsonUnifier.getLogichValue(N[0],t),y=typeof V=="object"&&"character"in V?V.character:void 0,J=N.flatMap(l=>{let f;l&&typeof l=="object"&&"text"in l?f=l.text:f=l;let u;return Array.isArray(f)?u=f.map(F=>{let D=core.JsonUnifier.getLogichValue(F,t);return translator.translator.t(`${D}`)}):u=core.JsonUnifier.getLogichValue(f,t)||"",translator.translator.t(u)}),C=r.find(l=>l.end),G=r.find(l=>l.choices),j=false,I=false;r.length>0&&(r[0].glueEnabled&&r[0].goNextStep&&r[0].dialogue===void 0&&(narration.narration.dialogGlue=true),j=r[r.length-1].glueEnabled,I=r.reverse().find(l=>!(l.operations&&(!l.dialogue||!l.choices)))?.goNextStep);let $=r.find(l=>l.labelToOpen),O=[];return r.forEach(l=>{l.operations&&(O=[...O,...l.operations]);}),{dialogue:y?{character:y,text:J}:J,end:C?.end,choices:G?.choices,glueEnabled:j,goNextStep:I,labelToOpen:$?.labelToOpen,operations:O}}}exports.VariableGetter=void 0;(o=>{let e=new Set;function t(r){e.add(r);}o.add=t;function i(){e.clear();}o.clear=i;function n(r,c={}){let P=y=>k(y,c)??void 0,N=L(r,c);if(e.size===0)return P(N);let V=P;for(let y of e){let J=V;V=C=>y(C,J)??void 0;}return V(N)}o.getLogichValue=n;})(exports.VariableGetter||={});exports.animateOperation=Ee;exports.canvasElementOperation=je;exports.effectOperation=Ie;exports.getConditionalStep=M;exports.getLogichValue=k;exports.getValueFromConditionalStatements=L;exports.imageContainerOperation=ke;exports.imageOperation=Oe;exports.loadAssets=Je;exports.narrationOperation=ze;exports.setInitialStorageValue=ui;exports.setStorageValue=ci;exports.soundOperation=$e;exports.textOperation=Le;exports.videoOperation=Ae;
@@ -1,7 +1,8 @@
1
- import { L as PixiVNJsonOperation, A as PixiVNJsonIfElse, M as PixiVNJsonOperationString, f as PixiVNJsonCanvasAnimate, _ as PixiVNJsonUnknownEdit, k as PixiVNJsonCanvasRemove, h as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, B as PixiVNJsonImageContainerEdit, j as PixiVNJsonCanvasImageVideoShow, C as PixiVNJsonImageEdit, m as PixiVNJsonCanvasTextShow, Y as PixiVNJsonTextEdit, a1 as PixiVNJsonVideoEdit, a2 as PixiVNJsonVideoPauseResume, J as PixiVNJsonNarration, O as PixiVNJsonSound, F as PixiVNJsonLabelStep, $ as PixiVNJsonValueGet, b as PixiVNJsonArithmeticOperations, v as PixiVNJsonConditions, z as PixiVNJsonFunction, u as PixiVNJsonConditionalStatements, t as PixiVNJsonConditionalResultToCombine, K as PixiVNJsonOnlyStorageSet, a0 as PixiVNJsonValueSet } from './PixiVNJsonLabelStep-DJgORyFd.cjs';
1
+ import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, r as PixiVNJsonCanvasAnimate, m as PixiVNJsonUnknownEdit, f as PixiVNJsonCanvasRemove, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, p as PixiVNJsonNarration, c as PixiVNJsonSound, w as PixiVNJsonLabelStep, s as PixiVNJsonValueGet, t as PixiVNJsonArithmeticOperations, u as PixiVNJsonConditions, O as PixiVNJsonFunction, v as PixiVNJsonConditionalStatements, K as PixiVNJsonConditionalResultToCombine, o as PixiVNJsonOnlyStorageSet, n as PixiVNJsonValueSet } from './PixiVNJsonLabelStep-BsGHNfkq.cjs';
2
2
  import { ImageSpriteMemory, VideoSpriteMemory, ContainerMemory, ContainerChild } from '@drincs/pixi-vn/canvas';
3
3
  import { StepLabelPropsType } from '@drincs/pixi-vn/narration';
4
4
  import { StorageElementType } from '@drincs/pixi-vn/storage';
5
+ export { V as VariableGetter, a as VariableGetterHandler } from './VariableGetter-ZDA6kdah.cjs';
5
6
  import '@drincs/pixi-vn';
6
7
  import '@drincs/pixi-vn/motion';
7
8
  import 'pixi.js';
package/dist/actions.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { L as PixiVNJsonOperation, A as PixiVNJsonIfElse, M as PixiVNJsonOperationString, f as PixiVNJsonCanvasAnimate, _ as PixiVNJsonUnknownEdit, k as PixiVNJsonCanvasRemove, h as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, B as PixiVNJsonImageContainerEdit, j as PixiVNJsonCanvasImageVideoShow, C as PixiVNJsonImageEdit, m as PixiVNJsonCanvasTextShow, Y as PixiVNJsonTextEdit, a1 as PixiVNJsonVideoEdit, a2 as PixiVNJsonVideoPauseResume, J as PixiVNJsonNarration, O as PixiVNJsonSound, F as PixiVNJsonLabelStep, $ as PixiVNJsonValueGet, b as PixiVNJsonArithmeticOperations, v as PixiVNJsonConditions, z as PixiVNJsonFunction, u as PixiVNJsonConditionalStatements, t as PixiVNJsonConditionalResultToCombine, K as PixiVNJsonOnlyStorageSet, a0 as PixiVNJsonValueSet } from './PixiVNJsonLabelStep-DJgORyFd.js';
1
+ import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, r as PixiVNJsonCanvasAnimate, m as PixiVNJsonUnknownEdit, f as PixiVNJsonCanvasRemove, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, p as PixiVNJsonNarration, c as PixiVNJsonSound, w as PixiVNJsonLabelStep, s as PixiVNJsonValueGet, t as PixiVNJsonArithmeticOperations, u as PixiVNJsonConditions, O as PixiVNJsonFunction, v as PixiVNJsonConditionalStatements, K as PixiVNJsonConditionalResultToCombine, o as PixiVNJsonOnlyStorageSet, n as PixiVNJsonValueSet } from './PixiVNJsonLabelStep-BsGHNfkq.js';
2
2
  import { ImageSpriteMemory, VideoSpriteMemory, ContainerMemory, ContainerChild } from '@drincs/pixi-vn/canvas';
3
3
  import { StepLabelPropsType } from '@drincs/pixi-vn/narration';
4
4
  import { StorageElementType } from '@drincs/pixi-vn/storage';
5
+ export { V as VariableGetter, a as VariableGetterHandler } from './VariableGetter-ZDA6kdah.js';
5
6
  import '@drincs/pixi-vn';
6
7
  import '@drincs/pixi-vn/motion';
7
8
  import 'pixi.js';
package/dist/actions.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import {JsonUnifier}from'@drincs/pixi-vn-json/core';import {Assets,canvas,ImageSprite,showImage,VideoSprite,showVideo,ImageContainer,showImageContainer,Text,showText,shakeEffect,pushOut,zoomOut,moveOut,removeWithDissolve,removeWithFade,pushIn,zoomIn,moveIn,showWithDissolve,showWithFade}from'@drincs/pixi-vn/canvas';import {translator}from'@drincs/pixi-vn-json/translator';import {narration,NarrationManagerStatic}from'@drincs/pixi-vn/narration';import {sound}from'@drincs/pixi-vn/sound';import {PixiError,createExportableElement}from'@drincs/pixi-vn';import {storage}from'@drincs/pixi-vn/storage';var q=Object.defineProperty;var W=(e,t,i)=>t in e?q(e,t,{enumerable:true,configurable:true,writable:true,value:i}):e[t]=i;var u=(e,t,i)=>W(e,typeof t!="symbol"?t+"":t,i);async function Te(e){let t=JsonUnifier.getLogichValue(e,{});if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await Assets.load(t.aliases);break;case "lazyload":Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await Assets.loadBundle(t.aliases);break;case "lazyload":Assets.backgroundLoadBundle(t.aliases);break}break}}var o;(s=>(s.log=(c,...p)=>console.log(`[Pixi\u2019VN Json] ${c}`,...p),s.warn=(c,...p)=>console.warn(`[Pixi\u2019VN Json] ${c}`,...p),s.error=(c,...p)=>console.error(`[Pixi\u2019VN Json] ${c}`,...p),s.info=(c,...p)=>console.info(`[Pixi\u2019VN Json] ${c}`,...p)))(o||(o={}));async function v(e,t,i){switch(i.type){case "fade":await showWithFade(t.alias,e,i.props,i.priority);break;case "dissolve":await showWithDissolve(t.alias,e,i.props,i.priority);break;case "movein":case "moveout":await moveIn(t.alias,e,i.props,i.priority);break;case "zoomin":case "zoomout":await zoomIn(t.alias,e,i.props,i.priority);break;case "pushin":case "pushout":await pushIn(t.alias,e,i.props,i.priority);break}}function P(e){if(e.transition)switch(e.transition.type){case "fade":removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.remove(e.alias);}async function Le(e){switch(e.operationType){case "show":if(e.transition){let t=new ImageSprite(e.props,e.url||e.alias);await v(t,e,e.transition);}else await showImage(e.alias,e.url,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):o.error(`Image with alias ${e.alias} not found.`);break}case "remove":P(e);break}}async function Ie(e){switch(e.operationType){case "show":if(e.transition){let t=new VideoSprite(e.props,e.url||e.alias);await v(t,e,e.transition);}else await showVideo(e.alias,e.url,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):o.error(`Video with alias ${e.alias} not found.`);break}case "remove":P(e);break;case "pause":case "resume":{let t=canvas.find(e.alias);t?t.paused=e.operationType==="pause":o.error(`Video with alias ${e.alias} not found.`);break}}}async function Ee(e){switch(e.operationType){case "show":if(e.transition){let t=new ImageContainer(e.props,e.urls);await v(t,e,e.transition);}else await showImageContainer(e.alias,e.urls,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):o.error(`ImageContainer with alias ${e.alias} not found.`);break}case "remove":P(e);break}}async function Re(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=translator.t(e.text),e.transition){let t=new Text(e.props);await v(t,e,e.transition);}else showText(e.alias,e.text,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):o.error(`Text with alias ${e.alias} not found.`);break}case "remove":P(e);break}}async function ze(e){switch(e.operationType){case "edit":try{let t=canvas.find(e.alias);t?e.props&&t.setMemory({...t.memory,...e.props}):o.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){o.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":P(e);break}}async function Me(e){e.type==="shake"&&await shakeEffect(e.alias,e.props,e.priority);}function _e(e){switch(e.type){case "animate":canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function De(e){switch(e.type){case "input":narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.dialogue=void 0;break}}function We(e){switch(e.operationType){case "play":e.url?sound.play(e.alias,e.url,e.props):sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.stop(e.alias);break;case "all":sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.pause(e.alias);break;case "channel":sound.findChannel(e.alias).pauseAll();break;case "all":sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.resume(e.alias);break;case "channel":sound.findChannel(e.alias).resumeAll();break;case "all":sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,i])=>{let a=sound.find(e.alias);a&&(t==="volume"?a.volume.value=i:a.paused=i);});break}}var J="___param___";var n=class n{static init(t){t.loadAssets&&(n._loadAssets=t.loadAssets),t.soundOperation&&(n._soundOperation=t.soundOperation),t.imageOperation&&(n._imageOperation=t.imageOperation),t.videoOperation&&(n._videoOperation=t.videoOperation),t.imageContainerOperation&&(n._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(n._textOperation=t.textOperation),t.canvasElementOperation&&(n._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(n._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(n._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(n._narrationOperation=t.narrationOperation),t.effectOperation&&(n._effectOperation=t.effectOperation),t.animateOperation&&(n._animateOperation=t.animateOperation),t.getLogichValue&&(n._getLogichValue=t.getLogichValue),t.getConditionalStep&&(n._getConditionalStep=t.getConditionalStep);}static get loadAssets(){return n._loadAssets}static get soundOperation(){return n._soundOperation}static get imageOperation(){return n._imageOperation}static get videoOperation(){return n._videoOperation}static get imageContainerOperation(){return n._imageContainerOperation}static get textOperation(){return n._textOperation}static get canvasElementOperation(){return n._canvasElementOperation}static get setStorageValue(){return n._setStorageValue}static get setInitialStorageValue(){return n._setInitialStorageValue}static get narrationOperation(){return n._narrationOperation}static get effectOperation(){return n._effectOperation}static get animateOperation(){return n._animateOperation}static get getLogichValue(){return n._getLogichValue}static get getConditionalStep(){return n._getConditionalStep}};u(n,"_loadAssets",()=>{}),u(n,"_soundOperation",()=>{throw o.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.")}),u(n,"_imageOperation",()=>{throw o.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.")}),u(n,"_videoOperation",()=>{throw o.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.")}),u(n,"_imageContainerOperation",()=>{throw o.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.")}),u(n,"_textOperation",()=>{throw o.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.")}),u(n,"_canvasElementOperation",()=>{throw o.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.")}),u(n,"_setStorageValue",()=>{throw o.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.")}),u(n,"_setInitialStorageValue",()=>{throw o.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.")}),u(n,"_narrationOperation",()=>{throw o.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.")}),u(n,"_effectOperation",()=>{throw o.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.")}),u(n,"_animateOperation",()=>{throw o.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.")}),u(n,"_getLogichValue",()=>{throw o.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.")}),u(n,"_getConditionalStep",()=>{throw o.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.")});var h=n;function R(e,t){if(t&&typeof t=="object"&&typeof e.functionName=="string"&&e.functionName in t){let i=t[e.functionName];if(typeof i=="function"){let a=e.args.map(s=>h.getLogichValue(s,t));return i(...a)}else o.warn(`getLogichValue function ${e.functionName} not found in props`);}}function z(e,t){let i=JsonUnifier.getLogichValue(e,t);return i&&typeof i=="object"&&"type"in i?JsonUnifier.getLogichValue(i,t):i}function gi(e,t={}){let i=z(e.value,t);switch(e.storageType){case "flagStorage":storage.setFlag(e.key,e.value);break;case "storage":storage.set(e.key,i);break;case "tempstorage":storage.setTempVariable(e.key,i);break;case "params":{let a=storage.get(`${J}${narration.openedLabels.length-1}`)||[];a.length>e.key&&(a[e.key]=i),storage.setTempVariable(`${J}${narration.openedLabels.length-1}`,a);break}}}function xi(e,t={}){let i=z(e.value,t);switch(e.storageType){case "storage":case "tempstorage":storage.default={[e.key]:i};break}}function xe(e,t={}){let i=Ne(e,t);if(i&&typeof i=="object"&&"type"in i)switch(i.type){case "value":return fe(i,t);case "arithmetic":case "arithmeticsingle":return Ve(i,t);case "compare":case "union":return ye(i,t);case "function":return R(i,t)}return i}function Ve(e,t){let i=JsonUnifier.getLogichValue(e.leftValue,t);switch(e.type){case "arithmetic":{let a=JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "*":return i*a;case "/":return i/a;case "+":return typeof i=="string"||typeof a=="string"?`${i}${a}`:Array.isArray(i)&&Array.isArray(a)?[...i,...a]:Array.isArray(i)?[...i,a]:Array.isArray(a)?[i,...a]:i+a;case "-":if(Array.isArray(i)&&Array.isArray(a))return i.filter(s=>!a.includes(s));if(Array.isArray(i))return i.filter(s=>s!==a);if(Array.isArray(a)){o.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return i-a;case "%":return i%a;case "POW":return i**a;case "RANDOM":return narration.getRandomNumber(i,a);case "INTERSECTION":if(Array.isArray(i)&&Array.isArray(a))return i.filter(s=>a.includes(s));o.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:o.warn("getValueFromArithmeticOperations unknown operator",e);return}}case "arithmeticsingle":switch(e.operator){case "INT":return Number(i);case "FLOOR":return Math.floor(i);}break}}function fe(e,t){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.inputValue:storage.get(e.key);case "flagStorage":return storage.getFlag(e.key);case "label":return narration.getTimesLabelOpened(e.label);case "choice":return narration.getTimesChoiceMade(e.index);case "logic":return JsonUnifier.getLogichValue(e.operation,t);case "params":{let i=storage.get(`${J}${narration.openedLabels.length-1}`)||[];if(i&&i.length>e.key)return i[e.key];o.warn("getValue params not found");return}}return e}function ye(e,t){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":{let i=JsonUnifier.getLogichValue(e.leftValue,t),a=JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "==":return Array.isArray(i)&&Array.isArray(a)?i.length===a.length&&i.every(s=>a.includes(s)):i===a;case "!=":return Array.isArray(i)&&Array.isArray(a)?i.length!==a.length||!i.every(s=>a.includes(s)):i!==a;case "<":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)<0:Array.isArray(i)&&Array.isArray(a)?i.length<a.length:i<a;case "<=":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)<=0:Array.isArray(i)&&Array.isArray(a)?i.length<=a.length:i<=a;case ">":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)>0:Array.isArray(i)&&Array.isArray(a)?i.length>a.length:i>a;case ">=":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)>=0:Array.isArray(i)&&Array.isArray(a)?i.length>=a.length:i>=a;case "CONTAINS":return Array.isArray(i)&&Array.isArray(a)?a.every(s=>i.includes(s)):Array.isArray(i)?i.includes(a):i.toString().includes(a.toString())}break}case "value":{let i=JsonUnifier.getLogichValue(e,t);return Array.isArray(i)?i.length>0:i&&typeof i=="object"?Object.keys(i).length>0:!!i}case "union":return he(e,t)}return !!e}function he(e,t){if(e.unionType==="not"){let a=xe(e.condition,t);return Array.isArray(a)?a.length===0:a&&typeof a=="object"?Object.keys(a).length===0:!a}let i=a=>JsonUnifier.getLogichValue(a,t)||false;return e.unionType==="and"?e.conditions.every(i):e.conditions.some(i)}function Pe(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function Ne(e,t={}){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return ve(e,t);case "ifelse":return JsonUnifier.getLogichValue(e.condition,t)?JsonUnifier.getLogichValue(e.then,t):JsonUnifier.getLogichValue(e.else,t);case "stepswitch":{let i=JsonUnifier.getLogichValue(e.elements,t)||[];if(i.length===0){o.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":{let a=Pe(0,i.length-1);return JsonUnifier.getLogichValue(i[a],t)}case "loop":{let a=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return a>i.length-1?(a=a%i.length,JsonUnifier.getLogichValue(i[a],t)):JsonUnifier.getLogichValue(i[a],t)}case "sequential":{let a,s=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end==="lastItem"&&(a=JsonUnifier.getLogichValue(i[i.length-1],t)),s>i.length-1?a:JsonUnifier.getLogichValue(i[s],t)}case "sequentialrandom":{let a=NarrationManagerStatic.getRandomNumber(0,i.length-1,{nestedId:e.nestedId,onceOnly:true});if(a===void 0&&e.end==="lastItem"){let s=NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!s?.usedRandomNumbers){o.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let c=s.usedRandomNumbers[`0-${i.length-1}`];return JsonUnifier.getLogichValue(i[c[c.length-1]],t)}if(a===void 0){o.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return JsonUnifier.getLogichValue(i[a],t)}}}}return e}function M(e,t={}){if(e.conditionalStep){let i=createExportableElement(JsonUnifier.getLogichValue(e.conditionalStep,t));if(i?.glueEnabled===void 0&&delete i?.glueEnabled,i?.goNextStep===void 0&&delete i?.goNextStep,i?.end===void 0&&delete i?.end,i?.choices===void 0&&delete i?.choices,i?.dialogue===void 0&&delete i?.dialogue,i?.labelToOpen===void 0&&delete i?.labelToOpen,i?.operations===void 0&&delete i?.operations,i){let a={...e,conditionalStep:void 0,...i};return M(a,t)}else narration.dialogGlue&&(narration.dialogGlue=false);}return e}function ve(e,t){let i=e.firstItem,a=(e.secondConditionalItem??[]).flatMap(c=>Array.isArray(c)?c.map(p=>JsonUnifier.getLogichValue(p,t)):[JsonUnifier.getLogichValue(c,t)]),s=i?[i,...a]:a;if(s.length===0){o.warn("combinateResult toCheck.length === 0");return}if(typeof s[0]=="string")return translator.t(s);if(typeof s[0]=="object"){let c=s,p,C=false,O=c.map((l,y)=>{l=M(l,t);let d=JsonUnifier.getLogichValue(l.dialogue,t)||"";return y===0?(p=JsonUnifier.getLogichValue(l.glueEnabled,t)||false,d):(typeof d=="object"&&"text"in d&&(d=`${d.character}: ${d.text}`),p===false&&C&&(d=`
1
+ import {JsonUnifier}from'@drincs/pixi-vn-json/core';import {Assets,canvas,ImageSprite,showImage,VideoSprite,showVideo,ImageContainer,showImageContainer,Text,showText,shakeEffect,pushOut,zoomOut,moveOut,removeWithDissolve,removeWithFade,pushIn,zoomIn,moveIn,showWithDissolve,showWithFade}from'@drincs/pixi-vn/canvas';import {translator}from'@drincs/pixi-vn-json/translator';import {NarrationManagerStatic,narration}from'@drincs/pixi-vn/narration';import {sound}from'@drincs/pixi-vn/sound';import {createExportableElement,PixiError}from'@drincs/pixi-vn';import {storage}from'@drincs/pixi-vn/storage';async function Je(e){let t=JsonUnifier.getLogichValue(e,{});if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await Assets.load(t.aliases);break;case "lazyload":Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await Assets.loadBundle(t.aliases);break;case "lazyload":Assets.backgroundLoadBundle(t.aliases);break}break}}var a;(o=>(o.log=(r,...c)=>console.log(`[Pixi\u2019VN Json] ${r}`,...c),o.warn=(r,...c)=>console.warn(`[Pixi\u2019VN Json] ${r}`,...c),o.error=(r,...c)=>console.error(`[Pixi\u2019VN Json] ${r}`,...c),o.info=(r,...c)=>console.info(`[Pixi\u2019VN Json] ${r}`,...c)))(a||={});async function b(e,t,i){switch(i.type){case "fade":await showWithFade(t.alias,e,i.props,i.priority);break;case "dissolve":await showWithDissolve(t.alias,e,i.props,i.priority);break;case "movein":case "moveout":await moveIn(t.alias,e,i.props,i.priority);break;case "zoomin":case "zoomout":await zoomIn(t.alias,e,i.props,i.priority);break;case "pushin":case "pushout":await pushIn(t.alias,e,i.props,i.priority);break}}function v(e){if(e.transition)switch(e.transition.type){case "fade":removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.remove(e.alias);}async function Oe(e){switch(e.operationType){case "show":if(e.transition){let t=new ImageSprite(e.props,e.url||e.alias);await b(t,e,e.transition);}else await showImage(e.alias,e.url,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Image with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Ae(e){switch(e.operationType){case "show":if(e.transition){let t=new VideoSprite(e.props,e.url||e.alias);await b(t,e,e.transition);}else await showVideo(e.alias,e.url,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Video with alias ${e.alias} not found.`);break}case "remove":v(e);break;case "pause":case "resume":{let t=canvas.find(e.alias);t?t.paused=e.operationType==="pause":a.error(`Video with alias ${e.alias} not found.`);break}}}async function ke(e){switch(e.operationType){case "show":if(e.transition){let t=new ImageContainer(e.props,e.urls);await b(t,e,e.transition);}else await showImageContainer(e.alias,e.urls,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`ImageContainer with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Le(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=translator.t(e.text),e.transition){let t=new Text(e.props);await b(t,e,e.transition);}else showText(e.alias,e.text,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Text with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function je(e){switch(e.operationType){case "edit":try{let t=canvas.find(e.alias);t?e.props&&t.setMemory({...t.memory,...e.props}):a.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){a.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":v(e);break}}async function Ie(e){e.type==="shake"&&await shakeEffect(e.alias,e.props,e.priority);}function Ee(e){switch(e.type){case "animate":canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function ze(e){switch(e.type){case "input":narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.dialogue=void 0;break}}function $e(e){switch(e.operationType){case "play":e.url?sound.play(e.alias,e.url,e.props):sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.stop(e.alias);break;case "all":sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.pause(e.alias);break;case "channel":sound.findChannel(e.alias).pauseAll();break;case "all":sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.resume(e.alias);break;case "channel":sound.findChannel(e.alias).resumeAll();break;case "all":sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,i])=>{let n=sound.find(e.alias);n&&(t==="volume"?n.volume.value=i:n.paused=i);});break}}var T="___param___";var h=class e{static init(t){t.loadAssets&&(e._loadAssets=t.loadAssets),t.soundOperation&&(e._soundOperation=t.soundOperation),t.imageOperation&&(e._imageOperation=t.imageOperation),t.videoOperation&&(e._videoOperation=t.videoOperation),t.imageContainerOperation&&(e._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(e._textOperation=t.textOperation),t.canvasElementOperation&&(e._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(e._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(e._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(e._narrationOperation=t.narrationOperation),t.effectOperation&&(e._effectOperation=t.effectOperation),t.animateOperation&&(e._animateOperation=t.animateOperation),t.getLogichValue&&(e._getLogichValue=t.getLogichValue),t.getConditionalStep&&(e._getConditionalStep=t.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw a.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 e._soundOperation}static _imageOperation=()=>{throw a.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 e._imageOperation}static _videoOperation=()=>{throw a.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 e._videoOperation}static _imageContainerOperation=()=>{throw a.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 e._imageContainerOperation}static _textOperation=()=>{throw a.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 e._textOperation}static _canvasElementOperation=()=>{throw a.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 e._canvasElementOperation}static _setStorageValue=()=>{throw a.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 e._setStorageValue}static _setInitialStorageValue=()=>{throw a.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 e._setInitialStorageValue}static _narrationOperation=()=>{throw a.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 e._narrationOperation}static _effectOperation=()=>{throw a.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 e._effectOperation}static _animateOperation=()=>{throw a.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 e._animateOperation}static _getLogichValue=()=>{throw a.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 e._getLogichValue}static _getConditionalStep=()=>{throw a.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 e._getConditionalStep}};function _(e,t){if(t&&typeof t=="object"&&typeof e.functionName=="string"&&e.functionName in t){let i=t[e.functionName];if(typeof i=="function"){let n=e.args.map(o=>h.getLogichValue(o,t));return i(...n)}else a.warn(`getLogichValue function ${e.functionName} not found in props`);}}function z(e,t){let i=JsonUnifier.getLogichValue(e,t);return i&&typeof i=="object"&&"type"in i?JsonUnifier.getLogichValue(i,t):i}function ci(e,t={}){let i=z(e.value,t);switch(e.storageType){case "flagStorage":storage.setFlag(e.key,e.value);break;case "storage":storage.set(e.key,i);break;case "tempstorage":storage.setTempVariable(e.key,i);break;case "params":{let n=storage.get(`${T}${narration.openedLabels.length-1}`)||[];n.length>e.key&&(n[e.key]=i),storage.setTempVariable(`${T}${narration.openedLabels.length-1}`,n);break}}}function ui(e,t={}){let i=z(e.value,t);switch(e.storageType){case "storage":case "tempstorage":storage.default={[e.key]:i};break}}function k(e,t={}){let i=L(e,t);if(i&&typeof i=="object"&&"type"in i)switch(i.type){case "value":return ge(i,t);case "arithmetic":case "arithmeticsingle":return me(i,t);case "compare":case "union":return xe(i,t);case "function":return _(i,t)}return i}function me(e,t){let i=JsonUnifier.getLogichValue(e.leftValue,t);switch(e.type){case "arithmetic":{let n=JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "*":return i*n;case "/":return i/n;case "+":return typeof i=="string"||typeof n=="string"?`${i}${n}`:Array.isArray(i)&&Array.isArray(n)?[...i,...n]:Array.isArray(i)?[...i,n]:Array.isArray(n)?[i,...n]:i+n;case "-":if(Array.isArray(i)&&Array.isArray(n))return i.filter(o=>!n.includes(o));if(Array.isArray(i))return i.filter(o=>o!==n);if(Array.isArray(n)){a.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return i-n;case "%":return i%n;case "POW":return i**n;case "RANDOM":return narration.getRandomNumber(i,n);case "INTERSECTION":if(Array.isArray(i)&&Array.isArray(n))return i.filter(o=>n.includes(o));a.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:a.warn("getValueFromArithmeticOperations unknown operator",e);return}}case "arithmeticsingle":switch(e.operator){case "INT":return Number(i);case "FLOOR":return Math.floor(i);}break}}function ge(e,t){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.inputValue:storage.get(e.key);case "flagStorage":return storage.getFlag(e.key);case "label":return narration.getTimesLabelOpened(e.label);case "choice":return narration.getTimesChoiceMade(e.index);case "logic":return JsonUnifier.getLogichValue(e.operation,t);case "params":{let i=storage.get(`${T}${narration.openedLabels.length-1}`)||[];if(i&&i.length>e.key)return i[e.key];a.warn("getValue params not found");return}}return e}function xe(e,t){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":{let i=JsonUnifier.getLogichValue(e.leftValue,t),n=JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "==":return Array.isArray(i)&&Array.isArray(n)?i.length===n.length&&i.every(o=>n.includes(o)):i===n;case "!=":return Array.isArray(i)&&Array.isArray(n)?i.length!==n.length||!i.every(o=>n.includes(o)):i!==n;case "<":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)<0:Array.isArray(i)&&Array.isArray(n)?i.length<n.length:i<n;case "<=":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)<=0:Array.isArray(i)&&Array.isArray(n)?i.length<=n.length:i<=n;case ">":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)>0:Array.isArray(i)&&Array.isArray(n)?i.length>n.length:i>n;case ">=":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)>=0:Array.isArray(i)&&Array.isArray(n)?i.length>=n.length:i>=n;case "CONTAINS":return Array.isArray(i)&&Array.isArray(n)?n.every(o=>i.includes(o)):Array.isArray(i)?i.includes(n):i.toString().includes(n.toString())}break}case "value":{let i=JsonUnifier.getLogichValue(e,t);return Array.isArray(i)?i.length>0:i&&typeof i=="object"?Object.keys(i).length>0:!!i}case "union":return Ve(e,t)}return !!e}function Ve(e,t){if(e.unionType==="not"){let n=k(e.condition,t);return Array.isArray(n)?n.length===0:n&&typeof n=="object"?Object.keys(n).length===0:!n}let i=n=>JsonUnifier.getLogichValue(n,t)||false;return e.unionType==="and"?e.conditions.every(i):e.conditions.some(i)}function fe(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function L(e,t={}){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return ye(e,t);case "ifelse":return JsonUnifier.getLogichValue(e.condition,t)?JsonUnifier.getLogichValue(e.then,t):JsonUnifier.getLogichValue(e.else,t);case "stepswitch":{let i=JsonUnifier.getLogichValue(e.elements,t)||[];if(i.length===0){a.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":{let n=fe(0,i.length-1);return JsonUnifier.getLogichValue(i[n],t)}case "loop":{let n=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return n>i.length-1?(n=n%i.length,JsonUnifier.getLogichValue(i[n],t)):JsonUnifier.getLogichValue(i[n],t)}case "sequential":{let n,o=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end==="lastItem"&&(n=JsonUnifier.getLogichValue(i[i.length-1],t)),o>i.length-1?n:JsonUnifier.getLogichValue(i[o],t)}case "sequentialrandom":{let n=NarrationManagerStatic.getRandomNumber(0,i.length-1,{nestedId:e.nestedId,onceOnly:true});if(n===void 0&&e.end==="lastItem"){let o=NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!o?.usedRandomNumbers){a.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let r=o.usedRandomNumbers[`0-${i.length-1}`];return JsonUnifier.getLogichValue(i[r[r.length-1]],t)}if(n===void 0){a.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return JsonUnifier.getLogichValue(i[n],t)}}}}return e}function M(e,t={}){if(e.conditionalStep){let i=createExportableElement(JsonUnifier.getLogichValue(e.conditionalStep,t));if(i?.glueEnabled===void 0&&delete i?.glueEnabled,i?.goNextStep===void 0&&delete i?.goNextStep,i?.end===void 0&&delete i?.end,i?.choices===void 0&&delete i?.choices,i?.dialogue===void 0&&delete i?.dialogue,i?.labelToOpen===void 0&&delete i?.labelToOpen,i?.operations===void 0&&delete i?.operations,i){let n={...e,conditionalStep:void 0,...i};return M(n,t)}else narration.dialogGlue&&(narration.dialogGlue=false);}return e}function ye(e,t){let i=e.firstItem,n=(e.secondConditionalItem??[]).flatMap(r=>Array.isArray(r)?r.map(c=>JsonUnifier.getLogichValue(c,t)):[JsonUnifier.getLogichValue(r,t)]),o=i?[i,...n]:n;if(o.length===0){a.warn("combinateResult toCheck.length === 0");return}if(typeof o[0]=="string")return translator.t(o);if(typeof o[0]=="object"){let r=o,c,P=false,N=r.map((l,f)=>{l=M(l,t);let u=JsonUnifier.getLogichValue(l.dialogue,t)||"";return f===0?(c=JsonUnifier.getLogichValue(l.glueEnabled,t)||false,u):(typeof u=="object"&&"text"in u&&(u=`${u.character}: ${u.text}`),c===false&&P&&(u=`
2
2
 
3
- ${d}`),d&&(C=true),p=JsonUnifier.getLogichValue(l.glueEnabled,t)||false,d)}),w=JsonUnifier.getLogichValue(O[0],t),A=typeof w=="object"&&"character"in w?w.character:void 0,k=O.flatMap(l=>{let y;l&&typeof l=="object"&&"text"in l?y=l.text:y=l;let d;return Array.isArray(y)?d=y.map(D=>{let F=JsonUnifier.getLogichValue(D,t);return translator.t(`${F}`)}):d=JsonUnifier.getLogichValue(y,t)||"",translator.t(d)}),_=c.find(l=>l.end),$=c.find(l=>l.choices),j=false,L=false;c.length>0&&(c[0].glueEnabled&&c[0].goNextStep&&c[0].dialogue===void 0&&(narration.dialogGlue=true),j=c[c.length-1].glueEnabled,L=c.reverse().find(l=>!(l.operations&&(!l.dialogue||!l.choices)))?.goNextStep);let G=c.find(l=>l.labelToOpen),b=[];return c.forEach(l=>{l.operations&&(b=[...b,...l.operations]);}),{dialogue:A?{character:A,text:k}:k,end:_?.end,choices:$?.choices,glueEnabled:j,goNextStep:L,labelToOpen:G?.labelToOpen,operations:b}}}export{_e as animateOperation,ze as canvasElementOperation,Me as effectOperation,M as getConditionalStep,xe as getLogichValue,Ne as getValueFromConditionalStatements,Ee as imageContainerOperation,Le as imageOperation,Te as loadAssets,De as narrationOperation,xi as setInitialStorageValue,gi as setStorageValue,We as soundOperation,Re as textOperation,Ie as videoOperation};
3
+ ${u}`),u&&(P=true),c=JsonUnifier.getLogichValue(l.glueEnabled,t)||false,u)}),V=JsonUnifier.getLogichValue(N[0],t),y=typeof V=="object"&&"character"in V?V.character:void 0,J=N.flatMap(l=>{let f;l&&typeof l=="object"&&"text"in l?f=l.text:f=l;let u;return Array.isArray(f)?u=f.map(F=>{let D=JsonUnifier.getLogichValue(F,t);return translator.t(`${D}`)}):u=JsonUnifier.getLogichValue(f,t)||"",translator.t(u)}),C=r.find(l=>l.end),G=r.find(l=>l.choices),j=false,I=false;r.length>0&&(r[0].glueEnabled&&r[0].goNextStep&&r[0].dialogue===void 0&&(narration.dialogGlue=true),j=r[r.length-1].glueEnabled,I=r.reverse().find(l=>!(l.operations&&(!l.dialogue||!l.choices)))?.goNextStep);let $=r.find(l=>l.labelToOpen),O=[];return r.forEach(l=>{l.operations&&(O=[...O,...l.operations]);}),{dialogue:y?{character:y,text:J}:J,end:C?.end,choices:G?.choices,glueEnabled:j,goNextStep:I,labelToOpen:$?.labelToOpen,operations:O}}}var he;(o=>{let e=new Set;function t(r){e.add(r);}o.add=t;function i(){e.clear();}o.clear=i;function n(r,c={}){let P=y=>k(y,c)??void 0,N=L(r,c);if(e.size===0)return P(N);let V=P;for(let y of e){let J=V;V=C=>y(C,J)??void 0;}return V(N)}o.getLogichValue=n;})(he||={});export{he as VariableGetter,Ee as animateOperation,je as canvasElementOperation,Ie as effectOperation,M as getConditionalStep,k as getLogichValue,L as getValueFromConditionalStatements,ke as imageContainerOperation,Oe as imageOperation,Je as loadAssets,ze as narrationOperation,ui as setInitialStorageValue,ci as setStorageValue,$e as soundOperation,Le as textOperation,Ae as videoOperation};
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var pixiVn=require('@drincs/pixi-vn');var x=Object.defineProperty;var d=(s,i,p)=>i in s?x(s,i,{enumerable:true,configurable:true,writable:true,value:p}):s[i]=p;var o=(s,i,p)=>d(s,typeof i!="symbol"?i+"":i,p);var t;(P=>(P.log=(n,...r)=>console.log(`[Pixi\u2019VN Json] ${n}`,...r),P.warn=(n,...r)=>console.warn(`[Pixi\u2019VN Json] ${n}`,...r),P.error=(n,...r)=>console.error(`[Pixi\u2019VN Json] ${n}`,...r),P.info=(n,...r)=>console.info(`[Pixi\u2019VN Json] ${n}`,...r)))(t||(t={}));var e=class e{static init(i){i.loadAssets&&(e._loadAssets=i.loadAssets),i.soundOperation&&(e._soundOperation=i.soundOperation),i.imageOperation&&(e._imageOperation=i.imageOperation),i.videoOperation&&(e._videoOperation=i.videoOperation),i.imageContainerOperation&&(e._imageContainerOperation=i.imageContainerOperation),i.textOperation&&(e._textOperation=i.textOperation),i.canvasElementOperation&&(e._canvasElementOperation=i.canvasElementOperation),i.setStorageValue&&(e._setStorageValue=i.setStorageValue),i.setInitialStorageValue&&(e._setInitialStorageValue=i.setInitialStorageValue),i.narrationOperation&&(e._narrationOperation=i.narrationOperation),i.effectOperation&&(e._effectOperation=i.effectOperation),i.animateOperation&&(e._animateOperation=i.animateOperation),i.getLogichValue&&(e._getLogichValue=i.getLogichValue),i.getConditionalStep&&(e._getConditionalStep=i.getConditionalStep);}static get loadAssets(){return e._loadAssets}static get soundOperation(){return e._soundOperation}static get imageOperation(){return e._imageOperation}static get videoOperation(){return e._videoOperation}static get imageContainerOperation(){return e._imageContainerOperation}static get textOperation(){return e._textOperation}static get canvasElementOperation(){return e._canvasElementOperation}static get setStorageValue(){return e._setStorageValue}static get setInitialStorageValue(){return e._setInitialStorageValue}static get narrationOperation(){return e._narrationOperation}static get effectOperation(){return e._effectOperation}static get animateOperation(){return e._animateOperation}static get getLogichValue(){return e._getLogichValue}static get getConditionalStep(){return e._getConditionalStep}};o(e,"_loadAssets",()=>{}),o(e,"_soundOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_imageOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_videoOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_imageContainerOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_textOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_canvasElementOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_setStorageValue",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_setInitialStorageValue",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_narrationOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_effectOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_animateOperation",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_getLogichValue",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),o(e,"_getConditionalStep",()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")});var c=e;exports.JsonUnifier=c;
1
+ 'use strict';var pixiVn=require('@drincs/pixi-vn');var t;(r=>(r.log=(a,...n)=>console.log(`[Pixi\u2019VN Json] ${a}`,...n),r.warn=(a,...n)=>console.warn(`[Pixi\u2019VN Json] ${a}`,...n),r.error=(a,...n)=>console.error(`[Pixi\u2019VN Json] ${a}`,...n),r.info=(a,...n)=>console.info(`[Pixi\u2019VN Json] ${a}`,...n)))(t||={});var s=class e{static init(i){i.loadAssets&&(e._loadAssets=i.loadAssets),i.soundOperation&&(e._soundOperation=i.soundOperation),i.imageOperation&&(e._imageOperation=i.imageOperation),i.videoOperation&&(e._videoOperation=i.videoOperation),i.imageContainerOperation&&(e._imageContainerOperation=i.imageContainerOperation),i.textOperation&&(e._textOperation=i.textOperation),i.canvasElementOperation&&(e._canvasElementOperation=i.canvasElementOperation),i.setStorageValue&&(e._setStorageValue=i.setStorageValue),i.setInitialStorageValue&&(e._setInitialStorageValue=i.setInitialStorageValue),i.narrationOperation&&(e._narrationOperation=i.narrationOperation),i.effectOperation&&(e._effectOperation=i.effectOperation),i.animateOperation&&(e._animateOperation=i.animateOperation),i.getLogichValue&&(e._getLogichValue=i.getLogichValue),i.getConditionalStep&&(e._getConditionalStep=i.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._soundOperation}static _imageOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._imageOperation}static _videoOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._videoOperation}static _imageContainerOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._imageContainerOperation}static _textOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._textOperation}static _canvasElementOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._canvasElementOperation}static _setStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._setStorageValue}static _setInitialStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._setInitialStorageValue}static _narrationOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._narrationOperation}static _effectOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._effectOperation}static _animateOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._animateOperation}static _getLogichValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._getLogichValue}static _getConditionalStep=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.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 e._getConditionalStep}};exports.JsonUnifier=s;
package/dist/core.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ImageSpriteMemory, VideoSpriteMemory, ContainerMemory, ContainerChild, StepLabelPropsType, StorageElementType } from '@drincs/pixi-vn';
2
- import { L as PixiVNJsonOperation, A as PixiVNJsonIfElse, M as PixiVNJsonOperationString, O as PixiVNJsonSound, j as PixiVNJsonCanvasImageVideoShow, C as PixiVNJsonImageEdit, k as PixiVNJsonCanvasRemove, a1 as PixiVNJsonVideoEdit, a2 as PixiVNJsonVideoPauseResume, i as PixiVNJsonCanvasImageContainerShow, B as PixiVNJsonImageContainerEdit, m as PixiVNJsonCanvasTextShow, Y as PixiVNJsonTextEdit, _ as PixiVNJsonUnknownEdit, a0 as PixiVNJsonValueSet, K as PixiVNJsonOnlyStorageSet, J as PixiVNJsonNarration, h as PixiVNJsonCanvasEffect, f as PixiVNJsonCanvasAnimate, $ as PixiVNJsonValueGet, b as PixiVNJsonArithmeticOperations, v as PixiVNJsonConditions, u as PixiVNJsonConditionalStatements, F as PixiVNJsonLabelStep } from './PixiVNJsonLabelStep-DJgORyFd.cjs';
2
+ import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, c as PixiVNJsonSound, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, f as PixiVNJsonCanvasRemove, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, m as PixiVNJsonUnknownEdit, n as PixiVNJsonValueSet, o as PixiVNJsonOnlyStorageSet, p as PixiVNJsonNarration, q as PixiVNJsonCanvasEffect, r as PixiVNJsonCanvasAnimate, s as PixiVNJsonValueGet, t as PixiVNJsonArithmeticOperations, u as PixiVNJsonConditions, v as PixiVNJsonConditionalStatements, w as PixiVNJsonLabelStep } from './PixiVNJsonLabelStep-BsGHNfkq.cjs';
3
3
  import '@drincs/pixi-vn/motion';
4
4
  import 'pixi.js';
5
5
 
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ImageSpriteMemory, VideoSpriteMemory, ContainerMemory, ContainerChild, StepLabelPropsType, StorageElementType } from '@drincs/pixi-vn';
2
- import { L as PixiVNJsonOperation, A as PixiVNJsonIfElse, M as PixiVNJsonOperationString, O as PixiVNJsonSound, j as PixiVNJsonCanvasImageVideoShow, C as PixiVNJsonImageEdit, k as PixiVNJsonCanvasRemove, a1 as PixiVNJsonVideoEdit, a2 as PixiVNJsonVideoPauseResume, i as PixiVNJsonCanvasImageContainerShow, B as PixiVNJsonImageContainerEdit, m as PixiVNJsonCanvasTextShow, Y as PixiVNJsonTextEdit, _ as PixiVNJsonUnknownEdit, a0 as PixiVNJsonValueSet, K as PixiVNJsonOnlyStorageSet, J as PixiVNJsonNarration, h as PixiVNJsonCanvasEffect, f as PixiVNJsonCanvasAnimate, $ as PixiVNJsonValueGet, b as PixiVNJsonArithmeticOperations, v as PixiVNJsonConditions, u as PixiVNJsonConditionalStatements, F as PixiVNJsonLabelStep } from './PixiVNJsonLabelStep-DJgORyFd.js';
2
+ import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, c as PixiVNJsonSound, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, f as PixiVNJsonCanvasRemove, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, m as PixiVNJsonUnknownEdit, n as PixiVNJsonValueSet, o as PixiVNJsonOnlyStorageSet, p as PixiVNJsonNarration, q as PixiVNJsonCanvasEffect, r as PixiVNJsonCanvasAnimate, s as PixiVNJsonValueGet, t as PixiVNJsonArithmeticOperations, u as PixiVNJsonConditions, v as PixiVNJsonConditionalStatements, w as PixiVNJsonLabelStep } from './PixiVNJsonLabelStep-BsGHNfkq.js';
3
3
  import '@drincs/pixi-vn/motion';
4
4
  import 'pixi.js';
5
5
 
package/dist/core.mjs CHANGED
@@ -1 +1 @@
1
- import {PixiError}from'@drincs/pixi-vn';var x=Object.defineProperty;var d=(s,i,p)=>i in s?x(s,i,{enumerable:true,configurable:true,writable:true,value:p}):s[i]=p;var o=(s,i,p)=>d(s,typeof i!="symbol"?i+"":i,p);var t;(P=>(P.log=(n,...r)=>console.log(`[Pixi\u2019VN Json] ${n}`,...r),P.warn=(n,...r)=>console.warn(`[Pixi\u2019VN Json] ${n}`,...r),P.error=(n,...r)=>console.error(`[Pixi\u2019VN Json] ${n}`,...r),P.info=(n,...r)=>console.info(`[Pixi\u2019VN Json] ${n}`,...r)))(t||(t={}));var e=class e{static init(i){i.loadAssets&&(e._loadAssets=i.loadAssets),i.soundOperation&&(e._soundOperation=i.soundOperation),i.imageOperation&&(e._imageOperation=i.imageOperation),i.videoOperation&&(e._videoOperation=i.videoOperation),i.imageContainerOperation&&(e._imageContainerOperation=i.imageContainerOperation),i.textOperation&&(e._textOperation=i.textOperation),i.canvasElementOperation&&(e._canvasElementOperation=i.canvasElementOperation),i.setStorageValue&&(e._setStorageValue=i.setStorageValue),i.setInitialStorageValue&&(e._setInitialStorageValue=i.setInitialStorageValue),i.narrationOperation&&(e._narrationOperation=i.narrationOperation),i.effectOperation&&(e._effectOperation=i.effectOperation),i.animateOperation&&(e._animateOperation=i.animateOperation),i.getLogichValue&&(e._getLogichValue=i.getLogichValue),i.getConditionalStep&&(e._getConditionalStep=i.getConditionalStep);}static get loadAssets(){return e._loadAssets}static get soundOperation(){return e._soundOperation}static get imageOperation(){return e._imageOperation}static get videoOperation(){return e._videoOperation}static get imageContainerOperation(){return e._imageContainerOperation}static get textOperation(){return e._textOperation}static get canvasElementOperation(){return e._canvasElementOperation}static get setStorageValue(){return e._setStorageValue}static get setInitialStorageValue(){return e._setInitialStorageValue}static get narrationOperation(){return e._narrationOperation}static get effectOperation(){return e._effectOperation}static get animateOperation(){return e._animateOperation}static get getLogichValue(){return e._getLogichValue}static get getConditionalStep(){return e._getConditionalStep}};o(e,"_loadAssets",()=>{}),o(e,"_soundOperation",()=>{throw t.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.")}),o(e,"_imageOperation",()=>{throw t.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.")}),o(e,"_videoOperation",()=>{throw t.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.")}),o(e,"_imageContainerOperation",()=>{throw t.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.")}),o(e,"_textOperation",()=>{throw t.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.")}),o(e,"_canvasElementOperation",()=>{throw t.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.")}),o(e,"_setStorageValue",()=>{throw t.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.")}),o(e,"_setInitialStorageValue",()=>{throw t.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.")}),o(e,"_narrationOperation",()=>{throw t.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.")}),o(e,"_effectOperation",()=>{throw t.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.")}),o(e,"_animateOperation",()=>{throw t.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.")}),o(e,"_getLogichValue",()=>{throw t.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.")}),o(e,"_getConditionalStep",()=>{throw t.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.")});var c=e;export{c as JsonUnifier};
1
+ import {PixiError}from'@drincs/pixi-vn';var t;(r=>(r.log=(a,...n)=>console.log(`[Pixi\u2019VN Json] ${a}`,...n),r.warn=(a,...n)=>console.warn(`[Pixi\u2019VN Json] ${a}`,...n),r.error=(a,...n)=>console.error(`[Pixi\u2019VN Json] ${a}`,...n),r.info=(a,...n)=>console.info(`[Pixi\u2019VN Json] ${a}`,...n)))(t||={});var s=class e{static init(i){i.loadAssets&&(e._loadAssets=i.loadAssets),i.soundOperation&&(e._soundOperation=i.soundOperation),i.imageOperation&&(e._imageOperation=i.imageOperation),i.videoOperation&&(e._videoOperation=i.videoOperation),i.imageContainerOperation&&(e._imageContainerOperation=i.imageContainerOperation),i.textOperation&&(e._textOperation=i.textOperation),i.canvasElementOperation&&(e._canvasElementOperation=i.canvasElementOperation),i.setStorageValue&&(e._setStorageValue=i.setStorageValue),i.setInitialStorageValue&&(e._setInitialStorageValue=i.setInitialStorageValue),i.narrationOperation&&(e._narrationOperation=i.narrationOperation),i.effectOperation&&(e._effectOperation=i.effectOperation),i.animateOperation&&(e._animateOperation=i.animateOperation),i.getLogichValue&&(e._getLogichValue=i.getLogichValue),i.getConditionalStep&&(e._getConditionalStep=i.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw t.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 e._soundOperation}static _imageOperation=()=>{throw t.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 e._imageOperation}static _videoOperation=()=>{throw t.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 e._videoOperation}static _imageContainerOperation=()=>{throw t.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 e._imageContainerOperation}static _textOperation=()=>{throw t.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 e._textOperation}static _canvasElementOperation=()=>{throw t.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 e._canvasElementOperation}static _setStorageValue=()=>{throw t.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 e._setStorageValue}static _setInitialStorageValue=()=>{throw t.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 e._setInitialStorageValue}static _narrationOperation=()=>{throw t.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 e._narrationOperation}static _effectOperation=()=>{throw t.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 e._effectOperation}static _animateOperation=()=>{throw t.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 e._animateOperation}static _getLogichValue=()=>{throw t.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 e._getLogichValue}static _getConditionalStep=()=>{throw t.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 e._getConditionalStep}};export{s as JsonUnifier};
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var actions=require('@drincs/pixi-vn-json/actions'),core=require('@drincs/pixi-vn-json/core'),translator=require('@drincs/pixi-vn-json/translator'),characters=require('@drincs/pixi-vn/characters'),zod=require('zod'),interpreter=require('@drincs/pixi-vn-json/interpreter');exports.VariableGetter=void 0;(v=>{let n=new Set;function o(m){n.add(m);}v.add=o;function h(){n.clear();}v.clear=h;function y(m,x={}){let p=a=>actions.getLogichValue(a,x)??void 0,u=actions.getValueFromConditionalStatements(m,x);if(n.size===0)return p(u);let c=p;for(let a of n){let e=c;c=i=>a(i,e)??void 0;}return c(u)}v.getLogichValue=y;})(exports.VariableGetter||(exports.VariableGetter={}));var b={version:"1.13.8"};var _="___param___",N=`https://pixi-vn.com/schemas/${b.version}/schema.json`,T=["==","!=","<","<=",">",">=","CONTAINS"];exports.TextReplaces=void 0;(a=>{a.options={replaceRegex:/\[([^\]]+)\]/};let o=[],h=false,y=false;function v(e,i){o.unshift({fn:e,opts:i});let t=i.type??"before-translation";t==="before-translation"&&!h?(translator.translator.beforeToTranslate=r=>p(r,{type:"before-translation"}),h=true):t==="after-translation"&&!y&&(translator.translator.afterToTranslate=r=>p(r,{type:"after-translation"}),y=true);}a.add=v;function m(e){let i=o.findIndex(t=>t.fn===e);i!==-1&&o.splice(i,1);}a.remove=m;function x(){return o.map(e=>e.opts)}a.info=x;function p(e,i){for(let r of o.filter(d=>d.opts.i18nInterpolation))e=u(e,r.fn,r.opts.validation);let t=o.filter(r=>(r.opts.type??"before-translation")===i.type);for(let r of t)e=c(e,r.fn,r.opts.validation);return e}a.replace=p;function u(e,i,t){let r=new RegExp(a.options.replaceRegex.source,"g"),d=[...e.matchAll(r)],l=new Set,f=[];for(let s of d)l.has(s[1])||(l.add(s[1]),f.push(s[1]));for(let s of f){if(t==="characterId"){if(!characters.RegisteredCharacters.has(s))continue}else if(t!=="all"){if(t instanceof RegExp){if(!t.test(s))continue}else if(t instanceof zod.ZodType&&!t.safeParse(s).success)continue}i(s)!==void 0&&(e=e.replace(`[${s}]`,`{{[${s}]}}`));}return e}function c(e,i,t){let r=new RegExp(a.options.replaceRegex.source,"g"),d=[...e.matchAll(r)],l=new Set,f=[];for(let s of d)l.has(s[1])||(l.add(s[1]),f.push(s[1]));for(let s of f){if(t==="characterId"){if(!characters.RegisteredCharacters.has(s))continue}else if(t!=="all"){if(t instanceof RegExp){if(!t.test(s))continue}else if(t instanceof zod.ZodType&&!t.safeParse(s).success)continue}let j=i(s);j!==void 0&&(e=e.replaceAll(`[${s}]`,j));}return e}})(exports.TextReplaces||(exports.TextReplaces={}));function pe(){core.JsonUnifier.init({animateOperation:actions.animateOperation,canvasElementOperation:actions.canvasElementOperation,effectOperation:actions.effectOperation,imageContainerOperation:actions.imageContainerOperation,imageOperation:actions.imageOperation,textOperation:actions.textOperation,narrationOperation:actions.narrationOperation,loadAssets:actions.loadAssets,soundOperation:actions.soundOperation,videoOperation:actions.videoOperation,setStorageValue:actions.setStorageValue,setInitialStorageValue:actions.setInitialStorageValue,getLogichValue:exports.VariableGetter.getLogichValue,getConditionalStep:actions.getConditionalStep});}
2
- exports.PIXIVNJSON_PARAM_ID=_;exports.PIXIVNJSON_SCHEMA_URL=N;exports.PixiVNJsonComparationOperators=T;exports.init=pe;Object.keys(translator).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return translator[k]}})});Object.keys(interpreter).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return interpreter[k]}})});
1
+ 'use strict';var actions=require('@drincs/pixi-vn-json/actions'),core=require('@drincs/pixi-vn-json/core'),interpreter=require('@drincs/pixi-vn-json/interpreter'),translator=require('@drincs/pixi-vn-json/translator');var t={version:"1.13.10"};var i="___param___",s=`https://pixi-vn.com/schemas/${t.version}/schema.json`,r=["==","!=","<","<=",">",">=","CONTAINS"];function b(){core.JsonUnifier.init({animateOperation:actions.animateOperation,canvasElementOperation:actions.canvasElementOperation,effectOperation:actions.effectOperation,imageContainerOperation:actions.imageContainerOperation,imageOperation:actions.imageOperation,textOperation:actions.textOperation,narrationOperation:actions.narrationOperation,loadAssets:actions.loadAssets,soundOperation:actions.soundOperation,videoOperation:actions.videoOperation,setStorageValue:actions.setStorageValue,setInitialStorageValue:actions.setInitialStorageValue,getLogichValue:actions.VariableGetter.getLogichValue,getConditionalStep:actions.getConditionalStep});}
2
+ Object.defineProperty(exports,"VariableGetter",{enumerable:true,get:function(){return actions.VariableGetter}});exports.PIXIVNJSON_PARAM_ID=i;exports.PIXIVNJSON_SCHEMA_URL=s;exports.PixiVNJsonComparationOperators=r;exports.init=b;Object.keys(interpreter).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return interpreter[k]}})});Object.keys(translator).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return translator[k]}})});