@drincs/pixi-vn 1.8.17 → 1.8.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas.d.cts +53 -37
- package/dist/canvas.d.ts +53 -37
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/narration.cjs +1 -1
- package/dist/narration.d.cts +1 -1
- package/dist/narration.d.ts +1 -1
- package/dist/narration.mjs +1 -1
- package/dist/pixi/browser.js +169 -169
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
package/dist/canvas.d.cts
CHANGED
|
@@ -203,7 +203,7 @@ interface TickerTimeoutHistory {
|
|
|
203
203
|
|
|
204
204
|
type CommonTickerProps = {
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* An array of strings containing the aliases of the canvas components to remove after the animation completes.
|
|
207
207
|
* @default []
|
|
208
208
|
*/
|
|
209
209
|
aliasToRemoveAfter?: string[] | string;
|
|
@@ -213,12 +213,12 @@ type CommonTickerProps = {
|
|
|
213
213
|
*/
|
|
214
214
|
startOnlyIfHaveTexture?: boolean;
|
|
215
215
|
/**
|
|
216
|
-
*
|
|
216
|
+
* If you want to resume tickers that were previously paused, provide the aliases of the canvas components whose tickers should be resumed.
|
|
217
217
|
* @default []
|
|
218
218
|
*/
|
|
219
219
|
tickerAliasToResume?: string[] | string;
|
|
220
220
|
/**
|
|
221
|
-
*
|
|
221
|
+
* A string containing the ticker ID to resume after the animation completes.
|
|
222
222
|
* @default []
|
|
223
223
|
*/
|
|
224
224
|
tickerIdToResume?: string[] | string;
|
|
@@ -227,6 +227,7 @@ type CommonTickerProps = {
|
|
|
227
227
|
*/
|
|
228
228
|
forceCompleteBeforeNext?: boolean;
|
|
229
229
|
/**
|
|
230
|
+
* A boolean indicating whether the animation must complete before the next `step` of the game. If `true`, the game will force the animation to finish before proceeding.
|
|
230
231
|
* When true, calling {@link narration.continue()} forces the current content to complete before advancing to the next narrative step.
|
|
231
232
|
* @default false
|
|
232
233
|
*/
|
|
@@ -326,8 +327,8 @@ interface CanvasManagerInterface {
|
|
|
326
327
|
* Add a canvas element to the canvas.
|
|
327
328
|
* If there is a canvas element with the same alias, all "style", zIndex, and {@link TickerBase} will be transferred to the new canvas element,
|
|
328
329
|
* and the old canvas element will be removed.
|
|
329
|
-
* @param alias The alias
|
|
330
|
-
* @param canvasComponent The
|
|
330
|
+
* @param alias The alias to identify the component.
|
|
331
|
+
* @param canvasComponent The component to add.
|
|
331
332
|
* @param options The options of the canvas element.
|
|
332
333
|
* @example
|
|
333
334
|
* ```ts
|
|
@@ -368,8 +369,8 @@ interface CanvasManagerInterface {
|
|
|
368
369
|
}): void;
|
|
369
370
|
/**
|
|
370
371
|
* Get a canvas element by the alias.
|
|
371
|
-
* @param alias The alias
|
|
372
|
-
* @returns The canvas element.
|
|
372
|
+
* @param alias The alias to identify the component.
|
|
373
|
+
* @returns The canvas element. If the component does not exist, it will return `undefined`.
|
|
373
374
|
* @example
|
|
374
375
|
* ```ts
|
|
375
376
|
* const sprite = canvas.find<Sprite>("bunny");
|
|
@@ -552,12 +553,12 @@ interface CanvasManagerInterface {
|
|
|
552
553
|
*
|
|
553
554
|
* Pixi’VN will keep track of the animation state of this function.
|
|
554
555
|
* So Pixi’VN will save the animation state in saves.
|
|
555
|
-
* @param components
|
|
556
|
-
* @param keyframes
|
|
557
|
-
* @param options
|
|
558
|
-
* @param priority
|
|
559
|
-
* @returns The
|
|
560
|
-
* @template T
|
|
556
|
+
* @param components The PixiJS component(s) to animate. This can be a single component, an array of components, or a string representing the component's alias.
|
|
557
|
+
* @param keyframes This is an object containing the properties to animate and the values to reach.
|
|
558
|
+
* @param options [`motion` options](https://motion.dev/docs/animate#options) for the animation, including duration, `easing`, and ticker.
|
|
559
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority. @default UPDATE_PRIORITY.NORMAL
|
|
560
|
+
* @returns The function returns the ID of the ticker created to animate the component(s).
|
|
561
|
+
* @template T The type of Pixi’VN component(s) being animated.
|
|
561
562
|
*/
|
|
562
563
|
animate<T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: KeyframesType<T>, options?: AnimationOptions, priority?: UPDATE_PRIORITY$1): string | undefined;
|
|
563
564
|
/**
|
|
@@ -566,12 +567,12 @@ interface CanvasManagerInterface {
|
|
|
566
567
|
*
|
|
567
568
|
* Pixi’VN will keep track of the animation state of this function.
|
|
568
569
|
* So Pixi’VN will save the animation state in saves.
|
|
569
|
-
* @param components
|
|
570
|
-
* @param sequence
|
|
571
|
-
* @param options
|
|
572
|
-
* @param priority
|
|
573
|
-
* @returns The
|
|
574
|
-
* @template T
|
|
570
|
+
* @param components The PixiJS component(s) to animate. This can be a single component, an array of components, or a string representing the component's alias.
|
|
571
|
+
* @param sequence The sequence of keyframes to animate the component(s) with.
|
|
572
|
+
* @param options [`motion` options](https://motion.dev/docs/animate#options) for the animation, including duration, `easing`, and ticker.
|
|
573
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority. @default UPDATE_PRIORITY.NORMAL
|
|
574
|
+
* @returns The function returns the ID of the ticker created to animate the component(s).
|
|
575
|
+
* @template T The type of Pixi’VN component(s) being animated.
|
|
575
576
|
*/
|
|
576
577
|
animate<T extends CanvasBaseInterface<any>>(components: T | string, sequence: (ObjectSegment<T> | ObjectSegmentWithTransition<T>)[], options?: SequenceOptions, priority?: UPDATE_PRIORITY$1): string | undefined;
|
|
577
578
|
/**
|
|
@@ -746,6 +747,9 @@ interface SpriteMemory extends SpriteBaseMemory {
|
|
|
746
747
|
* ```
|
|
747
748
|
*/
|
|
748
749
|
declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = SpriteMemory> extends _drincs_pixi_vn_pixi_js__default.Sprite implements CanvasBaseItem<Memory | SpriteMemory>, ListenerExtension, AdditionalPositionsExtension {
|
|
750
|
+
/**
|
|
751
|
+
* @param options The options for the component.
|
|
752
|
+
*/
|
|
749
753
|
constructor(options?: SpriteOptions | Texture$1);
|
|
750
754
|
readonly pixivnId: string;
|
|
751
755
|
get memory(): Memory | SpriteMemory;
|
|
@@ -836,6 +840,10 @@ declare class ImageSprite<Memory extends ImageSpriteMemory = ImageSpriteMemory>
|
|
|
836
840
|
private _textureAlias?;
|
|
837
841
|
protected get textureAlias(): string;
|
|
838
842
|
readonly pixivnId: string;
|
|
843
|
+
/**
|
|
844
|
+
* @param options The options for the component.
|
|
845
|
+
* @param textureAlias The URL or path. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
846
|
+
*/
|
|
839
847
|
constructor(options?: ImageSpriteOptions | Omit<Texture$1, "on"> | undefined, textureAlias?: string);
|
|
840
848
|
get memory(): ImageSpriteMemory;
|
|
841
849
|
setMemory(memory: Memory | SpriteMemory): Promise<void>;
|
|
@@ -887,6 +895,10 @@ interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
|
887
895
|
* ```
|
|
888
896
|
*/
|
|
889
897
|
declare class VideoSprite extends ImageSprite<VideoSpriteMemory> {
|
|
898
|
+
/**
|
|
899
|
+
* @param options The options for the component.
|
|
900
|
+
* @param textureAlias The URL or path. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
901
|
+
*/
|
|
890
902
|
constructor(options?: VideoSpriteOptions | Texture$1 | undefined, textureAlias?: string);
|
|
891
903
|
readonly pixivnId: string;
|
|
892
904
|
get memory(): VideoSpriteMemory;
|
|
@@ -1031,6 +1043,10 @@ interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
|
1031
1043
|
* ```
|
|
1032
1044
|
*/
|
|
1033
1045
|
declare class ImageContainer extends Container<ImageSprite, ImageContainerMemory> {
|
|
1046
|
+
/**
|
|
1047
|
+
* @param options The options for the component.
|
|
1048
|
+
* @param textureAliases An array of image URLs or paths. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
1049
|
+
*/
|
|
1034
1050
|
constructor(options?: ImageContainerOptions<ImageSprite>, textureAliases?: string[]);
|
|
1035
1051
|
get memory(): ImageContainerMemory;
|
|
1036
1052
|
setMemory(value: ImageContainerMemory): Promise<void>;
|
|
@@ -1324,7 +1340,7 @@ type SerializableEventHandler = (...args: never[]) => unknown;
|
|
|
1324
1340
|
*
|
|
1325
1341
|
* sprite.on("pointerdown", Events.eventExample);
|
|
1326
1342
|
* ```
|
|
1327
|
-
* @param name
|
|
1343
|
+
* @param name The id used by Pixi’VN to refer to this function (must be unique). If you don't pass the id, the function name will be used as the id.
|
|
1328
1344
|
* @returns
|
|
1329
1345
|
*/
|
|
1330
1346
|
declare function eventDecorator(name?: string): (_target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
@@ -1362,9 +1378,9 @@ declare namespace RegisteredEvents {
|
|
|
1362
1378
|
/**
|
|
1363
1379
|
* Shake the canvas element.
|
|
1364
1380
|
* If there is a/more ticker(s) with the same alias, then the ticker(s) is/are paused.
|
|
1365
|
-
* @param alias
|
|
1366
|
-
* @param options
|
|
1367
|
-
* @param priority
|
|
1381
|
+
* @param alias The alias to identify the component.
|
|
1382
|
+
* @param options Animation options, matching the `options` of animate function.
|
|
1383
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority.
|
|
1368
1384
|
* @returns
|
|
1369
1385
|
*/
|
|
1370
1386
|
declare function shakeEffect(alias: string, options?: ShakeEffectProps, priority?: UPDATE_PRIORITY$1): Promise<string[] | undefined>;
|
|
@@ -1569,11 +1585,11 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1569
1585
|
/**
|
|
1570
1586
|
* Add a list of images in the container, after that, the images are added to the canvas.
|
|
1571
1587
|
* Is the same that {@link showImageContainer}, but the image is not shown.
|
|
1572
|
-
* If you want to show the
|
|
1573
|
-
* @param alias is the unique alias of the
|
|
1588
|
+
* If you want to show the container, then you need to use the function {@link ImageSprite.load()}.
|
|
1589
|
+
* @param alias is the unique alias of the container. You can use this alias to refer to this container
|
|
1574
1590
|
* @param imageUrls is the url of the image. If you don't provide the url, then the alias is used as the url.
|
|
1575
|
-
* @param options The options of the
|
|
1576
|
-
* @returns
|
|
1591
|
+
* @param options The options of the container.
|
|
1592
|
+
* @returns This function returns an {@link ImageContainer} that you can use to manipulate the component.
|
|
1577
1593
|
* @example
|
|
1578
1594
|
* ```ts
|
|
1579
1595
|
* let bunny = addImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
@@ -1583,10 +1599,10 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1583
1599
|
declare function addImageCointainer(alias: string, imageUrls: string[], options?: ImageContainerOptions<ImageSprite>): ImageContainer;
|
|
1584
1600
|
/**
|
|
1585
1601
|
* Add a list of images in the container, after that, the images are added and shown in the canvas.
|
|
1586
|
-
* @param alias The unique alias of the
|
|
1602
|
+
* @param alias The unique alias of the container. You can use this alias to refer to this container
|
|
1587
1603
|
* @param imageUrls The url of the image.
|
|
1588
|
-
* @param options The options of the
|
|
1589
|
-
* @returns
|
|
1604
|
+
* @param options The options of the container.
|
|
1605
|
+
* @returns This function returns an {@link ImageContainer} that you can use to manipulate the component.
|
|
1590
1606
|
* @example
|
|
1591
1607
|
* ```ts
|
|
1592
1608
|
* let bunny = showImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
@@ -1599,9 +1615,9 @@ declare function showImageContainer(alias: string, imageUrls: string[], options?
|
|
|
1599
1615
|
* Is the same that {@link showImage}, but the image is not shown.
|
|
1600
1616
|
* If you want to show the image, then you need to use the function {@link ImageSprite.load}.
|
|
1601
1617
|
* @param alias is the unique alias of the image. You can use this alias to refer to this image
|
|
1602
|
-
* @param imageUrl
|
|
1618
|
+
* @param imageUrl The url of the image. If you have initialized the "asset matrix", you can use the alias of the texture. If you don't provide the URL, then the alias is used as the URL.
|
|
1603
1619
|
* @param options The options of the image.
|
|
1604
|
-
* @returns
|
|
1620
|
+
* @returns This function returns an {@link ImageSprite} that you can use to manipulate the component.
|
|
1605
1621
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1606
1622
|
* @example
|
|
1607
1623
|
* ```ts
|
|
@@ -1616,9 +1632,9 @@ declare function addImage(alias: string, imageUrl?: string, options?: ImageSprit
|
|
|
1616
1632
|
/**
|
|
1617
1633
|
* Add and show a image in the canvas. This function is a combination of {@link addImage}.
|
|
1618
1634
|
* @param alias The unique alias of the image. You can use this alias to refer to this image
|
|
1619
|
-
* @param imageUrl The url of the image.
|
|
1635
|
+
* @param imageUrl The url of the image. If you have initialized the "asset matrix", you can use the alias of the texture. If you don't provide the URL, then the alias is used as the URL.
|
|
1620
1636
|
* @param options The options of the image.
|
|
1621
|
-
* @returns
|
|
1637
|
+
* @returns This function returns an {@link ImageSprite} that you can use to manipulate the component.
|
|
1622
1638
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1623
1639
|
* @example
|
|
1624
1640
|
* ```ts
|
|
@@ -1634,7 +1650,7 @@ declare function showImage(alias: string, imageUrl?: string, options?: ImageSpri
|
|
|
1634
1650
|
* @param alias The unique alias of the text. You can use this alias to refer to this text.
|
|
1635
1651
|
* @param text
|
|
1636
1652
|
* @param options The options of the text.
|
|
1637
|
-
* @returns
|
|
1653
|
+
* @returns This function returns an {@link Text} that you can use to manipulate the component.
|
|
1638
1654
|
* @example
|
|
1639
1655
|
* ```ts
|
|
1640
1656
|
* let text = showText("text", "Hello World", { fontSize: 24, fill: "white" })
|
|
@@ -1657,7 +1673,7 @@ declare function getTexture(textureAlias?: string): Promise<Texture$1 | undefine
|
|
|
1657
1673
|
* @param alias is the unique alias of the video. You can use this alias to refer to this video
|
|
1658
1674
|
* @param videoUrl is the url of the video. If you don't provide the url, then the alias is used as the url.
|
|
1659
1675
|
* @param options The options of the video.
|
|
1660
|
-
* @returns
|
|
1676
|
+
* @returns This function returns an {@link VideoSprite} that you can use to manipulate the component.
|
|
1661
1677
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1662
1678
|
* @example
|
|
1663
1679
|
* ```ts
|
|
@@ -1674,7 +1690,7 @@ declare function addVideo(alias: string, videoUrl?: string, options?: VideoSprit
|
|
|
1674
1690
|
* @param alias The unique alias of the video. You can use this alias to refer to this video
|
|
1675
1691
|
* @param videoUrl The url of the video.
|
|
1676
1692
|
* @param options The options of the video.
|
|
1677
|
-
* @returns
|
|
1693
|
+
* @returns This function returns an {@link VideoSprite} that you can use to manipulate the component.
|
|
1678
1694
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1679
1695
|
* @example
|
|
1680
1696
|
* ```ts
|
package/dist/canvas.d.ts
CHANGED
|
@@ -203,7 +203,7 @@ interface TickerTimeoutHistory {
|
|
|
203
203
|
|
|
204
204
|
type CommonTickerProps = {
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* An array of strings containing the aliases of the canvas components to remove after the animation completes.
|
|
207
207
|
* @default []
|
|
208
208
|
*/
|
|
209
209
|
aliasToRemoveAfter?: string[] | string;
|
|
@@ -213,12 +213,12 @@ type CommonTickerProps = {
|
|
|
213
213
|
*/
|
|
214
214
|
startOnlyIfHaveTexture?: boolean;
|
|
215
215
|
/**
|
|
216
|
-
*
|
|
216
|
+
* If you want to resume tickers that were previously paused, provide the aliases of the canvas components whose tickers should be resumed.
|
|
217
217
|
* @default []
|
|
218
218
|
*/
|
|
219
219
|
tickerAliasToResume?: string[] | string;
|
|
220
220
|
/**
|
|
221
|
-
*
|
|
221
|
+
* A string containing the ticker ID to resume after the animation completes.
|
|
222
222
|
* @default []
|
|
223
223
|
*/
|
|
224
224
|
tickerIdToResume?: string[] | string;
|
|
@@ -227,6 +227,7 @@ type CommonTickerProps = {
|
|
|
227
227
|
*/
|
|
228
228
|
forceCompleteBeforeNext?: boolean;
|
|
229
229
|
/**
|
|
230
|
+
* A boolean indicating whether the animation must complete before the next `step` of the game. If `true`, the game will force the animation to finish before proceeding.
|
|
230
231
|
* When true, calling {@link narration.continue()} forces the current content to complete before advancing to the next narrative step.
|
|
231
232
|
* @default false
|
|
232
233
|
*/
|
|
@@ -326,8 +327,8 @@ interface CanvasManagerInterface {
|
|
|
326
327
|
* Add a canvas element to the canvas.
|
|
327
328
|
* If there is a canvas element with the same alias, all "style", zIndex, and {@link TickerBase} will be transferred to the new canvas element,
|
|
328
329
|
* and the old canvas element will be removed.
|
|
329
|
-
* @param alias The alias
|
|
330
|
-
* @param canvasComponent The
|
|
330
|
+
* @param alias The alias to identify the component.
|
|
331
|
+
* @param canvasComponent The component to add.
|
|
331
332
|
* @param options The options of the canvas element.
|
|
332
333
|
* @example
|
|
333
334
|
* ```ts
|
|
@@ -368,8 +369,8 @@ interface CanvasManagerInterface {
|
|
|
368
369
|
}): void;
|
|
369
370
|
/**
|
|
370
371
|
* Get a canvas element by the alias.
|
|
371
|
-
* @param alias The alias
|
|
372
|
-
* @returns The canvas element.
|
|
372
|
+
* @param alias The alias to identify the component.
|
|
373
|
+
* @returns The canvas element. If the component does not exist, it will return `undefined`.
|
|
373
374
|
* @example
|
|
374
375
|
* ```ts
|
|
375
376
|
* const sprite = canvas.find<Sprite>("bunny");
|
|
@@ -552,12 +553,12 @@ interface CanvasManagerInterface {
|
|
|
552
553
|
*
|
|
553
554
|
* Pixi’VN will keep track of the animation state of this function.
|
|
554
555
|
* So Pixi’VN will save the animation state in saves.
|
|
555
|
-
* @param components
|
|
556
|
-
* @param keyframes
|
|
557
|
-
* @param options
|
|
558
|
-
* @param priority
|
|
559
|
-
* @returns The
|
|
560
|
-
* @template T
|
|
556
|
+
* @param components The PixiJS component(s) to animate. This can be a single component, an array of components, or a string representing the component's alias.
|
|
557
|
+
* @param keyframes This is an object containing the properties to animate and the values to reach.
|
|
558
|
+
* @param options [`motion` options](https://motion.dev/docs/animate#options) for the animation, including duration, `easing`, and ticker.
|
|
559
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority. @default UPDATE_PRIORITY.NORMAL
|
|
560
|
+
* @returns The function returns the ID of the ticker created to animate the component(s).
|
|
561
|
+
* @template T The type of Pixi’VN component(s) being animated.
|
|
561
562
|
*/
|
|
562
563
|
animate<T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: KeyframesType<T>, options?: AnimationOptions, priority?: UPDATE_PRIORITY$1): string | undefined;
|
|
563
564
|
/**
|
|
@@ -566,12 +567,12 @@ interface CanvasManagerInterface {
|
|
|
566
567
|
*
|
|
567
568
|
* Pixi’VN will keep track of the animation state of this function.
|
|
568
569
|
* So Pixi’VN will save the animation state in saves.
|
|
569
|
-
* @param components
|
|
570
|
-
* @param sequence
|
|
571
|
-
* @param options
|
|
572
|
-
* @param priority
|
|
573
|
-
* @returns The
|
|
574
|
-
* @template T
|
|
570
|
+
* @param components The PixiJS component(s) to animate. This can be a single component, an array of components, or a string representing the component's alias.
|
|
571
|
+
* @param sequence The sequence of keyframes to animate the component(s) with.
|
|
572
|
+
* @param options [`motion` options](https://motion.dev/docs/animate#options) for the animation, including duration, `easing`, and ticker.
|
|
573
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority. @default UPDATE_PRIORITY.NORMAL
|
|
574
|
+
* @returns The function returns the ID of the ticker created to animate the component(s).
|
|
575
|
+
* @template T The type of Pixi’VN component(s) being animated.
|
|
575
576
|
*/
|
|
576
577
|
animate<T extends CanvasBaseInterface<any>>(components: T | string, sequence: (ObjectSegment<T> | ObjectSegmentWithTransition<T>)[], options?: SequenceOptions, priority?: UPDATE_PRIORITY$1): string | undefined;
|
|
577
578
|
/**
|
|
@@ -746,6 +747,9 @@ interface SpriteMemory extends SpriteBaseMemory {
|
|
|
746
747
|
* ```
|
|
747
748
|
*/
|
|
748
749
|
declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = SpriteMemory> extends _drincs_pixi_vn_pixi_js__default.Sprite implements CanvasBaseItem<Memory | SpriteMemory>, ListenerExtension, AdditionalPositionsExtension {
|
|
750
|
+
/**
|
|
751
|
+
* @param options The options for the component.
|
|
752
|
+
*/
|
|
749
753
|
constructor(options?: SpriteOptions | Texture$1);
|
|
750
754
|
readonly pixivnId: string;
|
|
751
755
|
get memory(): Memory | SpriteMemory;
|
|
@@ -836,6 +840,10 @@ declare class ImageSprite<Memory extends ImageSpriteMemory = ImageSpriteMemory>
|
|
|
836
840
|
private _textureAlias?;
|
|
837
841
|
protected get textureAlias(): string;
|
|
838
842
|
readonly pixivnId: string;
|
|
843
|
+
/**
|
|
844
|
+
* @param options The options for the component.
|
|
845
|
+
* @param textureAlias The URL or path. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
846
|
+
*/
|
|
839
847
|
constructor(options?: ImageSpriteOptions | Omit<Texture$1, "on"> | undefined, textureAlias?: string);
|
|
840
848
|
get memory(): ImageSpriteMemory;
|
|
841
849
|
setMemory(memory: Memory | SpriteMemory): Promise<void>;
|
|
@@ -887,6 +895,10 @@ interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
|
887
895
|
* ```
|
|
888
896
|
*/
|
|
889
897
|
declare class VideoSprite extends ImageSprite<VideoSpriteMemory> {
|
|
898
|
+
/**
|
|
899
|
+
* @param options The options for the component.
|
|
900
|
+
* @param textureAlias The URL or path. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
901
|
+
*/
|
|
890
902
|
constructor(options?: VideoSpriteOptions | Texture$1 | undefined, textureAlias?: string);
|
|
891
903
|
readonly pixivnId: string;
|
|
892
904
|
get memory(): VideoSpriteMemory;
|
|
@@ -1031,6 +1043,10 @@ interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
|
1031
1043
|
* ```
|
|
1032
1044
|
*/
|
|
1033
1045
|
declare class ImageContainer extends Container<ImageSprite, ImageContainerMemory> {
|
|
1046
|
+
/**
|
|
1047
|
+
* @param options The options for the component.
|
|
1048
|
+
* @param textureAliases An array of image URLs or paths. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
1049
|
+
*/
|
|
1034
1050
|
constructor(options?: ImageContainerOptions<ImageSprite>, textureAliases?: string[]);
|
|
1035
1051
|
get memory(): ImageContainerMemory;
|
|
1036
1052
|
setMemory(value: ImageContainerMemory): Promise<void>;
|
|
@@ -1324,7 +1340,7 @@ type SerializableEventHandler = (...args: never[]) => unknown;
|
|
|
1324
1340
|
*
|
|
1325
1341
|
* sprite.on("pointerdown", Events.eventExample);
|
|
1326
1342
|
* ```
|
|
1327
|
-
* @param name
|
|
1343
|
+
* @param name The id used by Pixi’VN to refer to this function (must be unique). If you don't pass the id, the function name will be used as the id.
|
|
1328
1344
|
* @returns
|
|
1329
1345
|
*/
|
|
1330
1346
|
declare function eventDecorator(name?: string): (_target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
@@ -1362,9 +1378,9 @@ declare namespace RegisteredEvents {
|
|
|
1362
1378
|
/**
|
|
1363
1379
|
* Shake the canvas element.
|
|
1364
1380
|
* If there is a/more ticker(s) with the same alias, then the ticker(s) is/are paused.
|
|
1365
|
-
* @param alias
|
|
1366
|
-
* @param options
|
|
1367
|
-
* @param priority
|
|
1381
|
+
* @param alias The alias to identify the component.
|
|
1382
|
+
* @param options Animation options, matching the `options` of animate function.
|
|
1383
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority.
|
|
1368
1384
|
* @returns
|
|
1369
1385
|
*/
|
|
1370
1386
|
declare function shakeEffect(alias: string, options?: ShakeEffectProps, priority?: UPDATE_PRIORITY$1): Promise<string[] | undefined>;
|
|
@@ -1569,11 +1585,11 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1569
1585
|
/**
|
|
1570
1586
|
* Add a list of images in the container, after that, the images are added to the canvas.
|
|
1571
1587
|
* Is the same that {@link showImageContainer}, but the image is not shown.
|
|
1572
|
-
* If you want to show the
|
|
1573
|
-
* @param alias is the unique alias of the
|
|
1588
|
+
* If you want to show the container, then you need to use the function {@link ImageSprite.load()}.
|
|
1589
|
+
* @param alias is the unique alias of the container. You can use this alias to refer to this container
|
|
1574
1590
|
* @param imageUrls is the url of the image. If you don't provide the url, then the alias is used as the url.
|
|
1575
|
-
* @param options The options of the
|
|
1576
|
-
* @returns
|
|
1591
|
+
* @param options The options of the container.
|
|
1592
|
+
* @returns This function returns an {@link ImageContainer} that you can use to manipulate the component.
|
|
1577
1593
|
* @example
|
|
1578
1594
|
* ```ts
|
|
1579
1595
|
* let bunny = addImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
@@ -1583,10 +1599,10 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1583
1599
|
declare function addImageCointainer(alias: string, imageUrls: string[], options?: ImageContainerOptions<ImageSprite>): ImageContainer;
|
|
1584
1600
|
/**
|
|
1585
1601
|
* Add a list of images in the container, after that, the images are added and shown in the canvas.
|
|
1586
|
-
* @param alias The unique alias of the
|
|
1602
|
+
* @param alias The unique alias of the container. You can use this alias to refer to this container
|
|
1587
1603
|
* @param imageUrls The url of the image.
|
|
1588
|
-
* @param options The options of the
|
|
1589
|
-
* @returns
|
|
1604
|
+
* @param options The options of the container.
|
|
1605
|
+
* @returns This function returns an {@link ImageContainer} that you can use to manipulate the component.
|
|
1590
1606
|
* @example
|
|
1591
1607
|
* ```ts
|
|
1592
1608
|
* let bunny = showImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
@@ -1599,9 +1615,9 @@ declare function showImageContainer(alias: string, imageUrls: string[], options?
|
|
|
1599
1615
|
* Is the same that {@link showImage}, but the image is not shown.
|
|
1600
1616
|
* If you want to show the image, then you need to use the function {@link ImageSprite.load}.
|
|
1601
1617
|
* @param alias is the unique alias of the image. You can use this alias to refer to this image
|
|
1602
|
-
* @param imageUrl
|
|
1618
|
+
* @param imageUrl The url of the image. If you have initialized the "asset matrix", you can use the alias of the texture. If you don't provide the URL, then the alias is used as the URL.
|
|
1603
1619
|
* @param options The options of the image.
|
|
1604
|
-
* @returns
|
|
1620
|
+
* @returns This function returns an {@link ImageSprite} that you can use to manipulate the component.
|
|
1605
1621
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1606
1622
|
* @example
|
|
1607
1623
|
* ```ts
|
|
@@ -1616,9 +1632,9 @@ declare function addImage(alias: string, imageUrl?: string, options?: ImageSprit
|
|
|
1616
1632
|
/**
|
|
1617
1633
|
* Add and show a image in the canvas. This function is a combination of {@link addImage}.
|
|
1618
1634
|
* @param alias The unique alias of the image. You can use this alias to refer to this image
|
|
1619
|
-
* @param imageUrl The url of the image.
|
|
1635
|
+
* @param imageUrl The url of the image. If you have initialized the "asset matrix", you can use the alias of the texture. If you don't provide the URL, then the alias is used as the URL.
|
|
1620
1636
|
* @param options The options of the image.
|
|
1621
|
-
* @returns
|
|
1637
|
+
* @returns This function returns an {@link ImageSprite} that you can use to manipulate the component.
|
|
1622
1638
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1623
1639
|
* @example
|
|
1624
1640
|
* ```ts
|
|
@@ -1634,7 +1650,7 @@ declare function showImage(alias: string, imageUrl?: string, options?: ImageSpri
|
|
|
1634
1650
|
* @param alias The unique alias of the text. You can use this alias to refer to this text.
|
|
1635
1651
|
* @param text
|
|
1636
1652
|
* @param options The options of the text.
|
|
1637
|
-
* @returns
|
|
1653
|
+
* @returns This function returns an {@link Text} that you can use to manipulate the component.
|
|
1638
1654
|
* @example
|
|
1639
1655
|
* ```ts
|
|
1640
1656
|
* let text = showText("text", "Hello World", { fontSize: 24, fill: "white" })
|
|
@@ -1657,7 +1673,7 @@ declare function getTexture(textureAlias?: string): Promise<Texture$1 | undefine
|
|
|
1657
1673
|
* @param alias is the unique alias of the video. You can use this alias to refer to this video
|
|
1658
1674
|
* @param videoUrl is the url of the video. If you don't provide the url, then the alias is used as the url.
|
|
1659
1675
|
* @param options The options of the video.
|
|
1660
|
-
* @returns
|
|
1676
|
+
* @returns This function returns an {@link VideoSprite} that you can use to manipulate the component.
|
|
1661
1677
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1662
1678
|
* @example
|
|
1663
1679
|
* ```ts
|
|
@@ -1674,7 +1690,7 @@ declare function addVideo(alias: string, videoUrl?: string, options?: VideoSprit
|
|
|
1674
1690
|
* @param alias The unique alias of the video. You can use this alias to refer to this video
|
|
1675
1691
|
* @param videoUrl The url of the video.
|
|
1676
1692
|
* @param options The options of the video.
|
|
1677
|
-
* @returns
|
|
1693
|
+
* @returns This function returns an {@link VideoSprite} that you can use to manipulate the component.
|
|
1678
1694
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1679
1695
|
* @example
|
|
1680
1696
|
* ```ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Bt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),L=require('@drincs/pixi-vn/narration'),pt=require('@drincs/pixi-vn/sound'),G=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Bt__namespace=/*#__PURE__*/_interopNamespace(Bt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var L__namespace=/*#__PURE__*/_interopNamespace(L);var pt__namespace=/*#__PURE__*/_interopNamespace(pt);var G__namespace=/*#__PURE__*/_interopNamespace(G);var Xt=Object.defineProperty;var Jt=h=>{throw TypeError(h)};var ue=(h,e,i)=>e in h?Xt(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var fe=(h,e)=>{for(var i in e)Xt(h,i,{get:e[i],enumerable:true});};var C=(h,e,i)=>ue(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Jt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),_=(h,e,i)=>e.has(h)?Jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var me=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ee=new Set,Gt=typeof process=="object"&&process?process:{},ie=(h,e,i,s)=>{typeof Gt.emitWarning=="function"?Gt.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Qt=globalThis.AbortSignal;if(typeof Nt>"u"){Qt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){e();}signal=new Qt;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let h=Gt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,ie("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var ge=h=>!ee.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),se=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,_e=(it=class{heap;length;static create(e){let i=se(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}constructor(e,i){if(!t(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,_(it,St,false),it),Zt,te,K,M,q,ut,$,yt,xt,B,O,X,T,b,m,P,z,N,R,J,D,Q,Z,V,W,tt,dt,j,Et,l,It,ft,ot,Tt,Y,oe,mt,bt,Ot,lt,ht,Mt,Lt,Ct,E,zt,At,ct,Vt,wt,re=(wt=class{constructor(e){_(this,l);_(this,K);_(this,M);_(this,q);_(this,ut);_(this,$);_(this,yt);_(this,xt);_(this,B);C(this,"ttl");C(this,"ttlResolution");C(this,"ttlAutopurge");C(this,"updateAgeOnGet");C(this,"updateAgeOnHas");C(this,"allowStale");C(this,"noDisposeOnSet");C(this,"noUpdateTTL");C(this,"maxEntrySize");C(this,"sizeCalculation");C(this,"noDeleteOnFetchRejection");C(this,"noDeleteOnStaleGet");C(this,"allowStaleOnFetchAbort");C(this,"allowStaleOnFetchRejection");C(this,"ignoreFetchAbort");_(this,O);_(this,X);_(this,T);_(this,b);_(this,m);_(this,P);_(this,z);_(this,N);_(this,R);_(this,J);_(this,D);_(this,Q);_(this,Z);_(this,V);_(this,W);_(this,tt);_(this,dt);_(this,j);_(this,Et);_(this,ft,()=>{});_(this,ot,()=>{});_(this,Tt,()=>{});_(this,Y,()=>false);_(this,mt,e=>{});_(this,bt,(e,i,s)=>{});_(this,Ot,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});C(this,Zt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:v,onInsert:U,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:_t}=e;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,B,_t??me),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?se(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,M,k),this.maxEntrySize=w||t(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!t(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,xt,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,dt,!!a),u(this,T,new Map),u(this,b,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,P,new vt(i)),u(this,z,new vt(i)),u(this,N,0),u(this,R,0),u(this,J,_e.create(i)),u(this,O,0),u(this,X,0),typeof v=="function"&&u(this,q,v),typeof U=="function"&&u(this,ut,U),typeof S=="function"?(u(this,$,S),u(this,D,[])):(u(this,$,void 0),u(this,D,void 0)),u(this,tt,!!t(this,q)),u(this,Et,!!t(this,ut)),u(this,j,!!t(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!g,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,M)!==0&&!at(t(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,oe).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,It).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,M)){let Pt="LRU_CACHE_UNBOUNDED";ge(Pt)&&(ee.add(Pt),ie("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,wt));}}get perf(){return t(this,B)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,b),valList:t(e,m),next:t(e,P),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,R)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,E).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,At).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,X)}get size(){return t(this,O)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,xt)}get dispose(){return t(this,q)}get onInsert(){return t(this,ut)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(te=Symbol.iterator,Zt=Symbol.toStringTag,te)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,b)[s],this))return this.get(t(this,b)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,ct).call(this,t(this,b)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,E).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,B).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,b)[i],r=t(this,m)[i],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,B).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=t(this,B).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var rt,I,k,w;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,U=t(this,Ot).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&U>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,ct).call(this,e,"set"),this;let S=t(this,O)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,O)===0?t(this,R):t(this,J).length!==0?t(this,J).pop():t(this,O)===t(this,K)?d(this,l,Lt).call(this,false):t(this,O),t(this,b)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,P)[t(this,R)]=S,t(this,z)[S]=t(this,R),u(this,R,S),Rt(this,O)._++,t(this,bt).call(this,S,U,p),p&&(p.set="add"),v=false,t(this,Et)&&((rt=t(this,ut))==null||rt.call(this,i,e,"add"));else {d(this,l,At).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,dt)&&d(this,l,E).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((I=t(this,q))==null||I.call(this,a,e,"set")),t(this,j)&&t(this,D)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,j)&&t(this,D)?.push([y,e,"set"]));if(t(this,mt).call(this,S),t(this,bt).call(this,S,U,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,E).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,Et)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,It).call(this),t(this,V)&&(v||t(this,Tt).call(this,S,r,n),p&&t(this,ot).call(this,p,S)),!o&&t(this,j)&&t(this,D)){let y=t(this,D),a;for(;a=y?.shift();)(w=t(this,$))==null||w.call(this,...a);}return this}pop(){var e;try{for(;t(this,O);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,E).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,D)){let i=t(this,D),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,E).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,ot).call(this,r,n));else return s&&t(this,ft).call(this,n),r&&(r.has="hit",t(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,E).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:U=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!t(this,dt))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let A={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:v,noUpdateTTL:U,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:x},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let g=d(this,l,Ct).call(this,e,f,A,w);return g.__returned=g}else {let g=t(this,m)[f];if(d(this,l,E).call(this,g)){let vt=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?g.__staleWhileFetching:g.__returned=g}let F=t(this,Y).call(this,f);if(!y&&!F)return a&&(a.fetch="hit"),d(this,l,At).call(this,f),r&&t(this,ft).call(this,f),a&&t(this,ot).call(this,a,f),g;let H=d(this,l,Ct).call(this,e,f,A,w),_t=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",_t&&F&&(a.returnedStale=true)),_t?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,xt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],v=d(this,l,E).call(this,p);return o&&t(this,ot).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,ct).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(d(this,l,At).call(this,c),r&&t(this,ft).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,ct).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ut=new WeakMap,$=new WeakMap,yt=new WeakMap,xt=new WeakMap,B=new WeakMap,O=new WeakMap,X=new WeakMap,T=new WeakMap,b=new WeakMap,m=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,R=new WeakMap,J=new WeakMap,D=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,Et=new WeakMap,l=new WeakSet,It=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Tt,(c,p,v=t(this,B).now())=>{i[c]=p!==0?v:0,e[c]=p,r(c,p);}),u(this,ft,c=>{i[c]=e[c]!==0?t(this,B).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,ct).call(this,t(this,b)[c],"expire");},p+1);v.unref&&v.unref(),s[c]=v;}}:()=>{};u(this,ot,(c,p)=>{if(e[p]){let v=e[p],U=i[p];if(!v||!U)return;c.ttl=v,c.start=U,c.now=n||o();let S=c.now-U;c.remainingTTL=v-S;}});let n=0,o=()=>{let c=t(this,B).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let v=e[p],U=i[p];if(!v||!U)return 1/0;let S=(n||o())-U;return v-S},u(this,Y,c=>{let p=i[c],v=e[c];return !!v&&!!p&&(n||o())-p>v});},ft=new WeakMap,ot=new WeakMap,Tt=new WeakMap,Y=new WeakMap,oe=function(){let e=new Dt(t(this,K));u(this,X,0),u(this,Q,e),u(this,mt,i=>{u(this,X,t(this,X)-e[i]),e[i]=0;}),u(this,Ot,(i,s,r,n)=>{if(d(this,l,E).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),u(this,bt,(i,s,r)=>{if(e[i]=s,t(this,M)){let n=t(this,M)-e[i];for(;t(this,X)>n;)d(this,l,Lt).call(this,true);}u(this,X,t(this,X)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,X));});},mt=new WeakMap,bt=new WeakMap,Ot=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,R);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,N);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,R)));)i=t(this,P)[i];},Mt=function(e){return e!==void 0&&t(this,T).get(t(this,b)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,b)[i],r=t(this,m)[i];return t(this,dt)&&d(this,l,E).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,j)&&t(this,D)?.push([r,s,"evict"])),t(this,mt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,b)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,O)===1?(u(this,N,u(this,R,0)),t(this,J).length=0):u(this,N,t(this,P)[i]),t(this,T).delete(s),Rt(this,O)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,E).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,A=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,A);let f=I,g=t(this,m)[i];return (g===I||x&&y&&g===void 0)&&(w===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,ct).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,p.options))),w},U=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,A=x||s.allowStaleOnFetchRejection,f=A||s.noDeleteOnFetchRejection,g=I;if(t(this,m)[i]===I&&(!f||!y&&g.__staleWhileFetching===void 0?d(this,l,ct).call(this,e,"fetch"):x||(t(this,m)[i]=g.__staleWhileFetching)),A)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw w},rt=(w,y)=>{var x;let a=(x=t(this,yt))==null?void 0:x.call(this,e,n,p);a&&a instanceof Promise&&a.then(A=>w(A===void 0?void 0:A),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=A=>v(A,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(v,U),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},E=function(e){if(!t(this,dt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,P)[e]=i;},At=function(e){e!==t(this,R)&&(e===t(this,N)?u(this,N,t(this,P)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,P)[e]),d(this,l,zt).call(this,t(this,R),e),u(this,R,e));},ct=function(e,i){var r,n;let s=false;if(t(this,O)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,O)===1)d(this,l,Vt).call(this,i);else {t(this,mt).call(this,o);let c=t(this,m)[o];if(d(this,l,E).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,j)&&t(this,D)?.push([c,e,i])),t(this,T).delete(e),t(this,b)[o]=void 0,t(this,m)[o]=void 0,o===t(this,R))u(this,R,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,P)[o]);else {let p=t(this,z)[o];t(this,P)[p]=t(this,P)[o];let v=t(this,P)[o];t(this,z)[v]=t(this,z)[o];}Rt(this,O)._--,t(this,J).push(o);}}if(t(this,j)&&t(this,D)?.length){let o=t(this,D),c;for(;c=o?.shift();)(n=t(this,$))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,E).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,b)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,j)&&t(this,D)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,b).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,R,0),t(this,J).length=0,u(this,X,0),u(this,O,0),t(this,j)&&t(this,D)){let r=t(this,D),n;for(;n=r?.shift();)(s=t(this,$))==null||s.call(this,...n);}},wt);var Ft=class{cache;map=new Map;constructor(e){this.cache=new re({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut="1.8.17";var Wt={version:Ut};var Yt="repeat";function Ht(h){return {type:"pause",duration:h}}var Kt="__game_layer__";var ve={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var ae={};var kt={};fe(kt,{createExportableElement:()=>le});var gt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(gt||={});function le(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw gt.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ye=typeof window<"u"&&typeof document<"u",he=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${Wt.version}`],ce=31,xe="background:#2f90da;color:#fff;font-weight:bold;",Ee="background:#c832bb;color:#fff;font-weight:bold;",be="background:transparent;font-weight:bold;",qt=` v${Wt.version}`;function de(){if(!ye)return;let h=[],e=[];for(let i=0;i<he.length;i++){let s=he[i],r=s.endsWith(qt),n=r?s.slice(0,-qt.length):s,o=n.slice(0,ce),c=n.slice(ce),p=r?"%c%s%c%s%c%s":"%c%s%c%s";h.push(p),e.push(xe,o,Ee,c),r&&e.push(be,qt);}console.info(h.join(`
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Bt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),L=require('@drincs/pixi-vn/narration'),pt=require('@drincs/pixi-vn/sound'),G=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Bt__namespace=/*#__PURE__*/_interopNamespace(Bt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var L__namespace=/*#__PURE__*/_interopNamespace(L);var pt__namespace=/*#__PURE__*/_interopNamespace(pt);var G__namespace=/*#__PURE__*/_interopNamespace(G);var Xt=Object.defineProperty;var Jt=h=>{throw TypeError(h)};var ue=(h,e,i)=>e in h?Xt(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var fe=(h,e)=>{for(var i in e)Xt(h,i,{get:e[i],enumerable:true});};var C=(h,e,i)=>ue(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Jt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),_=(h,e,i)=>e.has(h)?Jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var me=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ee=new Set,Gt=typeof process=="object"&&process?process:{},ie=(h,e,i,s)=>{typeof Gt.emitWarning=="function"?Gt.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Qt=globalThis.AbortSignal;if(typeof Nt>"u"){Qt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){e();}signal=new Qt;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let h=Gt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,ie("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var ge=h=>!ee.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),se=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,_e=(it=class{heap;length;static create(e){let i=se(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}constructor(e,i){if(!t(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,_(it,St,false),it),Zt,te,K,M,q,ut,$,yt,xt,B,O,X,T,b,m,P,z,N,R,J,D,Q,Z,V,W,tt,dt,j,Et,l,It,ft,ot,Tt,Y,oe,mt,bt,Ot,lt,ht,Mt,Lt,Ct,E,zt,At,ct,Vt,wt,re=(wt=class{constructor(e){_(this,l);_(this,K);_(this,M);_(this,q);_(this,ut);_(this,$);_(this,yt);_(this,xt);_(this,B);C(this,"ttl");C(this,"ttlResolution");C(this,"ttlAutopurge");C(this,"updateAgeOnGet");C(this,"updateAgeOnHas");C(this,"allowStale");C(this,"noDisposeOnSet");C(this,"noUpdateTTL");C(this,"maxEntrySize");C(this,"sizeCalculation");C(this,"noDeleteOnFetchRejection");C(this,"noDeleteOnStaleGet");C(this,"allowStaleOnFetchAbort");C(this,"allowStaleOnFetchRejection");C(this,"ignoreFetchAbort");_(this,O);_(this,X);_(this,T);_(this,b);_(this,m);_(this,P);_(this,z);_(this,N);_(this,R);_(this,J);_(this,D);_(this,Q);_(this,Z);_(this,V);_(this,W);_(this,tt);_(this,dt);_(this,j);_(this,Et);_(this,ft,()=>{});_(this,ot,()=>{});_(this,Tt,()=>{});_(this,Y,()=>false);_(this,mt,e=>{});_(this,bt,(e,i,s)=>{});_(this,Ot,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});C(this,Zt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:v,onInsert:U,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:_t}=e;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,B,_t??me),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?se(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,M,k),this.maxEntrySize=w||t(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!t(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,xt,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,dt,!!a),u(this,T,new Map),u(this,b,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,P,new vt(i)),u(this,z,new vt(i)),u(this,N,0),u(this,R,0),u(this,J,_e.create(i)),u(this,O,0),u(this,X,0),typeof v=="function"&&u(this,q,v),typeof U=="function"&&u(this,ut,U),typeof S=="function"?(u(this,$,S),u(this,D,[])):(u(this,$,void 0),u(this,D,void 0)),u(this,tt,!!t(this,q)),u(this,Et,!!t(this,ut)),u(this,j,!!t(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!g,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,M)!==0&&!at(t(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,oe).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,It).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,M)){let Pt="LRU_CACHE_UNBOUNDED";ge(Pt)&&(ee.add(Pt),ie("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,wt));}}get perf(){return t(this,B)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,b),valList:t(e,m),next:t(e,P),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,R)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,E).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,At).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,X)}get size(){return t(this,O)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,xt)}get dispose(){return t(this,q)}get onInsert(){return t(this,ut)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(te=Symbol.iterator,Zt=Symbol.toStringTag,te)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,b)[s],this))return this.get(t(this,b)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,ct).call(this,t(this,b)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,E).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,B).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,b)[i],r=t(this,m)[i],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,B).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=t(this,B).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var rt,I,k,w;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,U=t(this,Ot).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&U>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,ct).call(this,e,"set"),this;let S=t(this,O)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,O)===0?t(this,R):t(this,J).length!==0?t(this,J).pop():t(this,O)===t(this,K)?d(this,l,Lt).call(this,false):t(this,O),t(this,b)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,P)[t(this,R)]=S,t(this,z)[S]=t(this,R),u(this,R,S),Rt(this,O)._++,t(this,bt).call(this,S,U,p),p&&(p.set="add"),v=false,t(this,Et)&&((rt=t(this,ut))==null||rt.call(this,i,e,"add"));else {d(this,l,At).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,dt)&&d(this,l,E).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((I=t(this,q))==null||I.call(this,a,e,"set")),t(this,j)&&t(this,D)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,j)&&t(this,D)?.push([y,e,"set"]));if(t(this,mt).call(this,S),t(this,bt).call(this,S,U,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,E).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,Et)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,It).call(this),t(this,V)&&(v||t(this,Tt).call(this,S,r,n),p&&t(this,ot).call(this,p,S)),!o&&t(this,j)&&t(this,D)){let y=t(this,D),a;for(;a=y?.shift();)(w=t(this,$))==null||w.call(this,...a);}return this}pop(){var e;try{for(;t(this,O);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,E).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,D)){let i=t(this,D),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,E).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,ot).call(this,r,n));else return s&&t(this,ft).call(this,n),r&&(r.has="hit",t(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,E).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:U=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!t(this,dt))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let A={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:v,noUpdateTTL:U,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:x},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let g=d(this,l,Ct).call(this,e,f,A,w);return g.__returned=g}else {let g=t(this,m)[f];if(d(this,l,E).call(this,g)){let vt=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?g.__staleWhileFetching:g.__returned=g}let F=t(this,Y).call(this,f);if(!y&&!F)return a&&(a.fetch="hit"),d(this,l,At).call(this,f),r&&t(this,ft).call(this,f),a&&t(this,ot).call(this,a,f),g;let H=d(this,l,Ct).call(this,e,f,A,w),_t=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",_t&&F&&(a.returnedStale=true)),_t?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,xt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],v=d(this,l,E).call(this,p);return o&&t(this,ot).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,ct).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(d(this,l,At).call(this,c),r&&t(this,ft).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,ct).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ut=new WeakMap,$=new WeakMap,yt=new WeakMap,xt=new WeakMap,B=new WeakMap,O=new WeakMap,X=new WeakMap,T=new WeakMap,b=new WeakMap,m=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,R=new WeakMap,J=new WeakMap,D=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,Et=new WeakMap,l=new WeakSet,It=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Tt,(c,p,v=t(this,B).now())=>{i[c]=p!==0?v:0,e[c]=p,r(c,p);}),u(this,ft,c=>{i[c]=e[c]!==0?t(this,B).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,ct).call(this,t(this,b)[c],"expire");},p+1);v.unref&&v.unref(),s[c]=v;}}:()=>{};u(this,ot,(c,p)=>{if(e[p]){let v=e[p],U=i[p];if(!v||!U)return;c.ttl=v,c.start=U,c.now=n||o();let S=c.now-U;c.remainingTTL=v-S;}});let n=0,o=()=>{let c=t(this,B).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let v=e[p],U=i[p];if(!v||!U)return 1/0;let S=(n||o())-U;return v-S},u(this,Y,c=>{let p=i[c],v=e[c];return !!v&&!!p&&(n||o())-p>v});},ft=new WeakMap,ot=new WeakMap,Tt=new WeakMap,Y=new WeakMap,oe=function(){let e=new Dt(t(this,K));u(this,X,0),u(this,Q,e),u(this,mt,i=>{u(this,X,t(this,X)-e[i]),e[i]=0;}),u(this,Ot,(i,s,r,n)=>{if(d(this,l,E).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),u(this,bt,(i,s,r)=>{if(e[i]=s,t(this,M)){let n=t(this,M)-e[i];for(;t(this,X)>n;)d(this,l,Lt).call(this,true);}u(this,X,t(this,X)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,X));});},mt=new WeakMap,bt=new WeakMap,Ot=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,R);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,N);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,R)));)i=t(this,P)[i];},Mt=function(e){return e!==void 0&&t(this,T).get(t(this,b)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,b)[i],r=t(this,m)[i];return t(this,dt)&&d(this,l,E).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,j)&&t(this,D)?.push([r,s,"evict"])),t(this,mt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,b)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,O)===1?(u(this,N,u(this,R,0)),t(this,J).length=0):u(this,N,t(this,P)[i]),t(this,T).delete(s),Rt(this,O)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,E).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,A=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,A);let f=I,g=t(this,m)[i];return (g===I||x&&y&&g===void 0)&&(w===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,ct).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,p.options))),w},U=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,A=x||s.allowStaleOnFetchRejection,f=A||s.noDeleteOnFetchRejection,g=I;if(t(this,m)[i]===I&&(!f||!y&&g.__staleWhileFetching===void 0?d(this,l,ct).call(this,e,"fetch"):x||(t(this,m)[i]=g.__staleWhileFetching)),A)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw w},rt=(w,y)=>{var x;let a=(x=t(this,yt))==null?void 0:x.call(this,e,n,p);a&&a instanceof Promise&&a.then(A=>w(A===void 0?void 0:A),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=A=>v(A,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(v,U),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},E=function(e){if(!t(this,dt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,P)[e]=i;},At=function(e){e!==t(this,R)&&(e===t(this,N)?u(this,N,t(this,P)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,P)[e]),d(this,l,zt).call(this,t(this,R),e),u(this,R,e));},ct=function(e,i){var r,n;let s=false;if(t(this,O)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,O)===1)d(this,l,Vt).call(this,i);else {t(this,mt).call(this,o);let c=t(this,m)[o];if(d(this,l,E).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,j)&&t(this,D)?.push([c,e,i])),t(this,T).delete(e),t(this,b)[o]=void 0,t(this,m)[o]=void 0,o===t(this,R))u(this,R,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,P)[o]);else {let p=t(this,z)[o];t(this,P)[p]=t(this,P)[o];let v=t(this,P)[o];t(this,z)[v]=t(this,z)[o];}Rt(this,O)._--,t(this,J).push(o);}}if(t(this,j)&&t(this,D)?.length){let o=t(this,D),c;for(;c=o?.shift();)(n=t(this,$))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,E).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,b)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,j)&&t(this,D)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,b).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,R,0),t(this,J).length=0,u(this,X,0),u(this,O,0),t(this,j)&&t(this,D)){let r=t(this,D),n;for(;n=r?.shift();)(s=t(this,$))==null||s.call(this,...n);}},wt);var Ft=class{cache;map=new Map;constructor(e){this.cache=new re({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut="1.8.18";var Wt={version:Ut};var Yt="repeat";function Ht(h){return {type:"pause",duration:h}}var Kt="__game_layer__";var ve={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var ae={};var kt={};fe(kt,{createExportableElement:()=>le});var gt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(gt||={});function le(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw gt.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ye=typeof window<"u"&&typeof document<"u",he=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${Wt.version}`],ce=31,xe="background:#2f90da;color:#fff;font-weight:bold;",Ee="background:#c832bb;color:#fff;font-weight:bold;",be="background:transparent;font-weight:bold;",qt=` v${Wt.version}`;function de(){if(!ye)return;let h=[],e=[];for(let i=0;i<he.length;i++){let s=he[i],r=s.endsWith(qt),n=r?s.slice(0,-qt.length):s,o=n.slice(0,ce),c=n.slice(ce),p=r?"%c%s%c%s%c%s":"%c%s%c%s";h.push(p),e.push(xe,o,Ee,c),r&&e.push(be,qt);}console.info(h.join(`
|
|
2
2
|
`),...e);}function $t(){let h=window.location.pathname+window.location.hash;return h.includes("#")&&(h=h.split("#")[1]),h}de();exports.Game=void 0;(y=>{async function h(a,x,A){if(core.GameUnifier.init({navigate:x?.navigate,getCurrentGameStepState:()=>{let f={};try{f=nt__namespace.canvas.export();}catch{}return {path:$t(),storage:G__namespace.storage.export(),canvas:f,sound:pt__namespace.sound.export(),labelIndex:L__namespace.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:L__namespace.narration.openedLabels}},restoreGameStepState:async(f,g)=>{et__namespace.HistoryManagerStatic._originalStepData=f,L__namespace.NarrationManagerStatic.openedLabels=f.openedLabels,G__namespace.storage.restore(f.storage);try{await nt__namespace.canvas.restore(f.canvas),await pt__namespace.sound.restore(f.sound);}catch(F){gt.error("Error restoring game step state:",F);}await g(f.path);},getStepCounter:()=>L__namespace.narration.stepCounter,setStepCounter:f=>{L__namespace.NarrationManagerStatic._stepCounter=f;},getOpenedLabels:()=>L__namespace.narration.openedLabels.length,addHistoryItem:(f,g)=>et__namespace.stepHistory.add(f,g),getCharacter:f=>Bt__namespace.RegisteredCharacters.get(f),processNavigationRequests:(f,g)=>{let F=f,H=Promise.resolve();return f>0?(F--,H=L__namespace.narration.continue(g)):f<0&&(F=0,H=et__namespace.stepHistory.back(g,{steps:f*-1})),{newValue:F,result:H}},animate:(f,g,F,H)=>motion.motion.animate(f,g,F,H),getVariable:(f,g)=>G__namespace.StorageRegistry.getVariable(f,g),setVariable:(f,g,F)=>G__namespace.StorageRegistry.setVariable(f,g,F),removeVariable:(f,g)=>G__namespace.StorageRegistry.removeVariable(f,g),getFlag:f=>G__namespace.storage.getFlag(f),setFlag:(f,g)=>G__namespace.storage.setFlag(f,g),onLabelClosing:f=>G__namespace.StorageRegistry.clearOldTempVariables(f)}),!a||!x){gt.warn("The canvas element or options are not defined. The canvas will not be initialized.");return}return await nt__namespace.canvas.init(a,x,A)}y.init=h;function e(){G__namespace.storage.clear();try{nt__namespace.canvas.clear();}catch{}pt__namespace.sound.clear(),L__namespace.narration.clear(),et__namespace.stepHistory.clear();}y.clear=e;function i(){let a={};try{a=nt__namespace.canvas.export();}catch{}return {pixivn_version:Ut,stepData:L__namespace.narration.export(),storageData:G__namespace.storage.export(),canvasData:a,soundData:pt__namespace.sound.export(),historyData:et__namespace.stepHistory.export(),path:$t()}}y.exportGameState=i;async function s(a,x){et__namespace.stepHistory.restore(a.historyData);let A=et__namespace.stepHistory.lastKey;if(typeof A=="number"){let f=et__namespace.stepHistory.stepsInfoMap.get(A)||null;await L__namespace.narration.restore(a.stepData,f);}G__namespace.storage.restore(a.storageData);try{await nt__namespace.canvas.restore(a.canvasData),await pt__namespace.sound.restore(a.soundData);}catch{}x?await x(a.path):await core.GameUnifier.navigate(a.path);}y.restoreGameState=s;async function r(a,x){return y.clear(),await L__namespace.narration.call(a,x)}y.start=r;function n(a){return JSON.parse(a)}y.jsonToGameState=n;function o(a){core.GameUnifier.onEnd=a;}y.onEnd=o;function c(a){return gt.warn("Game.onError is deprecated. Use Game.addOnError / Game.removeOnError to register multiple handlers."),core.GameUnifier.addOnError((x,A)=>a("step",x,A))}y.onError=c;function p(a){return core.GameUnifier.addOnError(a)}y.addOnError=p;function v(a){return core.GameUnifier.removeOnError(a)}y.removeOnError=v;function U(a){L__namespace.NarrationManagerStatic.onStepStart=a;}y.onStepStart=U;function S(a){L__namespace.NarrationManagerStatic.onLoadingLabel=a;}y.onLoadingLabel=S;function rt(a){L__namespace.NarrationManagerStatic.onStepEnd=a;}y.onStepEnd=rt;function I(a){core.GameUnifier.navigate=a;}y.onNavigate=I;function k(a){return core.GameUnifier.addOnPreContinue(a)}y.addOnPreContinue=k;function w(a){return core.GameUnifier.removeOnPreContinue(a)}y.removeOnPreContinue=w;})(exports.Game||={});var Ze={characterUtils:Bt__namespace,canvasUtils:nt__namespace,narrationUtils:L__namespace,soundUtils:pt__namespace,CANVAS_APP_GAME_LAYER_ALIAS:Kt,Pause:Ht,Repeat:Yt,PIXIVN_VERSION:Ut,...kt,...ae,canvas:nt__namespace.canvas,narration:L__namespace.narration,sound:pt__namespace.sound,storage:G__namespace.storage,history:et__namespace.stepHistory,Game:exports.Game,GameUnifier:core.GameUnifier};exports.CANVAS_APP_GAME_LAYER_ALIAS=Kt;exports.CachedMap=Ft;exports.PIXIVN_VERSION=Ut;exports.Pause=Ht;exports.Repeat=Yt;exports.SYSTEM_RESERVED_STORAGE_KEYS=ve;exports.createExportableElement=le;exports.default=Ze;Object.keys(nt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return nt[k]}})});Object.keys(Bt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return Bt[k]}})});Object.keys(core).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return core[k]}})});Object.keys(et).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return et[k]}})});Object.keys(L).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return L[k]}})});Object.keys(pt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return pt[k]}})});Object.keys(G).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return G[k]}})});
|