adofai 3.0.1 → 3.2.0
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 +111 -111
- package/dist/src/effectProcessor.js +37 -2
- package/dist/src/events/AddDecoration.d.ts +8 -7
- package/dist/src/events/AddObject.d.ts +5 -4
- package/dist/src/events/AddText.d.ts +5 -4
- package/dist/src/events/AnimateTrack.d.ts +3 -2
- package/dist/src/events/AutoPlayTiles.d.ts +2 -1
- package/dist/src/events/Bookmark.d.ts +2 -1
- package/dist/src/events/ChangeTrack.d.ts +2 -1
- package/dist/src/events/CustomBackground.d.ts +9 -8
- package/dist/src/events/Flash.d.ts +2 -1
- package/dist/src/events/FreeRoam.d.ts +4 -3
- package/dist/src/events/FreeRoamRemove.d.ts +2 -1
- package/dist/src/events/FreeRoamTwirl.d.ts +2 -1
- package/dist/src/events/Hide.d.ts +5 -4
- package/dist/src/events/MoveCamera.d.ts +4 -3
- package/dist/src/events/MoveDecorations.d.ts +5 -4
- package/dist/src/events/MoveTrack.d.ts +3 -2
- package/dist/src/events/Pause.d.ts +2 -1
- package/dist/src/events/PlaySound.d.ts +3 -2
- package/dist/src/events/PositionTrack.d.ts +3 -2
- package/dist/src/events/ScaleMargin.d.ts +2 -1
- package/dist/src/events/ScalePlanets.d.ts +2 -1
- package/dist/src/events/ScaleRadius.d.ts +2 -1
- package/dist/src/events/SetConditionalEvents.d.ts +2 -1
- package/dist/src/events/SetFilter.d.ts +2 -1
- package/dist/src/events/SetFilterAdvanced.d.ts +2 -1
- package/dist/src/events/SetFloorIcon.d.ts +2 -1
- package/dist/src/events/SetFrameRate.d.ts +2 -1
- package/dist/src/events/SetHitsound.d.ts +3 -2
- package/dist/src/events/SetHoldSound.d.ts +2 -1
- package/dist/src/events/SetInputEvent.d.ts +4 -3
- package/dist/src/events/SetObject.d.ts +3 -2
- package/dist/src/events/SetParticle.d.ts +2 -1
- package/dist/src/events/SetText.d.ts +3 -2
- package/dist/src/format.js +3 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/parser/LargeFileParser.d.ts +20 -0
- package/dist/src/parser/LargeFileParser.js +382 -0
- package/dist/src/parser.d.ts +2 -1
- package/dist/src/parser.js +2 -1
- package/dist/src/pathdata.js +3 -1
- package/dist/src/presets.js +8 -5
- package/dist/src/types.d.ts +104 -0
- package/dist/src/types.js +34 -0
- package/dist/umd/index.js +1 -1
- package/package.json +97 -92
- package/dist/src/parser/ArrayBufferParser copy.d.ts +0 -9
- package/dist/src/parser/ArrayBufferParser copy.js +0 -98
- package/dist/src/parser/BufferParser copy.d.ts +0 -9
- package/dist/src/parser/BufferParser copy.js +0 -92
- package/dist/src/parser/BufferParserX.d.ts +0 -23
- package/dist/src/parser/BufferParserX.js +0 -77
- package/dist/src/parser/FileParser.d.ts +0 -9
- package/dist/src/parser/FileParser.js +0 -30
- package/dist/src/structure/format copy.d.ts +0 -8
- package/dist/src/structure/format copy.js +0 -44
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export type Vec2 = [number, number];
|
|
2
|
+
export type ABoolean = boolean | 'Enabled' | 'Disabled' | 'true' | 'false';
|
|
3
|
+
export declare const enum TextAnchor {
|
|
4
|
+
UpperLeft = "UpperLeft",
|
|
5
|
+
UpperCenter = "UpperCenter",
|
|
6
|
+
UpperRight = "UpperRight",
|
|
7
|
+
MiddleLeft = "MiddleLeft",
|
|
8
|
+
MiddleCenter = "MiddleCenter",
|
|
9
|
+
MiddleRight = "MiddleRight",
|
|
10
|
+
LowerLeft = "LowerLeft",
|
|
11
|
+
LowerCenter = "LowerCenter",
|
|
12
|
+
LowerRight = "LowerRight"
|
|
13
|
+
}
|
|
14
|
+
export declare const enum Hitbox {
|
|
15
|
+
None = "None",
|
|
16
|
+
Kill = "Kill",
|
|
17
|
+
PassThrough = "PassThrough",
|
|
18
|
+
NoEffect = "NoEffect"
|
|
19
|
+
}
|
|
20
|
+
export declare const enum FilterType {
|
|
21
|
+
Grayscale = "Grayscale",
|
|
22
|
+
Sepia = "Sepia",
|
|
23
|
+
Invert = "Invert",
|
|
24
|
+
Pixellate = "Pixellate",
|
|
25
|
+
Blur = "Blur",
|
|
26
|
+
Glitch = "Glitch",
|
|
27
|
+
Bloom = "Bloom",
|
|
28
|
+
VHS = "VHS",
|
|
29
|
+
Warp = "Warp",
|
|
30
|
+
RadialBlur = "RadialBlur",
|
|
31
|
+
Custom = "Custom"
|
|
32
|
+
}
|
|
33
|
+
export declare const enum FlashStyle {
|
|
34
|
+
Flash = "Flash",
|
|
35
|
+
Reverse = "Reverse",
|
|
36
|
+
StayBlack = "StayBlack",
|
|
37
|
+
Kill = "Kill",
|
|
38
|
+
FlashEx = "FlashEx"
|
|
39
|
+
}
|
|
40
|
+
export declare const enum RelativeTo {
|
|
41
|
+
Tile = "Tile",
|
|
42
|
+
LastPosition = "LastPosition",
|
|
43
|
+
Player = "Player"
|
|
44
|
+
}
|
|
45
|
+
export declare const enum TargetPlanet {
|
|
46
|
+
All = "All",
|
|
47
|
+
Current = "Current",
|
|
48
|
+
Specific = "Specific"
|
|
49
|
+
}
|
|
50
|
+
export declare const enum AngleCorrectionDir {
|
|
51
|
+
None = "None",
|
|
52
|
+
CW = "CW",
|
|
53
|
+
CCW = "CCW"
|
|
54
|
+
}
|
|
55
|
+
export declare const enum InputEventState {
|
|
56
|
+
Subscribe = "Subscribe",
|
|
57
|
+
Unsubscribe = "Unsubscribe"
|
|
58
|
+
}
|
|
59
|
+
export declare const enum InputEventTarget {
|
|
60
|
+
Pressed = "Pressed",
|
|
61
|
+
Released = "Released",
|
|
62
|
+
Held = "Held",
|
|
63
|
+
Neutral = "Neutral"
|
|
64
|
+
}
|
|
65
|
+
export declare const enum Condition {
|
|
66
|
+
IfPassed = "IfPassed",
|
|
67
|
+
IfFailed = "IfFailed"
|
|
68
|
+
}
|
|
69
|
+
export declare const enum BgDisplayMode {
|
|
70
|
+
FitToScreen = "FitToScreen",
|
|
71
|
+
Unscaled = "Unscaled",
|
|
72
|
+
Tiled = "Tiled"
|
|
73
|
+
}
|
|
74
|
+
export declare const enum BgShapeType {
|
|
75
|
+
Disabled = "Disabled",
|
|
76
|
+
Tile = "Tile",
|
|
77
|
+
Circle = "Circle",
|
|
78
|
+
Diamond = "Diamond",
|
|
79
|
+
Triangle = "Triangle",
|
|
80
|
+
Hexagon = "Hexagon",
|
|
81
|
+
Donut = "Donut",
|
|
82
|
+
Pentagon = "Pentagon",
|
|
83
|
+
Custom = "Custom"
|
|
84
|
+
}
|
|
85
|
+
export declare const enum HitsoundType {
|
|
86
|
+
Kick = "Kick",
|
|
87
|
+
Snare = "Snare",
|
|
88
|
+
Hat = "Hat",
|
|
89
|
+
Clap = "Clap",
|
|
90
|
+
Custom = "Custom"
|
|
91
|
+
}
|
|
92
|
+
export declare const enum HoldMidSoundTimingRelativeTo {
|
|
93
|
+
Start = "Start",
|
|
94
|
+
End = "End"
|
|
95
|
+
}
|
|
96
|
+
export declare function isEventEnabled(value: ABoolean | undefined, defaultValue: boolean): boolean;
|
|
97
|
+
export type TileReferenceType = 'ThisTile' | 'Start' | 'End';
|
|
98
|
+
export type TileReference = [number, TileReferenceType];
|
|
99
|
+
export declare function resolveTileReference(relativeTo: TileReference | undefined, thisTileId: number, totalTiles: number): number;
|
|
100
|
+
export type Vec2Like = [number, number] | {
|
|
101
|
+
x: number;
|
|
102
|
+
y: number;
|
|
103
|
+
};
|
|
104
|
+
export declare function normalizeVec2(v: Vec2Like | undefined): [number, number];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function isEventEnabled(value, defaultValue) {
|
|
2
|
+
if (value === undefined)
|
|
3
|
+
return defaultValue;
|
|
4
|
+
if (typeof value === 'boolean')
|
|
5
|
+
return value;
|
|
6
|
+
return value === 'Enabled' || value === 'true';
|
|
7
|
+
}
|
|
8
|
+
export function resolveTileReference(relativeTo, thisTileId, totalTiles) {
|
|
9
|
+
if (!relativeTo)
|
|
10
|
+
return thisTileId;
|
|
11
|
+
const [offset, type] = relativeTo;
|
|
12
|
+
let result;
|
|
13
|
+
switch (type) {
|
|
14
|
+
case 'Start':
|
|
15
|
+
result = offset;
|
|
16
|
+
break;
|
|
17
|
+
case 'End':
|
|
18
|
+
result = totalTiles - 1 + offset;
|
|
19
|
+
break;
|
|
20
|
+
case 'ThisTile':
|
|
21
|
+
default:
|
|
22
|
+
result = thisTileId + offset;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
return Math.max(0, Math.min(result, totalTiles - 1));
|
|
26
|
+
}
|
|
27
|
+
export function normalizeVec2(v) {
|
|
28
|
+
var _a, _b, _c, _d;
|
|
29
|
+
if (!v)
|
|
30
|
+
return [0, 0];
|
|
31
|
+
if (Array.isArray(v))
|
|
32
|
+
return [(_a = v[0]) !== null && _a !== void 0 ? _a : 0, (_b = v[1]) !== null && _b !== void 0 ? _b : 0];
|
|
33
|
+
return [(_c = v.x) !== null && _c !== void 0 ? _c : 0, (_d = v.y) !== null && _d !== void 0 ? _d : 0];
|
|
34
|
+
}
|
package/dist/umd/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ADOFAI=e():t.ADOFAI=e()}(globalThis,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Events:()=>o,Level:()=>mt,Parsers:()=>r,Presets:()=>n,Structure:()=>i,pathData:()=>s});var r={};t.r(r),t.d(r,{ArrayBufferParser:()=>$,BufferParser:()=>j,StringParser:()=>I,default:()=>q});var n={};t.r(n),t.d(n,{preset_inner_no_deco:()=>st,preset_noeffect:()=>nt,preset_noeffect_completely:()=>at,preset_noholds:()=>it,preset_nomovecamera:()=>ot});var i={};t.r(i),t.d(i,{default:()=>mt});var o={};t.r(o);var a={R:0,p:15,J:30,E:45,T:60,o:75,U:90,q:105,G:120,Q:135,H:150,W:165,L:180,x:195,N:210,Z:225,F:240,V:255,D:270,Y:285,B:300,C:315,M:330,A:345,5:555,6:666,7:777,8:888,"!":999};const s={pathDataTable:a,parseToangleData:function(t){return Array.from(t).map((function(t){return a[t]}))}};function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function c(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}const f=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e=t,r=[{key:"parseError",value:function(t){return t}},{key:"parseAsObject",value:function(e,r){return(r||JSON).parse(t.parseAsText(e))}},{key:"parseAsText",value:function(t){return this.parseError(t)}}],null&&l(e.prototype,null),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function p(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v(n.key),n)}}function y(t,e,r){return e&&p(t.prototype,e),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function v(t){var e=function(t){if("object"!=h(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==h(e)?e:e+""}const d=y((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}));function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,O(n.key),n)}}function w(t,e,r){return e&&m(t.prototype,e),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function O(t){var e=function(t){if("object"!=g(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(e)?e:e+""}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(k=function(){return!!t})()}function S(t){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},S(t)}function _(t,e){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_(t,e)}var E=function(t){function e(){return b(this,e),t=this,n=arguments,r=S(r=e),function(t,e){if(e&&("object"==g(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,k()?Reflect.construct(r,n||[],S(t).constructor):r.apply(t,n));var t,r,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_(t,e)}(e,t),w(e,[{key:"parse",value:function(t){var e,r;return e="string"==typeof t?(new TextEncoder).encode(t):(r=t).length>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.subarray(3):r,new A(e).parseValue()}},{key:"stringify",value:function(t){return JSON.stringify(t)}}])}(d),A=function(){return w((function t(e){b(this,t),this.data=e,this.pos=0,this.decoder=new TextDecoder("utf-8"),this.length=e.length}),[{key:"parseValue",value:function(){this.eatWhitespace();var t=this.peek();if(-1===t)return null;switch(t){case 123:return this.parseObject();case 91:return this.parseArray();case 34:return this.parseString();case 116:return this.parseKeyword(!0);case 102:return this.parseKeyword(!1);case 110:return this.parseKeyword(null);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:return this.pos++,null}}},{key:"parseObject",value:function(){var t={};for(this.pos++;;){if(this.eatWhitespace(),125===this.peek()){this.pos++;break}var e=this.parseString();if(this.eatWhitespace(),58!==this.peek())break;this.pos++,t[e]=this.parseValue(),this.eatWhitespace(),44===this.peek()&&this.pos++}return t}},{key:"parseArray",value:function(){var t=[];for(this.pos++;;){if(this.eatWhitespace(),93===this.peek()){this.pos++;break}t.push(this.parseValue()),this.eatWhitespace(),44===this.peek()&&this.pos++}return t}},{key:"parseString",value:function(){this.pos++;for(var t=this.pos,e=!1;this.pos<this.length;){var r=this.data[this.pos];if(34===r)break;92===r?(e=!0,this.pos+=2):this.pos++}var n=this.pos;this.pos++;var i=this.data.subarray(t,n);return e?this.processEscapes(i):this.decoder.decode(i)}},{key:"processEscapes",value:function(t){for(var e=this.decoder.decode(t),r="",n=0;n<e.length;n++)if("\\"===e[n]&&n+1<e.length){var i=e[++n];switch(i){case'"':case"\\":case"/":r+=i;break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":r+=String.fromCharCode(parseInt(e.substr(n+1,4),16)),n+=4}}else r+=e[n];return r}},{key:"parseNumber",value:function(){for(var t=this.pos;this.pos<this.length;){var e=this.data[this.pos];if(!(e>=48&&e<=57||46===e||101===e||69===e||43===e||45===e))break;this.pos++}var r=this.decoder.decode(this.data.subarray(t,this.pos));return parseFloat(r)}},{key:"parseKeyword",value:function(t){var e=this.data[this.pos];return 116===e?this.pos+=4:102===e?this.pos+=5:110===e&&(this.pos+=4),t}},{key:"eatWhitespace",value:function(){for(;this.pos<this.length;){var t=this.data[this.pos];if(32!==t&&10!==t&&13!==t&&9!==t)break;this.pos++}}},{key:"peek",value:function(){return this.pos<this.length?this.data[this.pos]:-1}}])}();const j=E;function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,C(n.key),n)}}function N(t,e,r){return e&&x(t.prototype,e),r&&x(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function C(t){var e=function(t){if("object"!=P(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==P(e)?e:e+""}function M(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(M=function(){return!!t})()}function R(t){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},R(t)}function U(t,e){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},U(t,e)}var K=function(t){function e(){return D(this,e),t=this,n=arguments,r=R(r=e),function(t,e){if(e&&("object"==P(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,M()?Reflect.construct(r,n||[],R(t).constructor):r.apply(t,n));var t,r,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&U(t,e)}(e,t),N(e,[{key:"parse",value:function(t,r){if(null==t)return null;var n=new B(t).parseValue();return"function"==typeof r?e._applyReviver("",n,r):n}},{key:"stringify",value:function(t,e,r){return new F(e,r).serialize(t)}}],[{key:"_applyReviver",value:function(t,r,n){if(r&&"object"===P(r))if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]=e._applyReviver(i.toString(),r[i],n);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(r[o]=e._applyReviver(o,r[o],n));return n(t,r)}}])}(d),B=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;D(this,t),this.json=e,this.position=0,this.endSection=r,65279===this.peek()&&this.read()}return N(t,[{key:"parseValue",value:function(){return this.parseByToken(this.nextToken)}},{key:"parseObject",value:function(){var e={};for(this.read();;){var r=void 0;do{if((r=this.nextToken)===t.TOKEN.NONE)return null;if(r===t.TOKEN.CURLY_CLOSE)return e}while(r===t.TOKEN.COMMA);var n=this.parseString();if(null===n)return null;if(this.nextToken!==t.TOKEN.COLON)return null;if(null!=this.endSection&&n===this.endSection)return e;this.read(),e[n]=this.parseValue()}}},{key:"parseArray",value:function(){var e=[];this.read();for(var r=!0;r;){var n=this.nextToken;switch(n){case t.TOKEN.NONE:return null;case t.TOKEN.SQUARED_CLOSE:r=!1;break;case t.TOKEN.COMMA:break;default:var i=this.parseByToken(n);e.push(i)}}return e}},{key:"parseByToken",value:function(e){switch(e){case t.TOKEN.CURLY_OPEN:return this.parseObject();case t.TOKEN.SQUARED_OPEN:return this.parseArray();case t.TOKEN.STRING:return this.parseString();case t.TOKEN.NUMBER:return this.parseNumber();case t.TOKEN.TRUE:return!0;case t.TOKEN.FALSE:return!1;case t.TOKEN.NULL:default:return null}}},{key:"parseString",value:function(){var t="";this.read();for(var e=!0;e&&-1!==this.peek();){var r=this.nextChar;switch(r){case'"':e=!1;break;case"\\":if(-1===this.peek()){e=!1;break}var n=this.nextChar;switch(n){case'"':case"/":case"\\":t+=n;break;case"b":t+="\b";break;case"f":t+="\f";break;case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"u":for(var i="",o=0;o<4;o++)i+=this.nextChar;t+=String.fromCharCode(Number.parseInt(i,16))}break;default:t+=r}}return t}},{key:"parseNumber",value:function(){var t=this.nextWord;return-1===t.indexOf(".")?Number.parseInt(t,10)||0:Number.parseFloat(t)||0}},{key:"eatWhitespace",value:function(){for(;-1!==t.WHITE_SPACE.indexOf(this.peekChar)&&(this.read(),-1!==this.peek()););}},{key:"peek",value:function(){return this.position>=this.json.length?-1:this.json.charCodeAt(this.position)}},{key:"read",value:function(){return this.position>=this.json.length?-1:this.json.charCodeAt(this.position++)}},{key:"peekChar",get:function(){var t=this.peek();return-1===t?"\0":String.fromCharCode(t)}},{key:"nextChar",get:function(){var t=this.read();return-1===t?"\0":String.fromCharCode(t)}},{key:"nextWord",get:function(){for(var e="";-1===t.WORD_BREAK.indexOf(this.peekChar)&&(e+=this.nextChar,-1!==this.peek()););return e}},{key:"nextToken",get:function(){if(this.eatWhitespace(),-1===this.peek())return t.TOKEN.NONE;switch(this.peekChar){case'"':return t.TOKEN.STRING;case",":return this.read(),t.TOKEN.COMMA;case"-":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return t.TOKEN.NUMBER;case":":return t.TOKEN.COLON;case"[":return t.TOKEN.SQUARED_OPEN;case"]":return this.read(),t.TOKEN.SQUARED_CLOSE;case"{":return t.TOKEN.CURLY_OPEN;case"}":return this.read(),t.TOKEN.CURLY_CLOSE;default:switch(this.nextWord){case"false":return t.TOKEN.FALSE;case"true":return t.TOKEN.TRUE;case"null":return t.TOKEN.NULL;default:return t.TOKEN.NONE}}}}])}();B.WHITE_SPACE=" \t\n\r\ufeff",B.WORD_BREAK=' \t\n\r{}[],:"',B.TOKEN={NONE:0,CURLY_OPEN:1,CURLY_CLOSE:2,SQUARED_OPEN:3,SQUARED_CLOSE:4,COLON:5,COMMA:6,STRING:7,NUMBER:8,TRUE:9,FALSE:10,NULL:11};var F=function(){return N((function t(e,r){D(this,t),this.result="",this.indent=0,this.indentStr="",this.replacer=e||null,this.space=r||null,"number"==typeof r?this.indentStr=" ".repeat(Math.min(10,Math.max(0,r))):"string"==typeof r&&(this.indentStr=r.slice(0,10))}),[{key:"serialize",value:function(t){return this.result="",this.serializeValue(t,""),this.result}},{key:"serializeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";"function"==typeof this.replacer&&(t=this.replacer(e,t)),null==t?this.result+="null":"string"==typeof t?this.serializeString(t):"boolean"==typeof t?this.result+=t.toString():Array.isArray(t)?this.serializeArray(t):"object"===P(t)?this.serializeObject(t):this.serializeOther(t)}},{key:"serializeObject",value:function(t){var e=!0;for(var r in this.result+="{",this.indentStr&&(this.result+="\n",this.indent++),t)if(Object.prototype.hasOwnProperty.call(t,r)){if(Array.isArray(this.replacer)&&!this.replacer.includes(r))continue;e||(this.result+=",",this.indentStr&&(this.result+="\n")),this.indentStr&&(this.result+=this.indentStr.repeat(this.indent)),this.serializeString(r.toString()),this.result+=":",this.indentStr&&(this.result+=" "),this.serializeValue(t[r],r),e=!1}this.indentStr&&(this.result+="\n",this.indent--,this.result+=this.indentStr.repeat(this.indent)),this.result+="}"}},{key:"serializeArray",value:function(t){this.result+="[",this.indentStr&&t.length>0&&(this.result+="\n",this.indent++);for(var e=!0,r=0;r<t.length;r++)e||(this.result+=",",this.indentStr&&(this.result+="\n")),this.indentStr&&(this.result+=this.indentStr.repeat(this.indent)),this.serializeValue(t[r],r.toString()),e=!1;this.indentStr&&t.length>0&&(this.result+="\n",this.indent--,this.result+=this.indentStr.repeat(this.indent)),this.result+="]"}},{key:"serializeString",value:function(t){this.result+='"';var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;switch(n){case"\b":this.result+="\\b";break;case"\t":this.result+="\\t";break;case"\n":this.result+="\\n";break;case"\f":this.result+="\\f";break;case"\r":this.result+="\\r";break;case'"':this.result+='\\"';break;case"\\":this.result+="\\\\";break;default:var i=n.charCodeAt(0);this.result+=i>=32&&i<=126?n:"\\u"+i.toString(16).padStart(4,"0")}}}catch(t){r.e(t)}finally{r.f()}this.result+='"'}},{key:"serializeOther",value:function(t){"number"==typeof t?isFinite(t)?this.result+=t.toString():this.result+="null":this.serializeString(t.toString())}}])}();const I=K;function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function z(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,W(n.key),n)}}function W(t){var e=function(t){if("object"!=L(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=L(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==L(e)?e:e+""}function G(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(G=function(){return!!t})()}function V(t){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},V(t)}function H(t,e){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},H(t,e)}var J=new Uint8Array([239,187,191]),Y=new Uint8Array([44]);function Q(t){var e=new Uint8Array(t);return e.length>=3&&e[0]===J[0]&&e[1]===J[1]&&e[2]===J[2]?t.slice(3):t}const $=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=V(e),function(t,e){if(e&&("object"==L(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,G()?Reflect.construct(e,r||[],V(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&H(t,e)}(e,t),r=e,(n=[{key:"parse",value:function(t){return"string"==typeof t?I.prototype.parse.call(I.prototype,t):I.prototype.parse.call(I.prototype,(e=function(t){for(var e=new Uint8Array(t),r=[],n="other",i=0,o=0;o<e.length;o++){var a=e[o];if("escape"==n)n="string";else switch(a){case 34:switch(n){case"string":n="other";break;case"comma":r.push(Y);default:n="string"}break;case 92:"string"===n&&(n="escape");break;case 44:r.push(e.subarray(i,o)),i=o+1,"other"===n&&(n="comma");break;case 93:case 125:"comma"===n&&(n="other");break;case 9:case 10:case 11:case 12:case 13:case 32:break;default:"comma"===n&&(r.push(Y),n="other")}}r.push(e.subarray(i));for(var s=0,u=0,l=r;u<l.length;u++)s+=l[u].length;for(var c=new Uint8Array(s),f=0,h=0,p=r;h<p.length;h++){var y=p[h];c.set(y,f),f+=y.length}return c.buffer}(Q(t)),r=Q(e),new TextDecoder("utf-8").decode(r)));var e,r}},{key:"stringify",value:function(t){return JSON.stringify(t)}}])&&z(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(d),q=f;function Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"\t",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if("object"!==Z(t)||null===t)return JSON.stringify(t);if(Array.isArray(t)){if(t.every((function(t){return"object"!==Z(t)||null===t})))return"["+t.map((function(t){return X(t,0,!1,n,i)})).join(",")+"]";var o=n.repeat(e),a=n.repeat(e+i);return"[\n"+t.map((function(t){return a+tt(t,n)})).join(",\n")+"\n"+o+"]"}var s=n.repeat(e),u=Object.keys(t);if(r){var l=n.repeat(i);return"{\n"+u.map((function(e){return l+JSON.stringify(e)+": "+X(t[e],i,!1,n,i)})).join(",\n")+"\n}"}return"{\n"+u.map((function(r){return s+n.repeat(i)+JSON.stringify(r)+": "+X(t[r],e+i,!1,n,i)})).join(",\n")+"\n"+s+"}"}function tt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"\t";return"object"!==Z(t)||null===t?X(t,0,!1,e):Array.isArray(t)?"["+t.map((function(t){return tt(t,e)})).join(",")+"]":"{"+Object.keys(t).map((function(r){return JSON.stringify(r)+": "+tt(t[r],e)})).join(", ")+"}"}const et=X;var rt,nt={type:"exclude",events:["Flash","SetFilter","SetFilterAdvanced","HallOfMirrors","Bloom","ScalePlanets","ScreenTile","ScreenScroll","ShakeScreen"]},it={type:"exclude",events:["Hold"]},ot={type:"exclude",events:["MoveCamera"]},at={type:"exclude",events:["AddDecoration","AddText","AddObject","Checkpoint","SetHitsound","PlaySound","SetPlanetRotation","ScalePlanets","ColorTrack","AnimateTrack","RecolorTrack","MoveTrack","PositionTrack","MoveDecorations","SetText","SetObject","SetDefaultText","CustomBackground","Flash","MoveCamera","SetFilter","HallOfMirrors","ShakeScreen","Bloom","ScreenTile","ScreenScroll","SetFrameRate","RepeatEvents","SetConditionalEvents","EditorComment","Bookmark","Hold","SetHoldSound","Hide","ScaleMargin","ScaleRadius"]},st={type:"special",events:["MoveDecorations","SetText","SetObject","SetDefaultText"]};!function(t){t.include="include",t.exclude="exclude",t.special="special"}(rt||(rt={}));const ut=function(t){if(!Array.isArray(t))throw new Error("Arguments are not supported.");return t.map((function(t){var e=Object.assign({},t);return e.hasOwnProperty("addDecorations")&&(e.addDecorations=[]),Array.isArray(e.actions)&&(e.actions=e.actions.filter((function(t){return!st.events.includes(t.eventType)}))),e}))},lt=function(t,e){return e.map((function(e){var r=Object.assign({},e);return Array.isArray(e.actions)&&(r.actions=e.actions.filter((function(e){return!t.includes(e.eventType)}))),r}))},ct=function(t,e){return e.map((function(e){var r=Object.assign({},e);return Array.isArray(e.actions)&&(r.actions=e.actions.filter((function(e){return t.includes(e.eventType)}))),r}))};function ft(){ft=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(e,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return u(a,"_invoke",function(e,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var l=c(e,r,n);if("normal"===l.type){if(i=n.done?4:2,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=4,n.method="throw",n.arg=l.arg)}}}(e,n,new _(i||[])),!0),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f={};function h(){}function p(){}function y(){}var v={};u(v,o,(function(){return this}));var d=Object.getPrototypeOf,g=d&&d(d(E([])));g&&g!==r&&n.call(g,o)&&(v=g);var b=y.prototype=h.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==ht(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;u(this,"_invoke",(function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}),!0)}function O(e,r){var n=r.method,i=e.i[n];if(i===t)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=c(i,e.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,f;var a=o.arg;return a?a.done?(r[e.r]=a.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,f):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function k(t){this.tryEntries.push(t)}function S(e){var r=e[4]||{};r.type="normal",r.arg=t,e[4]=r}function _(t){this.tryEntries=[[-1]],t.forEach(k,this),this.reset(!0)}function E(e){if(null!=e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(ht(e)+" is not iterable")}return p.prototype=y,u(b,"constructor",y),u(y,"constructor",p),p.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},m(w.prototype),u(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new w(l(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(b),u(b,s,"Generator"),u(b,o,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},e.values=E,_.prototype={constructor:_,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t){a.type="throw",a.arg=e,r.next=t}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,u=o[1],l=o[2];if(-1===o[0])return n("end"),!1;if(!u&&!l)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<u)return this.method="next",this.arg=t,n(u),!0;if(s<l)return n(l),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===t||"continue"===t)&&i[0]<=e&&e<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i[2],f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={i:E(e),r,n},"next"===this.method&&(this.arg=t),f}},e}function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function pt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=yt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function yt(t,e){if(t){if("string"==typeof t)return vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vt(t,e):void 0}}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function dt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gt(n.key),n)}}function gt(t){var e=function(t){if("object"!=ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ht(e)?e:e+""}var bt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r},mt=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._precomputedEvents=null,this._precomputeMode=!1,this._lightweightData=null,this._events=new Map,this.guidCallbacks=new Map,this._options=e,this._provider=r},e=[{key:"generateGUID",value:function(){return"event_".concat(function(){var t,e=new Uint8Array(16),r=null!==(t=globalThis.crypto)&&void 0!==t?t:null===globalThis||void 0===globalThis?void 0:globalThis.msCrypto;if(null==r?void 0:r.getRandomValues)r.getRandomValues(e);else for(var n=0;n<16;n++)e[n]=Math.floor(256*Math.random());e[6]=15&e[6]|64,e[8]=63&e[8]|128;var i=function(t){return(t>>>4).toString(16)+(15&t).toString(16)};return i(e[0])+i(e[1])+i(e[2])+i(e[3])+"-"+i(e[4])+i(e[5])+"-"+i(e[6])+i(e[7])+"-"+i(e[8])+i(e[9])+"-"+i(e[10])+i(e[11])+i(e[12])+i(e[13])+i(e[14])+i(e[15])}())}},{key:"_emitProgress",value:function(t,e,r,n){var i={stage:t,current:e,total:r,percent:r>0?Math.round(e/r*100):0,data:n};this._precomputeMode&&this._precomputedEvents?this._precomputedEvents[t].push(i):(this.trigger("parse:progress",i),this.trigger("parse:".concat(t),i))}},{key:"enablePrecomputeMode",value:function(){this._precomputeMode=!0,this._precomputedEvents={start:[],pathData:[],angleData:[],relativeAngle:[],tilePosition:[],complete:[]}}},{key:"disablePrecomputeMode",value:function(){this._precomputeMode=!1}},{key:"getPrecomputedEvents",value:function(){return this._precomputedEvents}},{key:"clearPrecomputedEvents",value:function(){this._precomputedEvents=null}},{key:"getEventsAtPercent",value:function(t,e){if(!this._precomputedEvents)return[];for(var r=[],n=0,i=e?[e]:["start","pathData","angleData","relativeAngle","tilePosition","complete"];n<i.length;n++){var o,a=i[n],s=pt(this._precomputedEvents[a]);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.percent<=t&&(0===r.length||r[r.length-1].percent<=u.percent)){var l=r[r.length-1];l&&l.stage===u.stage&&l.current===u.current||r.push(u)}}}catch(t){s.e(t)}finally{s.f()}}return r}},{key:"getPrecomputedEventCount",value:function(t){return this._precomputedEvents?t?this._precomputedEvents[t].length:Object.values(this._precomputedEvents).reduce((function(t,e){return t+e.length}),0):0}},{key:"getLightweightData",value:function(){return this._lightweightData}},{key:"precomputeLightweight",value:function(){for(var t,e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.tiles.length,i=new Array(n),o=r?[]:new Array(n),a=new Array(n),s=0;s<n;s++){var u=this.tiles[s];i[s]=null!==(t=u.angle)&&void 0!==t?t:0,a[s]=(null!==(e=u.twirl)&&void 0!==e?e:0)%2==1}if(!r){var l,c=[0,0],f=this.angleData,h=new Map,p=pt(this.actions);try{for(p.s();!(l=p.n()).done;){var y=l.value;"PositionTrack"===y.eventType&&y.positionOffset&&!0!==y.editorOnly&&"Enabled"!==y.editorOnly&&h.set(y.floor,y)}}catch(t){p.e(t)}finally{p.f()}for(var v=0;v<n;v++){var d=h.get(v);(null==d?void 0:d.positionOffset)&&(c[0]+=d.positionOffset[0],c[1]+=d.positionOffset[1]),o[v]=[c[0],c[1]];var g=void 0;if(999===f[v]){for(var b=1;v-b>=0&&999===f[v-b];)b++;g=(v-b>=0?f[v-b]:0)+180*(b-1)}else g=f[v];var m=g*Math.PI/180;c[0]+=Math.cos(m),c[1]+=Math.sin(m)}}return this._lightweightData={totalTiles:n,angles:i,positions:o,twirlFlags:a,computed:!0},this._lightweightData}},{key:"getLightweightDataRange",value:function(t,e){if(!this._lightweightData)return null;var r=Math.min(t+e,this._lightweightData.totalTiles);return{angles:this._lightweightData.angles.slice(t,r),positions:this._lightweightData.positions.slice(t,r),twirlFlags:this._lightweightData.twirlFlags.slice(t,r)}}},{key:"clearLightweightData",value:function(){this._lightweightData=null}},{key:"getTileRenderData",value:function(t){var e,r;if(t<0||t>=this.tiles.length)return null;var n=this.tiles[t];return{angle:null!==(e=n.angle)&&void 0!==e?e:0,position:n.position?[n.position[0],n.position[1]]:null,hasTwirl:(null!==(r=n.twirl)&&void 0!==r?r:0)%2==1}}},{key:"load",value:function(){var t=this;return new Promise((function(e,r){var n,i,o=t._options;t._emitProgress("start",0,0);var a=o instanceof ArrayBuffer,u=o instanceof Uint8Array,l="undefined"!=typeof Buffer&&Buffer.isBuffer(o);if("string"==typeof o||a||u||l)try{var c=a?new Uint8Array(o):o;i=null===(n=t._provider)||void 0===n?void 0:n.parse(c)}catch(t){return void r("解析失败: "+t)}else{if("object"!==ht(o)||null===o)return void r("Options must be String, Buffer, ArrayBuffer or Object");i=Object.assign({},o)}var f=i&&"object"===ht(i)&&null!==i&&void 0!==i.pathData,h=i&&"object"===ht(i)&&null!==i&&void 0!==i.angleData;if(f){var p=i.pathData;t._emitProgress("pathData",0,p.length,{source:p}),t.angleData=s.parseToangleData(p),t._emitProgress("pathData",p.length,p.length,{source:p,processed:t.angleData})}else{if(!h)return void r("There is not any angle datas.");t.angleData=i.angleData,t._emitProgress("angleData",t.angleData.length,t.angleData.length,{processed:t.angleData})}i&&"object"===ht(i)&&null!==i&&Array.isArray(i.actions)?t.actions=i.actions:t.actions=[],i&&"object"===ht(i)&&null!==i&&void 0!==i.settings?(t.settings=i.settings,i&&"object"===ht(i)&&null!==i&&Array.isArray(i.decorations)?t.__decorations=i.decorations:t.__decorations=[],t.tiles=[],t._angleDir=-180,t._twirlCount=0,t._createArray(t.angleData.length,{angleData:t.angleData,actions:t.actions,decorations:t.__decorations}).then((function(r){t.tiles=r,t._emitProgress("complete",t.angleData.length,t.angleData.length),t.trigger("load",t),e(!0)})).catch((function(t){r(t)}))):r("There is no ADOFAI settings.")}))}},{key:"on",value:function(t,e){this._events.has(t)||this._events.set(t,[]);var r=this.generateGUID();return this._events.get(t).push({guid:r,callback:e}),this.guidCallbacks.set(r,{eventName:t,callback:e}),r}},{key:"trigger",value:function(t,e){this._events.has(t)&&this._events.get(t).forEach((function(t){return(0,t.callback)(e)}))}},{key:"off",value:function(t){if(this.guidCallbacks.has(t)){var e=this.guidCallbacks.get(t).eventName;if(this.guidCallbacks.delete(t),this._events.has(e)){var r=this._events.get(e),n=r.findIndex((function(e){return e.guid===t}));-1!==n&&r.splice(n,1)}}}},{key:"_createArray",value:function(t,e){return r=this,n=void 0,i=void 0,o=ft().mark((function r(){var n,i,o,a,s,u,l,c,f,h,p,y,v,d,g,b,m,w;return ft().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=new Array(t),i=Math.max(100,Math.floor(t/100)),o=new Map,Array.isArray(e.actions)){a=pt(e.actions);try{for(a.s();!(s=a.n()).done;)u=s.value,o.has(u.floor)||o.set(u.floor,[]),o.get(u.floor).push(u)}catch(t){a.e(t)}finally{a.f()}}if(l=new Map,Array.isArray(e.decorations)){c=pt(e.decorations);try{for(c.s();!(f=c.n()).done;)h=f.value,l.has(h.floor)||l.set(h.floor,[]),l.get(h.floor).push(h)}catch(t){c.e(t)}finally{c.f()}}p=0;case 7:if(!(p<t)){r.next=24;break}y=o.get(p)||[],v=l.get(p)||[],d=pt(y);try{for(d.s();!(g=d.n()).done;)"Twirl"===g.value.eventType&&this._twirlCount++}catch(t){d.e(t)}finally{d.f()}if(b=this._parseAngle(e.angleData,p,this._twirlCount%2),m=y.map((function(t){return t.floor,bt(t,["floor"])})),w=v.map((function(t){return t.floor,bt(t,["floor"])})),n[p]={direction:e.angleData[p],_lastdir:e.angleData[p-1]||0,actions:m,angle:b,addDecorations:w,twirl:this._twirlCount,extraProps:{}},p%i!==0&&p!==t-1){r.next=21;break}if(this._emitProgress("relativeAngle",p+1,t,{tileIndex:p,angle:e.angleData[p],relativeAngle:b}),p%(10*i)!=0){r.next=21;break}return r.next=21,new Promise((function(t){return setTimeout(t,0)}));case 21:p++,r.next=7;break;case 24:return r.abrupt("return",n);case 25:case"end":return r.stop()}}),r,this)})),new(i||(i=Promise))((function(t,e){function a(t){try{u(o.next(t))}catch(t){e(t)}}function s(t){try{u(o.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(a,s)}u((o=o.apply(r,n||[])).next())}));var r,n,i,o}},{key:"_changeAngle",value:function(){var t=this,e=0;return this.tiles.map((function(r){return e++,r.angle=t._parsechangedAngle(r.direction,e,r.twirl,r._lastdir),r}))}},{key:"_normalizeAngle",value:function(t){return(t%360+360)%360}},{key:"_parsechangedAngle",value:function(t,e,r,n){var i,o=0;if(0===e&&(this._angleDir=180),999===t){for(var a=1;e-a-1>=0&&999===(null===(i=this.tiles[e-a-1])||void 0===i?void 0:i.direction);)a++;var s=e-a-1>=0?this.tiles[e-a-1].direction:0;this._angleDir=this._normalizeAngle(s+180*(a-1)),isNaN(this._angleDir)&&(this._angleDir=0),o=0}else{var u=this._normalizeAngle(this._angleDir-t);0===(o=0===r?u:this._normalizeAngle(360-u))&&(o=360),this._angleDir=this._normalizeAngle(t+180)}return o}},{key:"_filterByFloor",value:function(t,e){if(!Array.isArray(t))return[];var r=t.filter((function(t){return t.floor===e}));return this._twirlCount+=r.filter((function(t){return"Twirl"===t.eventType})).length,r.map((function(t){return t.floor,bt(t,["floor"])}))}},{key:"_flattenAngleDatas",value:function(t){return t.map((function(t){return t.direction}))}},{key:"_flattenActionsWithFloor",value:function(t){return t.flatMap((function(t,e){return(Array.isArray(null==t?void 0:t.actions)?t.actions:[]).map((function(t){t.floor;var r=bt(t,["floor"]);return Object.assign({floor:e},r)}))}))}},{key:"_filterByFloorwithDeco",value:function(t,e){return Array.isArray(t)?t.filter((function(t){return t.floor===e})).map((function(t){return t.floor,bt(t,["floor"])})):[]}},{key:"_flattenDecorationsWithFloor",value:function(t){return t.flatMap((function(t,e){return(Array.isArray(null==t?void 0:t.addDecorations)?t.addDecorations:[]).map((function(t){t.floor;var r=bt(t,["floor"]);return Object.assign({floor:e},r)}))}))}},{key:"_parseAngle",value:function(t,e,r){var n=0;if(0===e&&(this._angleDir=180),999===t[e]){for(var i=1;e-i>=0&&999===t[e-i];)i++;var o=e-i>=0?t[e-i]:0;this._angleDir=this._normalizeAngle(o+180*(i-1)),isNaN(this._angleDir)&&(this._angleDir=0),n=0}else{var a=this._normalizeAngle(this._angleDir-t[e]);0===(n=0===r?a:this._normalizeAngle(360-a))&&(n=360),this._angleDir=this._normalizeAngle(t[e]+180)}return n}},{key:"filterActionsByEventType",value:function(t){return Object.entries(this.tiles).flatMap((function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||yt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=e[0],n=e[1];return(Array.isArray(n.actions)?n.actions:[]).map((function(t){return{b:t,index:r}}))})).filter((function(e){return e.b.eventType===t})).map((function(t){var e=t.b,r=t.index;return{index:Number(r),action:e}}))}},{key:"getActionsByIndex",value:function(t,e){var r=this.filterActionsByEventType(t).filter((function(t){return t.index===e}));return{count:r.length,actions:r.map((function(t){return t.action}))}}},{key:"calculateTileCoordinates",value:function(){console.warn("calculateTileCoordinates is deprecated. Use calculateTilePosition instead.")}},{key:"calculateTilePosition",value:function(){var t,e=this.angleData,r=this.tiles.length,n=[],i=[0,0],o=new Map,a=pt(this.actions);try{for(a.s();!(t=a.n()).done;){var s=t.value;"PositionTrack"===s.eventType&&s.positionOffset&&!0!==s.editorOnly&&"Enabled"!==s.editorOnly&&o.set(s.floor,s)}}catch(t){a.e(t)}finally{a.f()}this._emitProgress("tilePosition",0,r);for(var u=new Array(r),l=0;l<r;l++)if(999===e[l]){for(var c=1;l-c>=0&&999===e[l-c];)c++;var f=l-c>=0?e[l-c]:0;u[l]=f+180*(c-1)}else u[l]=e[l];for(var h=Math.max(100,Math.floor(r/100)),p=0;p<=r;p++){var y=p===r,v=y?u[p-1]||0:u[p],d=0===p?0:u[p-1]||0,g=this.tiles[p],b=o.get(p);(null==b?void 0:b.positionOffset)&&(i[0]+=b.positionOffset[0],i[1]+=b.positionOffset[1]);var m=[i[0],i[1]];n.push(m),g&&(g.position=m,g.extraProps.angle1=v,g.extraProps.angle2=d-180,g.extraProps.cangle=y?u[p-1]+180:u[p]);var w=v*Math.PI/180;i[0]+=Math.cos(w),i[1]+=Math.sin(w),(p%h===0||y)&&this._emitProgress("tilePosition",p,r,{tileIndex:p,position:[m[0],m[1]],angle:v})}return this._emitProgress("tilePosition",r,r,{processed:n.flat()}),n}},{key:"floorOperation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{type:"append",direction:0};switch(t.type){case"append":this.appendFloor(t);break;case"insert":"number"==typeof t.id&&this.tiles.splice(t.id,0,{direction:t.direction||0,angle:0,actions:[],addDecorations:[],_lastdir:this.tiles[t.id-1].direction,twirl:this.tiles[t.id-1].twirl});break;case"delete":"number"==typeof t.id&&this.tiles.splice(t.id,1)}this._changeAngle()}},{key:"appendFloor",value:function(t){this.tiles.push({direction:t.direction,angle:0,actions:[],addDecorations:[],_lastdir:this.tiles[this.tiles.length-1].direction,twirl:this.tiles[this.tiles.length-1].twirl,extraProps:{}}),this._changeAngle()}},{key:"clearDeco",value:function(){return this.tiles=ut(this.tiles),!0}},{key:"clearEffect",value:function(t){this.clearEvent(n[t])}},{key:"clearEvent",value:function(t){t.type==rt.include?this.tiles=ct(t.events,this.tiles):t.type==rt.exclude&&(this.tiles=lt(t.events,this.tiles))}},{key:"export",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o={angleData:this._flattenAngleDatas(this.tiles),settings:this.settings,actions:this._flattenActionsWithFloor(this.tiles),decorations:this._flattenDecorationsWithFloor(this.tiles)};return"object"===t?o:et(o,e,r,n,i)}}],e&&dt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();return e})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ADOFAI=t():e.ADOFAI=t()}(globalThis,()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Events:()=>o,Level:()=>Te,Parsers:()=>r,Presets:()=>n,Structure:()=>i,Types:()=>a,pathData:()=>l});var r={};e.r(r),e.d(r,{ArrayBufferParser:()=>q,BufferParser:()=>T,LargeFileParser:()=>ie,StringParser:()=>I,default:()=>oe});var n={};e.r(n),e.d(n,{preset_inner_no_deco:()=>ve,preset_noeffect:()=>fe,preset_noeffect_completely:()=>ye,preset_noholds:()=>he,preset_nomovecamera:()=>pe});var i={};e.r(i),e.d(i,{default:()=>Te});var o={};e.r(o);var a={};e.r(a),e.d(a,{isEventEnabled:()=>De,normalizeVec2:()=>xe,resolveTileReference:()=>Ne});var s={R:0,p:15,J:30,E:45,T:60,o:75,U:90,q:105,G:120,Q:135,H:150,W:165,L:180,x:195,N:210,Z:225,F:240,V:255,D:270,Y:285,B:300,C:315,M:330,A:345,5:555,6:666,7:777,8:888,"!":999};const l={pathDataTable:s,parseToangleData:function(e){return Array.from(e).map(function(e){return s[e]})}};function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function f(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}const h=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"parseError",value:function(e){return e}},{key:"parseAsObject",value:function(t,r){return(r||JSON).parse(e.parseAsText(t))}},{key:"parseAsText",value:function(e){return this.parseError(e)}}],null&&c(t.prototype,null),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}}function v(e,t,r){return t&&y(e.prototype,t),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=function(e){if("object"!=p(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==p(t)?t:t+""}const g=v(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)});function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,k(n.key),n)}}function S(e,t,r){return t&&O(e.prototype,t),r&&O(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function k(e){var t=function(e){if("object"!=b(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==b(t)?t:t+""}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function _(e){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_(e)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}var E=function(e){function t(){return m(this,t),e=this,n=arguments,r=_(r=t),function(e,t){if(t&&("object"==b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,w()?Reflect.construct(r,n||[],_(e).constructor):r.apply(e,n));var e,r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(t,e),S(t,[{key:"parse",value:function(e){var t,r;return t="string"==typeof e?(new TextEncoder).encode(e):(r=e).length>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.subarray(3):r,new j(t).parseValue()}},{key:"stringify",value:function(e){return JSON.stringify(e)}}])}(g),j=function(){return S(function e(t){m(this,e),this.data=t,this.pos=0,this.decoder=new TextDecoder("utf-8"),this.length=t.length},[{key:"parseValue",value:function(){this.eatWhitespace();var e=this.peek();if(-1===e)return null;switch(e){case 123:return this.parseObject();case 91:return this.parseArray();case 34:return this.parseString();case 116:return this.parseKeyword(!0);case 102:return this.parseKeyword(!1);case 110:return this.parseKeyword(null);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:return this.pos++,null}}},{key:"parseObject",value:function(){var e={};for(this.pos++;;){if(this.eatWhitespace(),125===this.peek()){this.pos++;break}var t=this.parseString();if(this.eatWhitespace(),58!==this.peek())break;this.pos++,e[t]=this.parseValue(),this.eatWhitespace(),44===this.peek()&&this.pos++}return e}},{key:"parseArray",value:function(){var e=[];for(this.pos++;;){if(this.eatWhitespace(),93===this.peek()){this.pos++;break}e.push(this.parseValue()),this.eatWhitespace(),44===this.peek()&&this.pos++}return e}},{key:"parseString",value:function(){this.pos++;for(var e=this.pos,t=!1;this.pos<this.length;){var r=this.data[this.pos];if(34===r)break;92===r?(t=!0,this.pos+=2):this.pos++}var n=this.pos;this.pos++;var i=this.data.subarray(e,n);return t?this.processEscapes(i):this.decoder.decode(i)}},{key:"processEscapes",value:function(e){for(var t=this.decoder.decode(e),r="",n=0;n<t.length;n++)if("\\"===t[n]&&n+1<t.length){var i=t[++n];switch(i){case'"':case"\\":case"/":r+=i;break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":r+=String.fromCharCode(parseInt(t.substr(n+1,4),16)),n+=4}}else r+=t[n];return r}},{key:"parseNumber",value:function(){for(var e=this.pos;this.pos<this.length;){var t=this.data[this.pos];if(!(t>=48&&t<=57||46===t||101===t||69===t||43===t||45===t))break;this.pos++}var r=this.decoder.decode(this.data.subarray(e,this.pos));return parseFloat(r)}},{key:"parseKeyword",value:function(e){var t=this.data[this.pos];return 116===t?this.pos+=4:102===t?this.pos+=5:110===t&&(this.pos+=4),e}},{key:"eatWhitespace",value:function(){for(;this.pos<this.length;){var e=this.data[this.pos];if(32!==e&&10!==e&&13!==e&&9!==e)break;this.pos++}}},{key:"peek",value:function(){return this.pos<this.length?this.data[this.pos]:-1}}])}();const T=E;function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,M(n.key),n)}}function C(e,t,r){return t&&x(e.prototype,t),r&&x(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function M(e){var t=function(e){if("object"!=D(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==D(t)?t:t+""}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(R=function(){return!!e})()}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},U(e)}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}var K=function(e){function t(){return N(this,t),e=this,n=arguments,r=U(r=t),function(e,t){if(t&&("object"==D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,R()?Reflect.construct(r,n||[],U(e).constructor):r.apply(e,n));var e,r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}(t,e),C(t,[{key:"parse",value:function(e,r){if(null==e)return null;var n=new B(e).parseValue();return"function"==typeof r?t._applyReviver("",n,r):n}},{key:"stringify",value:function(e,t,r){return new F(t,r).serialize(e)}}],[{key:"_applyReviver",value:function(e,r,n){if(r&&"object"===D(r))if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]=t._applyReviver(i.toString(),r[i],n);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(r[o]=t._applyReviver(o,r[o],n));return n(e,r)}}])}(g),B=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;N(this,e),this.json=t,this.position=0,this.endSection=r,65279===this.peek()&&this.read()}return C(e,[{key:"parseValue",value:function(){return this.parseByToken(this.nextToken)}},{key:"parseObject",value:function(){var t={};for(this.read();;){var r=void 0;do{if((r=this.nextToken)===e.TOKEN.NONE)return null;if(r===e.TOKEN.CURLY_CLOSE)return t}while(r===e.TOKEN.COMMA);var n=this.parseString();if(null===n)return null;if(this.nextToken!==e.TOKEN.COLON)return null;if(null!=this.endSection&&n===this.endSection)return t;this.read(),t[n]=this.parseValue()}}},{key:"parseArray",value:function(){var t=[];this.read();for(var r=!0;r;){var n=this.nextToken;switch(n){case e.TOKEN.NONE:return null;case e.TOKEN.SQUARED_CLOSE:r=!1;break;case e.TOKEN.COMMA:break;default:var i=this.parseByToken(n);t.push(i)}}return t}},{key:"parseByToken",value:function(t){switch(t){case e.TOKEN.CURLY_OPEN:return this.parseObject();case e.TOKEN.SQUARED_OPEN:return this.parseArray();case e.TOKEN.STRING:return this.parseString();case e.TOKEN.NUMBER:return this.parseNumber();case e.TOKEN.TRUE:return!0;case e.TOKEN.FALSE:return!1;case e.TOKEN.NULL:default:return null}}},{key:"parseString",value:function(){var e="";this.read();for(var t=!0;t&&-1!==this.peek();){var r=this.nextChar;switch(r){case'"':t=!1;break;case"\\":if(-1===this.peek()){t=!1;break}var n=this.nextChar;switch(n){case'"':case"/":case"\\":e+=n;break;case"b":e+="\b";break;case"f":e+="\f";break;case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":for(var i="",o=0;o<4;o++)i+=this.nextChar;e+=String.fromCharCode(Number.parseInt(i,16))}break;default:e+=r}}return e}},{key:"parseNumber",value:function(){var e=this.nextWord;return-1===e.indexOf(".")?Number.parseInt(e,10)||0:Number.parseFloat(e)||0}},{key:"eatWhitespace",value:function(){for(;-1!==e.WHITE_SPACE.indexOf(this.peekChar)&&(this.read(),-1!==this.peek()););}},{key:"peek",value:function(){return this.position>=this.json.length?-1:this.json.charCodeAt(this.position)}},{key:"read",value:function(){return this.position>=this.json.length?-1:this.json.charCodeAt(this.position++)}},{key:"peekChar",get:function(){var e=this.peek();return-1===e?"\0":String.fromCharCode(e)}},{key:"nextChar",get:function(){var e=this.read();return-1===e?"\0":String.fromCharCode(e)}},{key:"nextWord",get:function(){for(var t="";-1===e.WORD_BREAK.indexOf(this.peekChar)&&(t+=this.nextChar,-1!==this.peek()););return t}},{key:"nextToken",get:function(){if(this.eatWhitespace(),-1===this.peek())return e.TOKEN.NONE;switch(this.peekChar){case'"':return e.TOKEN.STRING;case",":return this.read(),e.TOKEN.COMMA;case"-":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return e.TOKEN.NUMBER;case":":return e.TOKEN.COLON;case"[":return e.TOKEN.SQUARED_OPEN;case"]":return this.read(),e.TOKEN.SQUARED_CLOSE;case"{":return e.TOKEN.CURLY_OPEN;case"}":return this.read(),e.TOKEN.CURLY_CLOSE;default:switch(this.nextWord){case"false":return e.TOKEN.FALSE;case"true":return e.TOKEN.TRUE;case"null":return e.TOKEN.NULL;default:return e.TOKEN.NONE}}}}])}();B.WHITE_SPACE=" \t\n\r\ufeff",B.WORD_BREAK=' \t\n\r{}[],:"',B.TOKEN={NONE:0,CURLY_OPEN:1,CURLY_CLOSE:2,SQUARED_OPEN:3,SQUARED_CLOSE:4,COLON:5,COMMA:6,STRING:7,NUMBER:8,TRUE:9,FALSE:10,NULL:11};var F=function(){return C(function e(t,r){N(this,e),this.result="",this.indent=0,this.indentStr="",this.replacer=t||null,this.space=r||null,"number"==typeof r?this.indentStr=" ".repeat(Math.min(10,Math.max(0,r))):"string"==typeof r&&(this.indentStr=r.slice(0,10))},[{key:"serialize",value:function(e){return this.result="",this.serializeValue(e,""),this.result}},{key:"serializeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";"function"==typeof this.replacer&&(e=this.replacer(t,e)),null==e?this.result+="null":"string"==typeof e?this.serializeString(e):"boolean"==typeof e?this.result+=e.toString():Array.isArray(e)?this.serializeArray(e):"object"===D(e)?this.serializeObject(e):this.serializeOther(e)}},{key:"serializeObject",value:function(e){var t=!0;for(var r in this.result+="{",this.indentStr&&(this.result+="\n",this.indent++),e)if(Object.prototype.hasOwnProperty.call(e,r)){if(Array.isArray(this.replacer)&&!this.replacer.includes(r))continue;t||(this.result+=",",this.indentStr&&(this.result+="\n")),this.indentStr&&(this.result+=this.indentStr.repeat(this.indent)),this.serializeString(r.toString()),this.result+=":",this.indentStr&&(this.result+=" "),this.serializeValue(e[r],r),t=!1}this.indentStr&&(this.result+="\n",this.indent--,this.result+=this.indentStr.repeat(this.indent)),this.result+="}"}},{key:"serializeArray",value:function(e){this.result+="[",this.indentStr&&e.length>0&&(this.result+="\n",this.indent++);for(var t=!0,r=0;r<e.length;r++)t||(this.result+=",",this.indentStr&&(this.result+="\n")),this.indentStr&&(this.result+=this.indentStr.repeat(this.indent)),this.serializeValue(e[r],r.toString()),t=!1;this.indentStr&&e.length>0&&(this.result+="\n",this.indent--,this.result+=this.indentStr.repeat(this.indent)),this.result+="]"}},{key:"serializeString",value:function(e){this.result+='"';var t,r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;switch(n){case"\b":this.result+="\\b";break;case"\t":this.result+="\\t";break;case"\n":this.result+="\\n";break;case"\f":this.result+="\\f";break;case"\r":this.result+="\\r";break;case'"':this.result+='\\"';break;case"\\":this.result+="\\\\";break;default:var i=n.charCodeAt(0);this.result+=i>=32&&i<=126?n:"\\u"+i.toString(16).padStart(4,"0")}}}catch(e){r.e(e)}finally{r.f()}this.result+='"'}},{key:"serializeOther",value:function(e){"number"==typeof e?isFinite(e)?this.result+=e.toString():this.result+="null":this.serializeString(e.toString())}}])}();const I=K;function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function W(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,V(n.key),n)}}function V(e){var t=function(e){if("object"!=z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}function J(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(J=function(){return!!e})()}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function H(e,t){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},H(e,t)}var Q=new Uint8Array([239,187,191]),Y=new Uint8Array([44]);function $(e){var t=new Uint8Array(e);return t.length>=3&&t[0]===Q[0]&&t[1]===Q[1]&&t[2]===Q[2]?e.slice(3):e}const q=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){return t=G(t),function(e,t){if(t&&("object"==z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,J()?Reflect.construct(t,r||[],G(e).constructor):t.apply(e,r))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(t,e),r=t,(n=[{key:"parse",value:function(e){return"string"==typeof e?I.prototype.parse.call(I.prototype,e):I.prototype.parse.call(I.prototype,(t=function(e){for(var t=new Uint8Array(e),r=[],n="other",i=0,o=0;o<t.length;o++){var a=t[o];if("escape"==n)n="string";else switch(a){case 34:switch(n){case"string":n="other";break;case"comma":r.push(Y);default:n="string"}break;case 92:"string"===n&&(n="escape");break;case 44:r.push(t.subarray(i,o)),i=o+1,"other"===n&&(n="comma");break;case 93:case 125:"comma"===n&&(n="other");break;case 9:case 10:case 11:case 12:case 13:case 32:break;default:"comma"===n&&(r.push(Y),n="other")}}r.push(t.subarray(i));for(var s=0,l=0,u=r;l<u.length;l++)s+=u[l].length;for(var c=new Uint8Array(s),f=0,h=0,p=r;h<p.length;h++){var y=p[h];c.set(y,f),f+=y.length}return c.buffer}($(e)),r=$(t),new TextDecoder("utf-8").decode(r)));var t,r}},{key:"stringify",value:function(e){return JSON.stringify(e)}}])&&W(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(g);function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function X(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ee(n.key),n)}}function ee(e){var t=function(e){if("object"!=Z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Z(t)?t:t+""}var te=new Uint8Array([239,187,191]);function re(e,t){if(t>=e.length)return-1;var r=e[t];if(34===r){for(var n=t+1,i=!1;n<e.length;)if(i)i=!1,n++;else if(92!==e[n]){if(34===e[n])return n+1;n++}else i=!0,n++;return-1}if(91===r||123===r){for(var o=91===r?93:125,a=0,s=t,l=!1,u=!1;s<e.length;)if(u)u=!1,s++;else if(92!==e[s])if(34!==e[s]){if(!l)if(e[s]===r)a++;else if(e[s]===o&&0===--a)return s+1;s++}else l=!l,s++;else u=!0,s++;return-1}for(var c=t;c<e.length;){var f=e[c];if(44===f||125===f||93===f||32===f||9===f||10===f||13===f)return c;c++}return c}function ne(e,t,r){return new TextDecoder("utf-8").decode(e.slice(t,r))}const ie=function(){return e=function e(t,r){var n,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.skipLargeActions=!1,this.maxActions=0,this.onProgress=t,r&&(this.skipLargeActions=null!==(n=r.skipLargeActions)&&void 0!==n&&n,this.maxActions=null!==(i=r.maxActions)&&void 0!==i?i:0)},(t=[{key:"parse",value:function(e){var t,r,n,i,o,a,s,l,u,c,f,h=this,p=new Uint8Array(e);p.length>=3&&p[0]===te[0]&&p[1]===te[1]&&p[2]===te[2]&&(p=p.subarray(3)),null===(t=this.onProgress)||void 0===t||t.call(this,"scanning",5);var y=function(e){for(var t=new Map,r=0,n=!1,i=!1,o="",a=-1,s=0;s<e.length;s++){var l=e[s];if(i)i=!1;else if(92!==l)if(34!==l){if(!n)if(123===l)r++;else if(125===l)r--;else if(58===l&&1===r&&o){for(var u=s+1;u<e.length&&(32===e[u]||9===e[u]||10===e[u]||13===e[u]);)u++;t.set(o,u),o="",a=-1}}else n?(n=!1,1===r&&-1!==a&&(o=new TextDecoder("utf-8").decode(e.slice(a,s)))):(n=!0,a=s+1);else i=!0}return t}(p),v=null!==(r=y.get("angleData"))&&void 0!==r?r:-1,d=null!==(n=y.get("pathData"))&&void 0!==n?n:-1,g=null!==(i=y.get("settings"))&&void 0!==i?i:-1,b=null!==(o=y.get("actions"))&&void 0!==o?o:-1,m=null!==(a=y.get("decorations"))&&void 0!==a?a:-1,O={};if(-1!==g){null===(s=this.onProgress)||void 0===s||s.call(this,"parsing_settings",10);var S=re(p,g);if(-1!==S)try{O.settings=JSON.parse(ne(p,g,S))}catch(e){O.settings={}}}if(-1!==v){null===(l=this.onProgress)||void 0===l||l.call(this,"parsing_angleData",15);var k=function(e,t,r){if(t>=e.length||91!==e[t])return null;for(var n=[],i=t+1,o="",a=1,s=!1,l=!1,u=!1,c=e.length;i<e.length;){var f=e[i];if(l)l=!1,i++;else if(92!==f)if(34!==f){if(s)i++;else if(91===f)a++,i++,u=!1;else if(93===f){if(0===--a){if(o.trim()&&!u){var h=Number(o.trim());isNaN(h)||n.push(h)}return{values:n,endPos:i+1}}i++,u=!1}else if(44===f){if(o.trim()&&!u){var p=Number(o.trim());isNaN(p)||n.push(p)}o="",u=!0,i++}else f>=48&&f<=57||45===f||46===f?(o+=String.fromCharCode(f),u=!1,i++):i++;r&&i%5e6==0&&r(Math.round(i/c*100))}else s=!s,i++;else l=!0,i++}return{values:n,endPos:i}}(p,v,function(e){var t;null===(t=h.onProgress)||void 0===t||t.call(h,"parsing_angleData",15+.25*e)});k&&(O.angleData=k.values)}if(-1!==d){var w=re(p,d);if(-1!==w){var _=ne(p,d,w);O.pathData=_.slice(1,-1)}}if(-1!==b){var A=re(p,b),E=A-b;if(null===(u=this.onProgress)||void 0===u||u.call(this,"parsing_actions",50),E>104857600&&this.skipLargeActions)O.actions=[];else if(E>52428800){var j=function(e,t,r,n){if(t>=e.length||91!==e[t])return null;for(var i=[],o=t+1,a=1,s=!1,l=!1,u=-1,c=e.length,f=0;o<e.length&&(32===e[o]||9===e[o]||10===e[o]||13===e[o]);)o++;if(93===e[o])return{values:[],endPos:o+1};for(;o<e.length;){var h=e[o];if(l)l=!1,o++;else if(92!==h)if(34!==h)if(s)o++;else if(123===h)1===a&&-1===u&&(u=o),a++,o++;else if(125===h){if(1===--a&&-1!==u){try{var p=JSON.parse(ne(e,u,o+1));if(i.push(p),f++,n&&f>=n){for(var y=o+1;y<e.length&&93!==e[y];)y++;return{values:i,endPos:y+1}}}catch(e){}u=-1,r&&f%5e4==0&&r(Math.round(o/c*100))}o++}else if(91===h)a++,o++;else if(93===h){if(0===--a)return{values:i,endPos:o+1};o++}else o++;else s=!s,o++;else l=!0,o++}return{values:i,endPos:o}}(p,b,function(e){var t;return null===(t=h.onProgress)||void 0===t?void 0:t.call(h,"parsing_actions",50+.45*e)},this.maxActions||void 0);j&&(O.actions=j.values)}else try{O.actions=JSON.parse(ne(p,b,A))}catch(e){O.actions=[]}}if(-1!==m){null===(c=this.onProgress)||void 0===c||c.call(this,"parsing_decorations",95);var T=re(p,m);if(-1!==T)try{O.decorations=JSON.parse(ne(p,m,T))}catch(e){O.decorations=[]}}return null===(f=this.onProgress)||void 0===f||f.call(this,"complete",100),O}},{key:"stringify",value:function(e){return JSON.stringify(e)}}])&&X(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),oe=h;function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"\t",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if("object"!==ae(e)||null===e)return JSON.stringify(e);if(Array.isArray(e)){if(e.every(function(e){return"object"!==ae(e)||null===e}))return"["+e.map(function(e){return se(e,0,!1,n,i)}).join(",")+"]";var o=n.repeat(t),a=n.repeat(t+i);return"[\n"+e.map(function(e){return a+le(e,n)}).join(",\n")+"\n"+o+"]"}var s=n.repeat(t),l=Object.keys(e);if(r){var u=n.repeat(i);return"{\n"+l.map(function(t){return u+JSON.stringify(t)+": "+se(e[t],i,!1,n,i)}).join(",\n")+"\n}"}return"{\n"+l.map(function(r){return s+n.repeat(i)+JSON.stringify(r)+": "+se(e[r],t+i,!1,n,i)}).join(",\n")+"\n"+s+"}"}function le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"\t";return"object"!==ae(e)||null===e?se(e,0,!1,t):Array.isArray(e)?"["+e.map(function(e){return le(e,t)}).join(",")+"]":"{"+Object.keys(e).map(function(r){return JSON.stringify(r)+": "+le(e[r],t)}).join(", ")+"}"}const ue=se;var ce,fe={type:"exclude",events:["Flash","SetFilter","SetFilterAdvanced","HallOfMirrors","Bloom","ScalePlanets","ScreenTile","ScreenScroll","ShakeScreen"]},he={type:"exclude",events:["Hold"]},pe={type:"exclude",events:["MoveCamera"]},ye={type:"exclude",events:["AddDecoration","AddText","AddObject","Checkpoint","SetHitsound","PlaySound","SetPlanetRotation","ScalePlanets","ColorTrack","AnimateTrack","RecolorTrack","MoveTrack","PositionTrack","MoveDecorations","SetText","SetObject","SetDefaultText","CustomBackground","Flash","MoveCamera","SetFilter","HallOfMirrors","ShakeScreen","Bloom","ScreenTile","ScreenScroll","SetFrameRate","RepeatEvents","SetConditionalEvents","EditorComment","Bookmark","Hold","SetHoldSound","Hide","ScaleMargin","ScaleRadius"]},ve={type:"special",events:["MoveDecorations","SetText","SetObject","SetDefaultText"]};!function(e){e.include="include",e.exclude="exclude",e.special="special"}(ce||(ce={}));const de=function(e){if(!Array.isArray(e))throw new Error("Arguments are not supported.");return e.map(function(e){var t=Object.assign({},e);return t.hasOwnProperty("addDecorations")&&(t.addDecorations=[]),Array.isArray(t.actions)&&(t.actions=t.actions.filter(function(e){return!ve.events.includes(e.eventType)})),t})},ge=function(e,t){return t.map(function(t){var r=Object.assign({},t);return Array.isArray(t.actions)&&(r.actions=t.actions.filter(function(t){return!e.includes(t.eventType)})),r})},be=function(e,t){return t.map(function(t){var r=Object.assign({},t);return Array.isArray(t.actions)&&(r.actions=t.actions.filter(function(t){return e.includes(t.eventType)})),r})};function me(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var l=n&&n.prototype instanceof s?n:s,u=Object.create(l.prototype);return Oe(u,"_invoke",function(r,n,i){var o,s,l,u=0,c=i||[],f=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return o=t,s=0,l=e,h.n=r,a}};function p(r,n){for(s=r,l=n,t=0;!f&&u&&!i&&t<c.length;t++){var i,o=c[t],p=h.p,y=o[2];r>3?(i=y===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((i=r<2&&p<o[1])?(s=0,h.v=n,h.n=o[1]):p<y&&(i=r<3||o[0]>n||n>y)&&(o[4]=r,o[5]=n,h.n=y,s=0))}if(i||r>1)return a;throw f=!0,n}return function(i,c,y){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&p(c,y),s=c,l=y;(t=s<2?e:l)||!f;){o||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(u=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=h.n<0)?l:r.call(n,h))!==a)break}catch(t){o=e,s=1,l=t}finally{u=1}}return{value:t,done:f}}}(r,i,o),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(Oe(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(c);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Oe(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return l.prototype=u,Oe(f,"constructor",u),Oe(u,"constructor",l),l.displayName="GeneratorFunction",Oe(u,i,"GeneratorFunction"),Oe(f),Oe(f,i,"Generator"),Oe(f,n,function(){return this}),Oe(f,"toString",function(){return"[object Generator]"}),(me=function(){return{w:o,m:h}})()}function Oe(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}Oe=function(e,t,r,n){function o(t,r){Oe(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))},Oe(e,t,r,n)}function Se(e){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Se(e)}function ke(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=we(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function we(e,t){if(e){if("string"==typeof e)return _e(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_e(e,t):void 0}}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ae(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ee(n.key),n)}}function Ee(e){var t=function(e){if("object"!=Se(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Se(t)?t:t+""}var je=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},Te=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._precomputedEvents=null,this._precomputeMode=!1,this._lightweightData=null,this._events=new Map,this.guidCallbacks=new Map,this._options=t,this._provider=r},t=[{key:"generateGUID",value:function(){return"event_".concat(function(){var e,t=new Uint8Array(16),r=null!==(e=globalThis.crypto)&&void 0!==e?e:null===globalThis||void 0===globalThis?void 0:globalThis.msCrypto;if(null==r?void 0:r.getRandomValues)r.getRandomValues(t);else for(var n=0;n<16;n++)t[n]=Math.floor(256*Math.random());t[6]=15&t[6]|64,t[8]=63&t[8]|128;var i=function(e){return(e>>>4).toString(16)+(15&e).toString(16)};return i(t[0])+i(t[1])+i(t[2])+i(t[3])+"-"+i(t[4])+i(t[5])+"-"+i(t[6])+i(t[7])+"-"+i(t[8])+i(t[9])+"-"+i(t[10])+i(t[11])+i(t[12])+i(t[13])+i(t[14])+i(t[15])}())}},{key:"_emitProgress",value:function(e,t,r,n){var i={stage:e,current:t,total:r,percent:r>0?Math.round(t/r*100):0,data:n};this._precomputeMode&&this._precomputedEvents?this._precomputedEvents[e].push(i):(this.trigger("parse:progress",i),this.trigger("parse:".concat(e),i))}},{key:"enablePrecomputeMode",value:function(){this._precomputeMode=!0,this._precomputedEvents={start:[],pathData:[],angleData:[],relativeAngle:[],tilePosition:[],complete:[]}}},{key:"disablePrecomputeMode",value:function(){this._precomputeMode=!1}},{key:"getPrecomputedEvents",value:function(){return this._precomputedEvents}},{key:"clearPrecomputedEvents",value:function(){this._precomputedEvents=null}},{key:"getEventsAtPercent",value:function(e,t){if(!this._precomputedEvents)return[];for(var r=[],n=0,i=t?[t]:["start","pathData","angleData","relativeAngle","tilePosition","complete"];n<i.length;n++){var o,a=i[n],s=ke(this._precomputedEvents[a]);try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l.percent<=e&&(0===r.length||r[r.length-1].percent<=l.percent)){var u=r[r.length-1];u&&u.stage===l.stage&&u.current===l.current||r.push(l)}}}catch(e){s.e(e)}finally{s.f()}}return r}},{key:"getPrecomputedEventCount",value:function(e){return this._precomputedEvents?e?this._precomputedEvents[e].length:Object.values(this._precomputedEvents).reduce(function(e,t){return e+t.length},0):0}},{key:"getLightweightData",value:function(){return this._lightweightData}},{key:"precomputeLightweight",value:function(){for(var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.tiles.length,i=new Array(n),o=r?[]:new Array(n),a=new Array(n),s=0;s<n;s++){var l=this.tiles[s];i[s]=null!==(e=l.angle)&&void 0!==e?e:0,a[s]=(null!==(t=l.twirl)&&void 0!==t?t:0)%2==1}if(!r){var u,c=[0,0],f=this.angleData,h=new Map,p=ke(this.actions);try{for(p.s();!(u=p.n()).done;){var y=u.value;"PositionTrack"===y.eventType&&y.positionOffset&&!0!==y.editorOnly&&"Enabled"!==y.editorOnly&&h.set(y.floor,y)}}catch(e){p.e(e)}finally{p.f()}for(var v=0;v<n;v++){var d=h.get(v);(null==d?void 0:d.positionOffset)&&(c[0]+=d.positionOffset[0],c[1]+=d.positionOffset[1]),o[v]=[c[0],c[1]];var g=void 0;if(999===f[v]){for(var b=1;v-b>=0&&999===f[v-b];)b++;g=(v-b>=0?f[v-b]:0)+180*(b-1)}else g=f[v];var m=g*Math.PI/180;c[0]+=Math.cos(m),c[1]+=Math.sin(m)}}return this._lightweightData={totalTiles:n,angles:i,positions:o,twirlFlags:a,computed:!0},this._lightweightData}},{key:"getLightweightDataRange",value:function(e,t){if(!this._lightweightData)return null;var r=Math.min(e+t,this._lightweightData.totalTiles);return{angles:this._lightweightData.angles.slice(e,r),positions:this._lightweightData.positions.slice(e,r),twirlFlags:this._lightweightData.twirlFlags.slice(e,r)}}},{key:"clearLightweightData",value:function(){this._lightweightData=null}},{key:"getTileRenderData",value:function(e){var t,r;if(e<0||e>=this.tiles.length)return null;var n=this.tiles[e];return{angle:null!==(t=n.angle)&&void 0!==t?t:0,position:n.position?[n.position[0],n.position[1]]:null,hasTwirl:(null!==(r=n.twirl)&&void 0!==r?r:0)%2==1}}},{key:"load",value:function(){var e=this;return new Promise(function(t,r){var n,i,o=e._options;e._emitProgress("start",0,0);var a=o instanceof ArrayBuffer,s=o instanceof Uint8Array,u="undefined"!=typeof Buffer&&Buffer.isBuffer(o);if("string"==typeof o||a||s||u)try{var c=a?new Uint8Array(o):o;i=null===(n=e._provider)||void 0===n?void 0:n.parse(c)}catch(e){return void r("解析失败: "+e)}else{if("object"!==Se(o)||null===o)return void r("Options must be String, Buffer, ArrayBuffer or Object");i=Object.assign({},o)}var f=i&&"object"===Se(i)&&null!==i&&void 0!==i.pathData,h=i&&"object"===Se(i)&&null!==i&&void 0!==i.angleData;if(f){var p=i.pathData;e._emitProgress("pathData",0,p.length,{source:p}),e.angleData=l.parseToangleData(p),e._emitProgress("pathData",p.length,p.length,{source:p,processed:e.angleData})}else{if(!h)return void r("There is not any angle datas.");e.angleData=i.angleData,e._emitProgress("angleData",e.angleData.length,e.angleData.length,{processed:e.angleData})}i&&"object"===Se(i)&&null!==i&&Array.isArray(i.actions)?e.actions=i.actions:e.actions=[],i&&"object"===Se(i)&&null!==i&&void 0!==i.settings?(e.settings=i.settings,i&&"object"===Se(i)&&null!==i&&Array.isArray(i.decorations)?e.__decorations=i.decorations:e.__decorations=[],e.tiles=[],e._angleDir=-180,e._twirlCount=0,e._createArray(e.angleData.length,{angleData:e.angleData,actions:e.actions,decorations:e.__decorations}).then(function(r){e.tiles=r,e._emitProgress("complete",e.angleData.length,e.angleData.length),e.trigger("load",e),t(!0)}).catch(function(e){r(e)})):r("There is no ADOFAI settings.")})}},{key:"on",value:function(e,t){this._events.has(e)||this._events.set(e,[]);var r=this.generateGUID();return this._events.get(e).push({guid:r,callback:t}),this.guidCallbacks.set(r,{eventName:e,callback:t}),r}},{key:"trigger",value:function(e,t){this._events.has(e)&&this._events.get(e).forEach(function(e){return(0,e.callback)(t)})}},{key:"off",value:function(e){if(this.guidCallbacks.has(e)){var t=this.guidCallbacks.get(e).eventName;if(this.guidCallbacks.delete(e),this._events.has(t)){var r=this._events.get(t),n=r.findIndex(function(t){return t.guid===e});-1!==n&&r.splice(n,1)}}}},{key:"_createArray",value:function(e,t){return r=this,n=void 0,i=void 0,o=me().m(function r(){var n,i,o,a,s,l,u,c,f,h,p,y,v,d,g,b,m,O;return me().w(function(r){for(;;)switch(r.n){case 0:if(n=new Array(e),i=Math.max(100,Math.floor(e/100)),o=new Map,Array.isArray(t.actions)){a=ke(t.actions);try{for(a.s();!(s=a.n()).done;)l=s.value,o.has(l.floor)||o.set(l.floor,[]),o.get(l.floor).push(l)}catch(e){a.e(e)}finally{a.f()}}if(u=new Map,Array.isArray(t.decorations)){c=ke(t.decorations);try{for(c.s();!(f=c.n()).done;)h=f.value,u.has(h.floor)||u.set(h.floor,[]),u.get(h.floor).push(h)}catch(e){c.e(e)}finally{c.f()}}p=0;case 1:if(!(p<e)){r.n=3;break}y=o.get(p)||[],v=u.get(p)||[],d=ke(y);try{for(d.s();!(g=d.n()).done;)"Twirl"===g.value.eventType&&this._twirlCount++}catch(e){d.e(e)}finally{d.f()}if(b=this._parseAngle(t.angleData,p,this._twirlCount%2),m=y.map(function(e){return e.floor,je(e,["floor"])}),O=v.map(function(e){return e.floor,je(e,["floor"])}),n[p]={direction:t.angleData[p],_lastdir:t.angleData[p-1]||0,actions:m,angle:b,addDecorations:O,twirl:this._twirlCount,extraProps:{}},p%i!==0&&p!==e-1){r.n=2;break}if(this._emitProgress("relativeAngle",p+1,e,{tileIndex:p,angle:t.angleData[p],relativeAngle:b}),p%(10*i)!=0){r.n=2;break}return r.n=2,new Promise(function(e){return setTimeout(e,0)});case 2:p++,r.n=1;break;case 3:return r.a(2,n)}},r,this)}),new(i||(i=Promise))(function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i(function(e){e(r)})).then(a,s)}l((o=o.apply(r,n||[])).next())});var r,n,i,o}},{key:"_changeAngle",value:function(){var e=this,t=0;return this.tiles.map(function(r){return t++,r.angle=e._parsechangedAngle(r.direction,t,r.twirl,r._lastdir),r})}},{key:"_normalizeAngle",value:function(e){return(e%360+360)%360}},{key:"_parsechangedAngle",value:function(e,t,r,n){var i,o=0;if(0===t&&(this._angleDir=180),999===e){for(var a=1;t-a-1>=0&&999===(null===(i=this.tiles[t-a-1])||void 0===i?void 0:i.direction);)a++;var s=t-a-1>=0?this.tiles[t-a-1].direction:0;this._angleDir=this._normalizeAngle(s+180*(a-1)),isNaN(this._angleDir)&&(this._angleDir=0),o=0}else{var l=this._normalizeAngle(this._angleDir-e);0===(o=0===r?l:this._normalizeAngle(360-l))&&(o=360),this._angleDir=this._normalizeAngle(e+180)}return o}},{key:"_filterByFloor",value:function(e,t){if(!Array.isArray(e))return[];var r=e.filter(function(e){return e.floor===t});return this._twirlCount+=r.filter(function(e){return"Twirl"===e.eventType}).length,r.map(function(e){return e.floor,je(e,["floor"])})}},{key:"_flattenAngleDatas",value:function(e){return e.map(function(e){return e.direction})}},{key:"_flattenActionsWithFloor",value:function(e){return e.flatMap(function(e,t){return(Array.isArray(null==e?void 0:e.actions)?e.actions:[]).map(function(e){e.floor;var r=je(e,["floor"]);return Object.assign({floor:t},r)})})}},{key:"_filterByFloorwithDeco",value:function(e,t){return Array.isArray(e)?e.filter(function(e){return e.floor===t}).map(function(e){return e.floor,je(e,["floor"])}):[]}},{key:"_flattenDecorationsWithFloor",value:function(e){return e.flatMap(function(e,t){return(Array.isArray(null==e?void 0:e.addDecorations)?e.addDecorations:[]).map(function(e){e.floor;var r=je(e,["floor"]);return Object.assign({floor:t},r)})})}},{key:"_parseAngle",value:function(e,t,r){var n=0;if(0===t&&(this._angleDir=180),999===e[t]){for(var i=1;t-i>=0&&999===e[t-i];)i++;var o=t-i>=0?e[t-i]:0;this._angleDir=this._normalizeAngle(o+180*(i-1)),isNaN(this._angleDir)&&(this._angleDir=0),n=0}else{var a=this._normalizeAngle(this._angleDir-e[t]);0===(n=0===r?a:this._normalizeAngle(360-a))&&(n=360),this._angleDir=this._normalizeAngle(e[t]+180)}return n}},{key:"filterActionsByEventType",value:function(e){return Object.entries(this.tiles).flatMap(function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||we(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),r=t[0],n=t[1];return(Array.isArray(n.actions)?n.actions:[]).map(function(e){return{b:e,index:r}})}).filter(function(t){return t.b.eventType===e}).map(function(e){var t=e.b,r=e.index;return{index:Number(r),action:t}})}},{key:"getActionsByIndex",value:function(e,t){var r=this.filterActionsByEventType(e).filter(function(e){return e.index===t});return{count:r.length,actions:r.map(function(e){return e.action})}}},{key:"calculateTileCoordinates",value:function(){console.warn("calculateTileCoordinates is deprecated. Use calculateTilePosition instead.")}},{key:"calculateTilePosition",value:function(){var e,t=this.angleData,r=this.tiles.length,n=[],i=[0,0],o=new Map,a=ke(this.actions);try{for(a.s();!(e=a.n()).done;){var s=e.value;"PositionTrack"===s.eventType&&s.positionOffset&&!0!==s.editorOnly&&"Enabled"!==s.editorOnly&&o.set(s.floor,s)}}catch(e){a.e(e)}finally{a.f()}this._emitProgress("tilePosition",0,r);for(var l=new Array(r),u=0;u<r;u++)if(999===t[u]){for(var c=1;u-c>=0&&999===t[u-c];)c++;var f=u-c>=0?t[u-c]:0;l[u]=f+180*(c-1)}else l[u]=t[u];for(var h=Math.max(100,Math.floor(r/100)),p=0;p<=r;p++){var y=p===r,v=y?l[p-1]||0:l[p],d=0===p?0:l[p-1]||0,g=this.tiles[p],b=o.get(p);(null==b?void 0:b.positionOffset)&&(i[0]+=b.positionOffset[0],i[1]+=b.positionOffset[1]);var m=[i[0],i[1]];n.push(m),g&&(g.position=m,g.extraProps.angle1=v,g.extraProps.angle2=d-180,g.extraProps.cangle=y?l[p-1]+180:l[p]);var O=v*Math.PI/180;i[0]+=Math.cos(O),i[1]+=Math.sin(O),(p%h===0||y)&&this._emitProgress("tilePosition",p,r,{tileIndex:p,position:[m[0],m[1]],angle:v})}return this._emitProgress("tilePosition",r,r,{processed:n.flat()}),n}},{key:"floorOperation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{type:"append",direction:0};switch(e.type){case"append":this.appendFloor(e);break;case"insert":"number"==typeof e.id&&this.tiles.splice(e.id,0,{direction:e.direction||0,angle:0,actions:[],addDecorations:[],_lastdir:this.tiles[e.id-1].direction,twirl:this.tiles[e.id-1].twirl});break;case"delete":"number"==typeof e.id&&this.tiles.splice(e.id,1)}this._changeAngle()}},{key:"appendFloor",value:function(e){this.tiles.push({direction:e.direction,angle:0,actions:[],addDecorations:[],_lastdir:this.tiles[this.tiles.length-1].direction,twirl:this.tiles[this.tiles.length-1].twirl,extraProps:{}}),this._changeAngle()}},{key:"clearDeco",value:function(){return this.tiles=de(this.tiles),!0}},{key:"clearEffect",value:function(e){this.clearEvent(n[e])}},{key:"clearEvent",value:function(e){e.type==ce.include?this.tiles=be(e.events,this.tiles):e.type==ce.exclude&&(this.tiles=ge(e.events,this.tiles))}},{key:"export",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o={angleData:this._flattenAngleDatas(this.tiles),settings:this.settings,actions:this._flattenActionsWithFloor(this.tiles),decorations:this._flattenDecorationsWithFloor(this.tiles)};return"object"===e?o:ue(o,t,r,n,i)}}],t&&Ae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function De(e,t){return void 0===e?t:"boolean"==typeof e?e:"Enabled"===e||"true"===e}function Ne(e,t,r){if(!e)return t;var n,i,o,a=(o=2,function(e){if(Array.isArray(e))return e}(i=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(i,o)||function(e,t){if(e){if("string"==typeof e)return Pe(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pe(e,t):void 0}}(i,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=a[0];switch(a[1]){case"Start":n=s;break;case"End":n=r-1+s;break;default:n=t+s}return Math.max(0,Math.min(n,r-1))}function xe(e){var t,r,n,i;return e?Array.isArray(e)?[null!==(t=e[0])&&void 0!==t?t:0,null!==(r=e[1])&&void 0!==r?r:0]:[null!==(n=e.x)&&void 0!==n?n:0,null!==(i=e.y)&&void 0!==i?i:0]:[0,0]}return t})());
|
package/package.json
CHANGED
|
@@ -1,92 +1,97 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "adofai",
|
|
3
|
-
"version": "3.0
|
|
4
|
-
"main": "dist/src/index.js",
|
|
5
|
-
"types": "dist/src/index.d.ts",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": {
|
|
8
|
-
"types": "./dist/src/index.d.ts",
|
|
9
|
-
"import": "./dist/src/index.js",
|
|
10
|
-
"require": "./dist/umd/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./structure": {
|
|
13
|
-
"types": "./dist/src/structure.d.ts",
|
|
14
|
-
"import": "./dist/src/structure.js",
|
|
15
|
-
"default": "./dist/src/structure.js"
|
|
16
|
-
},
|
|
17
|
-
"./parser": {
|
|
18
|
-
"types": "./dist/src/parser/index.d.ts",
|
|
19
|
-
"import": "./dist/src/parser/index.js",
|
|
20
|
-
"default": "./dist/src/parser/index.js"
|
|
21
|
-
},
|
|
22
|
-
"./parser/string": {
|
|
23
|
-
"types": "./dist/src/parser/StringParser.d.ts",
|
|
24
|
-
"import": "./dist/src/parser/StringParser.js",
|
|
25
|
-
"default": "./dist/src/parser/StringParser.js"
|
|
26
|
-
},
|
|
27
|
-
"./parser/buffer": {
|
|
28
|
-
"types": "./dist/src/parser/BufferParser.d.ts",
|
|
29
|
-
"import": "./dist/src/parser/BufferParser.js",
|
|
30
|
-
"default": "./dist/src/parser/BufferParser.js"
|
|
31
|
-
},
|
|
32
|
-
"./parser/array-buffer": {
|
|
33
|
-
"types": "./dist/src/parser/ArrayBufferParser.d.ts",
|
|
34
|
-
"import": "./dist/src/parser/ArrayBufferParser.js",
|
|
35
|
-
"default": "./dist/src/parser/ArrayBufferParser.js"
|
|
36
|
-
},
|
|
37
|
-
"./pathdata": {
|
|
38
|
-
"types": "./dist/src/pathdata/index.d.ts",
|
|
39
|
-
"import": "./dist/src/pathdata/index.js",
|
|
40
|
-
"default": "./dist/src/pathdata/index.js"
|
|
41
|
-
},
|
|
42
|
-
"./filter": {
|
|
43
|
-
"types": "./dist/src/filter/presets.d.ts",
|
|
44
|
-
"import": "./dist/src/filter/presets.js",
|
|
45
|
-
"default": "./dist/src/filter/presets.js"
|
|
46
|
-
},
|
|
47
|
-
"./filter/effect-processor": {
|
|
48
|
-
"types": "./dist/src/filter/effectProcessor.d.ts",
|
|
49
|
-
"import": "./dist/src/filter/effectProcessor.js",
|
|
50
|
-
"default": "./dist/src/filter/effectProcessor.js"
|
|
51
|
-
},
|
|
52
|
-
"./event": {
|
|
53
|
-
"types": "./dist/src/events/index.d.ts",
|
|
54
|
-
"import": "./dist/src/events/index.js",
|
|
55
|
-
"default": "./dist/src/events/index.js"
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "adofai",
|
|
3
|
+
"version": "3.2.0",
|
|
4
|
+
"main": "dist/src/index.js",
|
|
5
|
+
"types": "dist/src/index.d.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/src/index.d.ts",
|
|
9
|
+
"import": "./dist/src/index.js",
|
|
10
|
+
"require": "./dist/umd/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./structure": {
|
|
13
|
+
"types": "./dist/src/structure.d.ts",
|
|
14
|
+
"import": "./dist/src/structure.js",
|
|
15
|
+
"default": "./dist/src/structure.js"
|
|
16
|
+
},
|
|
17
|
+
"./parser": {
|
|
18
|
+
"types": "./dist/src/parser/index.d.ts",
|
|
19
|
+
"import": "./dist/src/parser/index.js",
|
|
20
|
+
"default": "./dist/src/parser/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./parser/string": {
|
|
23
|
+
"types": "./dist/src/parser/StringParser.d.ts",
|
|
24
|
+
"import": "./dist/src/parser/StringParser.js",
|
|
25
|
+
"default": "./dist/src/parser/StringParser.js"
|
|
26
|
+
},
|
|
27
|
+
"./parser/buffer": {
|
|
28
|
+
"types": "./dist/src/parser/BufferParser.d.ts",
|
|
29
|
+
"import": "./dist/src/parser/BufferParser.js",
|
|
30
|
+
"default": "./dist/src/parser/BufferParser.js"
|
|
31
|
+
},
|
|
32
|
+
"./parser/array-buffer": {
|
|
33
|
+
"types": "./dist/src/parser/ArrayBufferParser.d.ts",
|
|
34
|
+
"import": "./dist/src/parser/ArrayBufferParser.js",
|
|
35
|
+
"default": "./dist/src/parser/ArrayBufferParser.js"
|
|
36
|
+
},
|
|
37
|
+
"./pathdata": {
|
|
38
|
+
"types": "./dist/src/pathdata/index.d.ts",
|
|
39
|
+
"import": "./dist/src/pathdata/index.js",
|
|
40
|
+
"default": "./dist/src/pathdata/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./filter": {
|
|
43
|
+
"types": "./dist/src/filter/presets.d.ts",
|
|
44
|
+
"import": "./dist/src/filter/presets.js",
|
|
45
|
+
"default": "./dist/src/filter/presets.js"
|
|
46
|
+
},
|
|
47
|
+
"./filter/effect-processor": {
|
|
48
|
+
"types": "./dist/src/filter/effectProcessor.d.ts",
|
|
49
|
+
"import": "./dist/src/filter/effectProcessor.js",
|
|
50
|
+
"default": "./dist/src/filter/effectProcessor.js"
|
|
51
|
+
},
|
|
52
|
+
"./event": {
|
|
53
|
+
"types": "./dist/src/events/index.d.ts",
|
|
54
|
+
"import": "./dist/src/events/index.js",
|
|
55
|
+
"default": "./dist/src/events/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./types": {
|
|
58
|
+
"types": "./dist/src/types.d.ts",
|
|
59
|
+
"import": "./dist/src/types.js",
|
|
60
|
+
"default": "./dist/src/types.js"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"webpack": "webpack",
|
|
65
|
+
"tsc": "tsc",
|
|
66
|
+
"build": "webpack && pnpm tsc"
|
|
67
|
+
},
|
|
68
|
+
"keywords": [
|
|
69
|
+
"adofai",
|
|
70
|
+
"adofai-js",
|
|
71
|
+
"adofai-ts",
|
|
72
|
+
"adofai-ts-lib"
|
|
73
|
+
],
|
|
74
|
+
"files": [
|
|
75
|
+
"dist"
|
|
76
|
+
],
|
|
77
|
+
"author": "Xbodwf",
|
|
78
|
+
"license": "BSD-3-Clause",
|
|
79
|
+
"homepage": "https://xbodwf.github.io/packages/adofai-js/",
|
|
80
|
+
"repository": {
|
|
81
|
+
"type": "git",
|
|
82
|
+
"url": "git+https://github.com/Xbodwf/ADOFAI-JS.git"
|
|
83
|
+
},
|
|
84
|
+
"bugs": "https://github.com/Xbodwf/ADOFAI-JS/issues",
|
|
85
|
+
"description": "A Javascript library for ADOFAI levels.",
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@babel/core": "^7.27.1",
|
|
88
|
+
"@babel/preset-env": "^7.27.2",
|
|
89
|
+
"@types/node": "^20.11.0",
|
|
90
|
+
"babel-loader": "^10.0.0",
|
|
91
|
+
"ts-loader": "^9.5.1",
|
|
92
|
+
"typescript": "^5.9.3",
|
|
93
|
+
"webpack": "^5.99.9",
|
|
94
|
+
"webpack-cli": "^6.0.1"
|
|
95
|
+
},
|
|
96
|
+
"dependencies": {}
|
|
97
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Parser from "./Parser";
|
|
2
|
-
export declare class ArrayBufferParser extends Parser<ArrayBuffer | string, any> {
|
|
3
|
-
parse(input: ArrayBuffer | string): any;
|
|
4
|
-
stringify(obj: any): string;
|
|
5
|
-
}
|
|
6
|
-
export declare function stripBOM(buffer: ArrayBuffer): ArrayBuffer;
|
|
7
|
-
export declare function normalizeJsonArrayBuffer(buffer: ArrayBuffer): ArrayBuffer;
|
|
8
|
-
export declare function decodeStringFromUTF8BOM(buffer: ArrayBuffer): string;
|
|
9
|
-
export default ArrayBufferParser;
|