@antv/g 5.1.4 → 5.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AbstractRenderer.d.ts.map +1 -1
- package/dist/Canvas.d.ts +0 -3
- package/dist/Canvas.d.ts.map +1 -1
- package/dist/canvas-module.d.ts.map +1 -1
- package/dist/css/CSSProperty.d.ts +4 -0
- package/dist/css/CSSProperty.d.ts.map +1 -1
- package/dist/css/StyleValueRegistry.d.ts +3 -54
- package/dist/css/StyleValueRegistry.d.ts.map +1 -1
- package/dist/css/interfaces.d.ts +6 -0
- package/dist/css/interfaces.d.ts.map +1 -1
- package/dist/css/parser/color.d.ts +1 -1
- package/dist/css/parser/color.d.ts.map +1 -1
- package/dist/css/parser/dimension.d.ts +5 -6
- package/dist/css/parser/dimension.d.ts.map +1 -1
- package/dist/css/parser/filter.d.ts +1 -1
- package/dist/css/parser/filter.d.ts.map +1 -1
- package/dist/css/parser/numeric.d.ts +1 -1
- package/dist/css/parser/numeric.d.ts.map +1 -1
- package/dist/css/parser/transform-origin.d.ts +1 -1
- package/dist/css/parser/transform-origin.d.ts.map +1 -1
- package/dist/css/parser/transform.d.ts +2 -2
- package/dist/css/parser/transform.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyAngle.d.ts +10 -0
- package/dist/css/properties/CSSPropertyAngle.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyClipPath.d.ts +4 -2
- package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyColor.d.ts +8 -2
- package/dist/css/properties/CSSPropertyColor.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyFilter.d.ts +5 -2
- package/dist/css/properties/CSSPropertyFilter.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts +15 -2
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts +6 -2
- package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts +7 -3
- package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyLocalPosition.d.ts +9 -2
- package/dist/css/properties/CSSPropertyLocalPosition.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyOffsetDistance.d.ts +8 -2
- package/dist/css/properties/CSSPropertyOffsetDistance.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyOffsetPath.d.ts +4 -2
- package/dist/css/properties/CSSPropertyOffsetPath.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyOpacity.d.ts +6 -2
- package/dist/css/properties/CSSPropertyOpacity.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyPath.d.ts +27 -3
- package/dist/css/properties/CSSPropertyPath.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyPoints.d.ts +11 -3
- package/dist/css/properties/CSSPropertyPoints.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyShadowBlur.d.ts +3 -1
- package/dist/css/properties/CSSPropertyShadowBlur.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyText.d.ts +6 -2
- package/dist/css/properties/CSSPropertyText.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyTextTransform.d.ts +9 -2
- package/dist/css/properties/CSSPropertyTextTransform.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyTransform.d.ts +8 -2
- package/dist/css/properties/CSSPropertyTransform.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +5 -2
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyZIndex.d.ts +7 -2
- package/dist/css/properties/CSSPropertyZIndex.d.ts.map +1 -1
- package/dist/css/properties/index.d.ts +10 -9
- package/dist/css/properties/index.d.ts.map +1 -1
- package/dist/display-objects/Circle.d.ts +1 -1
- package/dist/display-objects/Circle.d.ts.map +1 -1
- package/dist/display-objects/DisplayObject.d.ts.map +1 -1
- package/dist/display-objects/Ellipse.d.ts +1 -1
- package/dist/display-objects/Ellipse.d.ts.map +1 -1
- package/dist/display-objects/Image.d.ts +2 -2
- package/dist/display-objects/Image.d.ts.map +1 -1
- package/dist/display-objects/Line.d.ts +3 -3
- package/dist/display-objects/Line.d.ts.map +1 -1
- package/dist/display-objects/Path.d.ts +2 -2
- package/dist/display-objects/Path.d.ts.map +1 -1
- package/dist/display-objects/Polygon.d.ts +1 -1
- package/dist/display-objects/Polygon.d.ts.map +1 -1
- package/dist/display-objects/Polyline.d.ts +2 -2
- package/dist/display-objects/Polyline.d.ts.map +1 -1
- package/dist/display-objects/Rect.d.ts +2 -2
- package/dist/display-objects/Rect.d.ts.map +1 -1
- package/dist/display-objects/Text.d.ts +2 -2
- package/dist/display-objects/Text.d.ts.map +1 -1
- package/dist/dom/Element.d.ts.map +1 -1
- package/dist/dom/interfaces.d.ts +4 -10
- package/dist/dom/interfaces.d.ts.map +1 -1
- package/dist/global-module.d.ts.map +1 -1
- package/dist/index.esm.js +13612 -13238
- package/dist/index.js +14807 -14447
- package/dist/index.umd.js +17279 -16919
- package/dist/index.umd.min.js +3 -3
- package/dist/plugins/CullingPlugin.d.ts +1 -1
- package/dist/plugins/CullingPlugin.d.ts.map +1 -1
- package/dist/plugins/DirtyCheckPlugin.d.ts +1 -2
- package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -1
- package/dist/services/ContextService.d.ts +2 -2
- package/dist/services/ContextService.d.ts.map +1 -1
- package/dist/services/EventService.d.ts.map +1 -1
- package/dist/services/OffscreenCanvasCreator.d.ts +3 -2
- package/dist/services/OffscreenCanvasCreator.d.ts.map +1 -1
- package/dist/services/RenderingService.d.ts.map +1 -1
- package/dist/services/SceneGraphService.d.ts +3 -3
- package/dist/services/SceneGraphService.d.ts.map +1 -1
- package/dist/services/TextService.d.ts +3 -3
- package/dist/services/TextService.d.ts.map +1 -1
- package/dist/services/aabb/TextUpdater.d.ts +1 -1
- package/dist/services/aabb/TextUpdater.d.ts.map +1 -1
- package/dist/types.d.ts +23 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/dom.d.ts +5 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/interpolation.d.ts.map +1 -1
- package/package.json +4 -3
package/dist/index.umd.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";var e,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";var e,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (C) Microsoft. All rights reserved.
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
14
|
and limitations under the License.
|
|
15
|
-
***************************************************************************** */()}},n.exports),n.exports}!function(t){!function(e){var i="object"==typeof n?n:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=o(t);function o(t,e){return function(n,i){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:i}),e&&e(n,i)}}void 0===i.Reflect?i.Reflect=t:r=o(i.Reflect,r),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return it(Object.create(null))}:a?function(){return it({__proto__:null})}:function(){return it({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),l="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,f=new(l||"function"!=typeof WeakMap?nt():WeakMap);function d(t,e,n,i){if(L(n)){if(!z(t))throw new TypeError;if(!q(e))throw new TypeError;return k(t,e)}if(!z(t))throw new TypeError;if(!F(e))throw new TypeError;if(!F(i)&&!L(i)&&!D(i))throw new TypeError;return D(i)&&(i=void 0),P(t,e,n=H(n),i)}function v(t,e){function n(n,i){if(!F(n))throw new TypeError;if(!L(i)&&!Y(i))throw new TypeError;M(t,e,n,i)}return n}function y(t,e,n,i){if(!F(n))throw new TypeError;return L(i)||(i=H(i)),M(t,e,n,i)}function g(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),N(t,e,n)}function m(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),C(t,e,n)}function T(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),_(t,e,n)}function b(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),A(t,e,n)}function E(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),O(t,e)}function S(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),I(t,e)}function w(t,e,n){if(!F(e))throw new TypeError;L(n)||(n=H(n));var i=x(e,n,!1);if(L(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var r=f.get(e);return r.delete(n),r.size>0||f.delete(e),!0}function k(t,e){for(var n=t.length-1;n>=0;--n){var i=(0,t[n])(e);if(!L(i)&&!D(i)){if(!q(i))throw new TypeError;e=i}}return e}function P(t,e,n,i){for(var r=t.length-1;r>=0;--r){var o=(0,t[r])(e,n,i);if(!L(o)&&!D(o)){if(!F(o))throw new TypeError;i=o}}return i}function x(t,e,n){var i=f.get(t);if(L(i)){if(!n)return;i=new h,f.set(t,i)}var r=i.get(e);if(L(r)){if(!n)return;r=new h,i.set(e,r)}return r}function N(t,e,n){if(C(t,e,n))return!0;var i=$(e);return!D(i)&&N(t,i,n)}function C(t,e,n){var i=x(e,n,!1);return!L(i)&&G(i.has(t))}function _(t,e,n){if(C(t,e,n))return A(t,e,n);var i=$(e);return D(i)?void 0:_(t,i,n)}function A(t,e,n){var i=x(e,n,!1);if(!L(i))return i.get(t)}function M(t,e,n,i){x(n,i,!0).set(t,e)}function O(t,e){var n=I(t,e),i=$(t);if(null===i)return n;var r=O(i,e);if(0>=r.length)return n;if(0>=n.length)return r;for(var o=new p,a=[],s=0,u=n;u.length>s;s++){o.has(h=u[s])||(o.add(h),a.push(h))}for(var c=0,l=r;l.length>c;c++){var h;o.has(h=l[c])||(o.add(h),a.push(h))}return a}function I(t,e){var n=[],i=x(t,e,!1);if(L(i))return n;for(var r=K(i.keys()),o=0;;){var a=J(r);if(!a)return n.length=o,n;var s=Z(a);try{n[o]=s}catch(t){try{Q(r)}finally{throw t}}o++}}function R(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function L(t){return void 0===t}function D(t){return null===t}function U(t){return"symbol"==typeof t}function F(t){return"object"==typeof t?null!==t:"function"==typeof t}function B(t,e){switch(R(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=X(t,i);if(void 0!==r){var o=r.call(t,n);if(F(o))throw new TypeError;return o}return V(t,"default"===n?"number":n)}function V(t,e){if("string"===e){var n=t.toString;if(W(n))if(!F(r=n.call(t)))return r;if(W(i=t.valueOf))if(!F(r=i.call(t)))return r}else{var i;if(W(i=t.valueOf))if(!F(r=i.call(t)))return r;var r,o=t.toString;if(W(o))if(!F(r=o.call(t)))return r}throw new TypeError}function G(t){return!!t}function j(t){return""+t}function H(t){var e=B(t,3);return U(e)?e:j(e)}function z(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function W(t){return"function"==typeof t}function q(t){return"function"==typeof t}function Y(t){switch(R(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!W(n))throw new TypeError;return n}}function K(t){var e=X(t,r);if(!W(e))throw new TypeError;var n=e.call(t);if(!F(n))throw new TypeError;return n}function Z(t){return t.value}function J(t){var e=t.next();return!e.done&&e}function Q(t){var e=t.return;e&&e.call(t)}function $(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return e;var r=i.constructor;return"function"!=typeof r||r===t?e:r}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&this._keys.length>t){var n=this._selector(this._keys[t],this._values[t]);return this._keys.length>t+1?this._index++:(this._index=-1,this._keys=e,this._values=e),{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw 0>this._index||(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return 0>this._index||(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return 0>e?void 0:this._values[e]},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var i=this._keys.length,r=n+1;i>r;r++)this._keys[r-1]=this._keys[r],this._values[r-1]=this._values[r];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,i)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),0>this._cacheIndex&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new h}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()},t}()}function nt(){var t=16,n=u.create(),i=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var t;do{t="@@WeakMap@@"+c()}while(u.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,i)){if(!n)return;Object.defineProperty(t,i,{value:u.create()})}return t[i]}function a(t,e){for(var n=0;e>n;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function c(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",i=0;t>i;++i){var r=e[i];4!==i&&6!==i&&8!==i||(n+="-"),16>r&&(n+="0"),n+=r.toString(16).toLowerCase()}return n}}function it(t){return t.__=void 0,delete t.__,t}t("decorate",d),t("metadata",v),t("defineMetadata",y),t("hasMetadata",g),t("hasOwnMetadata",m),t("getMetadata",T),t("getOwnMetadata",b),t("getMetadataKeys",E),t("getOwnMetadataKeys",S),t("deleteMetadata",w)}(r)}()}(e||(e={}));var r,o,a=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]})),s=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0;e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}})),u=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}})),c=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var n=function(){function t(t,e){this.id=u.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=s.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===s.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=n})),l=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]};e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"})),h=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var n=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(a.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(a.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(a.TAGGED_PROP,t)||[]},t}();e.MetadataReader=n})),p=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0;e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}})),f=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0,e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===l.STACK_OVERFLOW}})),d=i((function(t,e){function n(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function i(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||i(t.parentRequest,e))}function r(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0,e.getServiceIdentifierAsString=n,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var i="",o=n(t,e);return 0!==o.length&&(i="\nRegistered bindings:",o.forEach((function(t){var e="Object";null!==t.implementationType&&(e=r(t.implementationType)),i=i+"\n "+e,t.constraint.metaData&&(i=i+" - "+t.constraint.metaData)}))),i},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(i(e,e.serviceIdentifier)){var r=function(t){return function t(e,i){void 0===i&&(i=[]);var r=n(e.serviceIdentifier);return i.push(r),null!==e.parentRequest?t(e.parentRequest,i):i}(t).reverse().join(" --\x3e ")}(e);throw new Error(l.CIRCULAR_DEPENDENCY+" "+r)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",i=e.getNamedTag(),r=e.getCustomTags();return null!==i&&(n+=i.toString()+"\n"),null!==r&&r.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=r})),v=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var n=function(){function t(t){this.id=u.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=n})),y=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var n=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===a.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=n})),g=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0,e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}})),m=i((function(t,e){function n(t,e,n,i,r){var o={},a="number"==typeof r,s=void 0!==r&&a?r.toString():n;if(a&&void 0!==n)throw new Error(l.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var u=o[s];if(Array.isArray(u))for(var c=0,h=u;h.length>c;c++){var p=h[c];if(p.key===i.key)throw new Error(l.DUPLICATED_METADATA+" "+p.key.toString())}else u=[];u.push(i),o[s]=u,Reflect.defineMetadata(t,o,e)}function i(t,e){Reflect.decorate(t,e)}function r(t,e){return function(n,i){e(n,i,t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0,e.tagParameter=function(t,e,i,r){n(a.TAGGED,t,e,r,i)},e.tagProperty=function(t,e,i){n(a.TAGGED_PROP,t.constructor,e,i)},e.decorate=function(t,e,n){"number"==typeof n?i([r(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):i([t],e)}})),T=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var n=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=n,e.inject=function(t){return function(e,n,i){if(void 0===t)throw new Error(l.UNDEFINED_INJECT_ANNOTATION(e.name));var r=new y.Metadata(a.INJECT_TAG,t);"number"==typeof i?m.tagParameter(e,n,i,r):m.tagProperty(e,n,r)}}})),b=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n})),E=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var n=function(){function t(t,e,n,i){this.id=u.id(),this.type=t,this.serviceIdentifier=n,this.name=new b.QueryableString(e||""),this.metadata=new Array;var r=null;"string"==typeof i?r=new y.Metadata(a.NAMED_TAG,i):i instanceof y.Metadata&&(r=i),null!==r&&this.metadata.push(r)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;n.length>e;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(a.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(a.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(a.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return a.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(a.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===a.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return a.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(a.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var i=0,r=e.metadata;r.length>i;i++){var o=r[i];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=n})),S=i((function(t,e){var i=n&&n.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;i>n;n++,r++)t[r]=e[n];return t};function r(t,e,n,r){var a=t.getConstructorMetadata(n),s=a.compilerGeneratedMetadata;if(void 0===s)throw new Error(l.MISSING_INJECTABLE_ANNOTATION+" "+e+".");var c=a.userGeneratedMetadata,h=Object.keys(c),p=function(t,e,n,i,r){for(var a=[],s=0;r>s;s++){var u=o(s,t,e,n,i);null!==u&&a.push(u)}return a}(r,e,s,c,0===n.length&&h.length>0||h.length>n.length?h.length:n.length),f=u(t,n);return i(i([],p),f)}function o(t,e,n,i,r){var o=r[t.toString()]||[],a=c(o),u=!0!==a.unmanaged,h=i[t],p=a.inject||a.multiInject;if((h=p||h)instanceof T.LazyServiceIdentifer&&(h=h.unwrap()),u){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(l.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".");var f=new E.Target(s.TargetTypeEnum.ConstructorArgument,a.targetName,h);return f.metadata=o,f}return null}function u(t,e){for(var n=t.getPropertiesMetadata(e),r=[],o=0,a=Object.keys(n);a.length>o;o++){var l=a[o],h=n[l],p=c(n[l]),f=new E.Target(s.TargetTypeEnum.ClassProperty,p.targetName||l,p.inject||p.multiInject);f.metadata=h,r.push(f)}var d=Object.getPrototypeOf(e.prototype).constructor;if(d!==Object){var v=u(t,d);r=i(i([],r),v)}return r}function c(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[a.INJECT_TAG],multiInject:e[a.MULTI_INJECT_TAG],targetName:e[a.NAME_TAG],unmanaged:e[a.UNMANAGED_TAG]}}Object.defineProperty(e,"__esModule",{value:!0}),e.getFunctionName=e.getBaseClassDependencyCount=e.getDependencies=void 0,Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return d.getFunctionName}}),e.getDependencies=function(t,e){return r(t,d.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var i=Object.getPrototypeOf(n.prototype).constructor;if(i!==Object){var o=r(e,d.getFunctionName(i),i,!0),s=o.map((function(t){return t.metadata.filter((function(t){return t.key===a.UNMANAGED_TAG}))})),u=[].concat.apply([],s).length,c=o.length-u;return c>0?c:t(e,i)}return 0}})),w=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var n=function(){function t(t,e,n,i,r){this.id=u.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=r,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,i){var r=new t(e,this.parentContext,this,n,i);return this.childRequests.push(r),r},t}();e.Request=n})),k=i((function(t,e){function n(t){return t._bindingDictionary}function i(t,e,n,i,r,o){var s=new y.Metadata(t?a.MULTI_INJECT_TAG:a.INJECT_TAG,n),u=new E.Target(e,i,n,s);if(void 0!==r){var c=new y.Metadata(r,o);u.metadata.push(c)}return u}function r(t,e,n,i,r){var o=u(n.container,r.serviceIdentifier),a=[];return o.length===p.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(r.serviceIdentifier).toSelf(),o=u(n.container,r.serviceIdentifier)),a=e?o:o.filter((function(t){var e=new w.Request(t.serviceIdentifier,n,i,t,r);return t.constraint(e)})),function(t,e,n,i){switch(e.length){case p.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var r=d.getServiceIdentifierAsString(t),o=l.NOT_REGISTERED;throw o+=d.listMetadataForTarget(r,n),o+=d.listRegisteredBindingsForServiceIdentifier(i,r,u),new Error(o);case p.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;default:if(n.isArray())return e;r=d.getServiceIdentifierAsString(t),o=l.AMBIGUOUS_MATCH+" "+r;throw o+=d.listRegisteredBindingsForServiceIdentifier(i,r,u),new Error(o)}}(r.serviceIdentifier,a,r,n.container),a}function o(t,e,n,i,a,u){var c,h;if(null===a){c=r(t,e,i,null,u),h=new w.Request(n,i,null,c,u);var p=new g.Plan(i,h);i.addPlan(p)}else c=r(t,e,i,a,u),h=a.addChildRequest(u.serviceIdentifier,c,u);c.forEach((function(e){var n=null;if(u.isArray())n=h.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=h}if(e.type===s.BindingTypeEnum.Instance&&null!==e.implementationType){var r=S.getDependencies(t,e.implementationType);if(!i.container.options.skipBaseClassChecks)if(S.getBaseClassDependencyCount(t,e.implementationType)>r.length){var a=l.ARGUMENTS_LENGTH_MISMATCH(S.getFunctionName(e.implementationType));throw new Error(a)}r.forEach((function(e){o(t,!1,e.serviceIdentifier,i,n,e)}))}}))}function u(t,e){var i=[],r=n(t);return r.hasKey(e)?i=r.get(e):null!==t.parent&&(i=u(t.parent,e)),i}Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0,e.getBindingDictionary=n,e.plan=function(t,e,n,r,a,s,u,c){void 0===c&&(c=!1);var l=new v.Context(e),h=i(n,r,a,"",s,u);try{return o(t,c,a,l,null,h),l}catch(t){throw f.isStackOverflowExeption(t)&&l.plan&&d.circularDependencyToException(l.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,i){var r=new E.Target(s.TargetTypeEnum.Variable,"",e,new y.Metadata(n,i)),o=new v.Context(t);return new w.Request(e,o,null,[],r)}})),P=i((function(t,e){var i=n&&n.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;i>n;n++,r++)t[r]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0,e.resolveInstance=function(t,e,n){var r,o=null;if(e.length>0){var u=e.filter((function(t){return null!==t.target&&t.target.type===s.TargetTypeEnum.ConstructorArgument})).map(n);o=function(t,e,n){var i=e.filter((function(t){return null!==t.target&&t.target.type===s.TargetTypeEnum.ClassProperty})),r=i.map(n);return i.forEach((function(e,n){var i;i=e.target.name.value(),t[i]=r[n]})),t}(o=new((r=t).bind.apply(r,i([void 0],u))),e,n)}else o=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(l.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,o),o}})),x=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var n=function(t,e,n){try{return n()}catch(n){throw f.isStackOverflowExeption(n)?new Error(l.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},i=function(t){return function(e){e.parentContext.setCurrentRequest(e);var r=e.bindings,o=e.childRequests,a=e.target&&e.target.isArray(),u=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(a&&u)return o.map((function(e){return i(t)(e)}));var c=null;if(!e.target.isOptional()||0!==r.length){var h=r[0],p=h.scope===s.BindingScopeEnum.Singleton,f=h.scope===s.BindingScopeEnum.Request;if(p&&h.activated)return h.cache;if(f&&null!==t&&t.has(h.id))return t.get(h.id);if(h.type===s.BindingTypeEnum.ConstantValue)c=h.cache,h.activated=!0;else if(h.type===s.BindingTypeEnum.Function)c=h.cache,h.activated=!0;else if(h.type===s.BindingTypeEnum.Constructor)c=h.implementationType;else if(h.type===s.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)c=n("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(e.parentContext)}));else if(h.type===s.BindingTypeEnum.Factory&&null!==h.factory)c=n("toFactory",h.serviceIdentifier,(function(){return h.factory(e.parentContext)}));else if(h.type===s.BindingTypeEnum.Provider&&null!==h.provider)c=n("toProvider",h.serviceIdentifier,(function(){return h.provider(e.parentContext)}));else{if(h.type!==s.BindingTypeEnum.Instance||null===h.implementationType){var v=d.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(l.INVALID_BINDING_TYPE+" "+v)}c=P.resolveInstance(h.implementationType,o,i(t))}return"function"==typeof h.onActivation&&(c=h.onActivation(e.parentContext,c)),p&&(h.cache=c,h.activated=!0),f&&null!==t&&!t.has(h.id)&&t.set(h.id,c),c}}};e.resolve=function(t){return i(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}})),N=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var n=function(t,e){var i=t.parentRequest;return null!==i&&(!!e(i)||n(i,e))};e.traverseAncerstors=n;var i=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new y.Metadata(t,e),n}};e.taggedConstraint=i;var r=i(a.NAMED_TAG);e.namedConstraint=r;e.typeConstraint=function(t){return function(e){return null!==e&&("string"==typeof t?e.bindings[0].serviceIdentifier===t:t===e.bindings[0].implementationType)}}})),C=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=N.namedConstraint(t),new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=N.taggedConstraint(t)(e),new _.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return N.typeConstraint(t)(e.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return N.namedConstraint(t)(e.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return N.taggedConstraint(t)(e)(n.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return N.traverseAncerstors(e,N.typeConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!N.traverseAncerstors(e,N.typeConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return N.traverseAncerstors(e,N.namedConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!N.traverseAncerstors(e,N.namedConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return N.traverseAncerstors(n,N.taggedConstraint(t)(e))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!N.traverseAncerstors(n,N.taggedConstraint(t)(e))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return N.traverseAncerstors(e,t)},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!N.traverseAncerstors(e,t)},new _.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=n})),_=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new C.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=n})),A=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new C.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=n})),M=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=s.BindingScopeEnum.Request,new A.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=s.BindingScopeEnum.Transient,new A.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=n})),O=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new C.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _.BindingOnSyntax(this._binding),this._bindingInSyntax=new M.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=n})),I=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=s.BindingTypeEnum.Instance,this._binding.implementationType=t,new O.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+l.INVALID_TO_SELF_VALUE);return this.to(this._binding.serviceIdentifier)},t.prototype.toConstantValue=function(t){return this._binding.type=s.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=s.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new O.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=s.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=s.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(l.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=s.BindingTypeEnum.Function,this._binding.scope=s.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=s.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=s.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=n})),R=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var i=new t;return i.bindings=e,i.middleware=n,i},t}();e.ContainerSnapshot=n})),L=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var n=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(l.NULL_ARGUMENT);if(null==e)throw new Error(l.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(l.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(l.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,i){var r=n.filter((function(e){return!t(e)}));r.length>0?e._map.set(i,r):e._map.delete(i)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=n})),D=i((function(t,e){var i=n&&n.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=n&&n.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&r[3]>o[1])){a.label=o[1];break}if(6===o[0]&&r[1]>a.label){a.label=r[1],r=o;break}if(r&&r[2]>a.label){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=n&&n.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;i>n;n++,r++)t[r]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var p=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+l.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=s.BindingScopeEnum.Transient;else if(e.defaultScope!==s.BindingScopeEnum.Singleton&&e.defaultScope!==s.BindingScopeEnum.Transient&&e.defaultScope!==s.BindingScopeEnum.Request)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=u.id(),this._bindingDictionary=new L.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new h.MetadataReader}return t.merge=function(e,n){for(var i=[],r=2;arguments.length>r;r++)i[r-2]=arguments[r];var a=new t,s=o([e,n],i).map((function(t){return k.getBindingDictionary(t)})),u=k.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return s.forEach((function(t){c(t,u)})),a},t.prototype.load=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),i=0,r=t;r.length>i;i++){var o=r[i],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return i(this,void 0,void 0,(function(){var e,n,i,o,a;return r(this,(function(r){switch(r.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,i=t,r.label=1;case 1:return i.length>n?(a=e((o=i[n]).id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:r.sent(),r.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var i=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=i(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=new c.Binding(t,this.options.defaultScope||s.BindingScopeEnum.Transient);return this._bindingDictionary.add(t,e),new I.BindingToSyntax(e)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(l.CANNOT_UNBIND+" "+d.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new L.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,a.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var i=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),o=k.createMockRequest(this,t,e,n);i=r.some((function(t){return t.constraint(o)}))}return!i&&this.parent&&(i=this.parent.isBoundTagged(t,e,n)),i},t.prototype.snapshot=function(){this._snapshots.push(R.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(l.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,s.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,a.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,s.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,a.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(i){var r=t.rebind.bind(t)(i);return e(r,n),r}};return function(i){return{bindFunction:(r=i,function(n){var i=t.bind.bind(t)(n);return e(i,r),i}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(i),unbindFunction:function(e){t.unbind.bind(t)(e)}};var r}},t.prototype._get=function(t,e,n,i,r,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:r,serviceIdentifier:i,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(l.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=k.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),x.resolve(n)}},t}();e.Container=p})),U=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0,e.ContainerModule=function(t){this.id=u.id(),this.registry=t},e.AsyncContainerModule=function(t){this.id=u.id(),this.registry=t}})),F=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0,e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(a.PARAM_TYPES,t))throw new Error(l.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(a.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(a.PARAM_TYPES,e,t),t}}})),B=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0,e.tagged=function(t,e){return function(n,i,r){var o=new y.Metadata(t,e);"number"==typeof r?m.tagParameter(n,i,r,o):m.tagProperty(n,i,o)}}})),V=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0,e.named=function(t){return function(e,n,i){var r=new y.Metadata(a.NAMED_TAG,t);"number"==typeof i?m.tagParameter(e,n,i,r):m.tagProperty(e,n,r)}}})),G=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0,e.optional=function(){return function(t,e,n){var i=new y.Metadata(a.OPTIONAL_TAG,!0);"number"==typeof n?m.tagParameter(t,e,n,i):m.tagProperty(t,e,i)}}})),j=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0,e.unmanaged=function(){return function(t,e,n){var i=new y.Metadata(a.UNMANAGED_TAG,!0);m.tagParameter(t,e,n,i)}}})),H=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0,e.multiInject=function(t){return function(e,n,i){var r=new y.Metadata(a.MULTI_INJECT_TAG,t);"number"==typeof i?m.tagParameter(e,n,i,r):m.tagProperty(e,n,r)}}})),z=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0,e.targetName=function(t){return function(e,n,i){var r=new y.Metadata(a.NAME_TAG,t);m.tagParameter(e,n,i,r)}}})),W=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0,e.postConstruct=function(){return function(t,e,n){var i=new y.Metadata(a.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(a.POST_CONSTRUCT,t.constructor))throw new Error(l.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(a.POST_CONSTRUCT,i,t.constructor)}}})),q=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0;e.multiBindToService=function(t){return function(e){return function(){for(var n=[],i=0;arguments.length>i;i++)n[i]=arguments[i];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}})),Y=i((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0,e.METADATA_KEY=a,Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return D.Container}}),Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return s.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return s.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return s.TargetTypeEnum}}),Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return U.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return U.ContainerModule}}),Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return F.injectable}}),Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return B.tagged}}),Object.defineProperty(e,"named",{enumerable:!0,get:function(){return V.named}}),Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return T.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return T.LazyServiceIdentifer}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return G.optional}}),Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return j.unmanaged}}),Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return H.multiInject}}),Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return z.targetName}}),Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return W.postConstruct}}),Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return h.MetadataReader}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return m.decorate}}),Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return N.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return N.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return N.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return N.typeConstraint}}),Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return d.getServiceIdentifierAsString}}),Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return q.multiBindToService}})}));function X(t){return X="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},X(t)}function K(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Z(t,e,n){return e&&K(t.prototype,e),n&&K(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function J(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t){return Q="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},Q(t)}function $(t,e){return e.lifecycle===r.Lifecycle.singleton?function(t){return t.inSingletonScope()}(t):function(t){return t.inTransientScope()}(t)}function tt(t,e){t.whenTargetNamed(it(e))}function et(t,e){return e.bind(rt(t))}function nt(t,e){if(e.isBound(rt(t)))try{return e.rebind(rt(t))}catch(n){return e.bind(rt(t))}return e.bind(rt(t))}function it(t){return o.isDefinedToken(t)?t.symbol:t}function rt(t){return o.isDefinedToken(t)?t.symbol:t}!function(t){t.defineToken=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{multiple:!0};return new t.DefinedToken(e,n)};var e,n=Z((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};J(this,t),this.prototype={},this.name=void 0,this.multiple=void 0,this.symbol=void 0;var i=n.multiple,r=void 0!==i&&i;this.name=e,this.symbol=Symbol(this.name),this.multiple=r}));t.DefinedToken=n,t.isModule=function(t){return!!t&&"object"===X(t)&&"id"in t},function(t){t.singleton="singleton",t.transient="transient"}(e=t.Lifecycle||(t.Lifecycle={})),t.ClassOptionSymbol=Symbol("SyringeClassOptionSymbol"),t.DefaultOption={lifecycle:e.transient}}(r||(r={})),function(t){t.toArray=function(t){return Array.isArray(t)?t:void 0===t?[]:[t]},t.isClass=function(t){return!(!t||"function"!=typeof t||!("prototype"in t))},t.isDefinedToken=function(t){return!!(t&&"object"===X(t)&&"symbol"in t&&"multiple"in t)},t.isInjectOption=function(t){return!(!t||"object"!==X(t)||!("token"in t))},t.isNamedToken=function(t){return!!(t&&"object"===X(t)&&"token"in t&&"named"in t)},t.isMultipleEnabled=function(e){return t.isDefinedToken(e)&&e.multiple}}(o||(o={}));var ot=new Y.Container;function at(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function st(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?at(Object(n),!0).forEach((function(e){ut(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ut(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Y.injectable();return function(n){Reflect.defineMetadata(r.ClassOptionSymbol,st(st({},t),{},{target:n}),n),e(n)}}function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ct(st(st({},t),{},{lifecycle:r.Lifecycle.singleton}))}function ht(t){return Y.inject(rt(t))}function pt(t){return Y.named(it(t))}var ft=Symbol("SyringeOptionSymbol");function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function vt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){yt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gt(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var mt=function(){function t(e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.token=void 0,this.rawToken=void 0,this.named=void 0,this.generalToken=void 0,this.option=void 0,this.register=void 0,this.mutiple=void 0,this.register=e,this.token=n,this.option=i,this.rawToken=o.isNamedToken(n)?n.token:n,this.named=o.isNamedToken(n)?n.named:void 0,this.mutiple=!!this.named||o.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}var e,n,i;return e=t,n=[{key:"resolve",value:function(){var t=this,e=this.register;(function(t){return t&&"object"===Q(t)&&"bind"in t&&"unbind"in t&&"rebind"in t&&"isBound"in t})(e)&&(this.mutiple?this.resolveMutilple(e):(this.resolveMono(e),!this.named&&this.option.contrib.length>0&&this.option.contrib.forEach((function(n){o.isMultipleEnabled(n)?et(n,e).toService(t.generalToken):nt(n,e).toService(t.generalToken)}))))}},{key:"resolveMono",value:function(t){if("useValue"in this.option)return nt(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var e=this.option.useDynamic[this.option.useDynamic.length-1];return $(nt(this.generalToken,t).toDynamicValue((function(t){var n=Dt.getContainer(t.container);return e({container:n})})),this.option)}if(this.option.useFactory.length>0){var n=this.option.useFactory[this.option.useFactory.length-1];return nt(this.generalToken,t).toFactory((function(t){var e=Dt.getContainer(t.container);return n({container:e})}))}if(this.option.useClass.length>0){var i=this.option.useClass[this.option.useClass.length-1];return $(nt(this.generalToken,t).to(i),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return $(et(e.generalToken,t).to(n),e.option)})),i=this.option.useDynamic.map((function(n){return $(et(e.generalToken,t).toDynamicValue((function(t){var e=Dt.getContainer(t.container);return n({container:e})})),e.option)})),r=this.option.useFactory.map((function(n){return et(e.generalToken,t).toFactory((function(t){var e=Dt.getContainer(t.container);return n({container:e})}))})),o="useValue"in this.option?et(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&tt(t,e.named)})),i.forEach((function(t){return e.named&&tt(t,e.named)})),r.forEach((function(t){return e.named&&tt(t,e.named)})),o&&tt(o,this.named))}}],i=[{key:"resolveTarget",value:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var a=Reflect.getMetadata(ft,n);a&&t.resolveOption(e,a)}catch(t){}if(o.isClass(n))if(i.useClass){var s=o.toArray(i.useClass);s.unshift(n),i.useClass=s}else i.useClass=[n];var u;try{u=Reflect.getMetadata(r.ClassOptionSymbol,n)}catch(t){}if((u=vt(vt({},u||{}),i)).token){var c=o.toArray(u.token);c.unshift(n),u.token=c}else u.token=[n];t.resolveOption(e,u)}catch(t){}}},{key:"resolveOption",value:function(e,n){var i=function(t){var e=o.toArray(t.token),n=o.toArray(t.useClass),i=o.toArray(t.useDynamic),a=o.toArray(t.useFactory),s=o.toArray(t.contrib),u={token:e,useClass:n,lifecycle:s.length>0?r.Lifecycle.singleton:t.lifecycle||r.Lifecycle.transient,contrib:s,useDynamic:i,useFactory:a};return"useValue"in t&&(u.useValue=t.useValue),u}(vt(vt({},t.globalConfig),n));(0!==i.useClass.length||0!==i.useDynamic.length||0!==i.useFactory.length||"useValue"in i)&&i.token.forEach((function(n){new t(e,n,vt({},i)).resolve()}))}}],n&>(e.prototype,n),i&>(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();mt.globalConfig=r.DefaultOption;var Tt=r.defineToken("ContributionProvider");function bt(t){return function(t){if(Array.isArray(t))return Et(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Et(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);e>n;n++)i[n]=t[n];return i}function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function wt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(Object(n),!0).forEach((function(e){kt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function kt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pt(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var xt=function(){function t(e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.option={recursive:!1,cache:!0},this.services=void 0,this.serviceIdentifier=void 0,this.container=void 0,this.container=n,this.serviceIdentifier=e,i&&(this.option=wt(wt({},this.option),i))}var e,n,i;return e=t,n=[{key:"setServices",value:function(t){for(var e=[],n=this.container;n;){if(n.isBound(this.serviceIdentifier)){var i=n.getAll(this.serviceIdentifier);e.push.apply(e,bt(i))}n=t?n.parent:void 0}return e}},{key:"getContributions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=wt(wt({},this.option),t),n=e.cache,i=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!i)),this.services}}],n&&Pt(e.prototype,n),i&&Pt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Nt(t,e){return{token:{token:Tt,named:t},useDynamic:function(n){return new xt(t,n.container,e)},lifecycle:r.Lifecycle.singleton}}function Ct(t,e,n){t({token:{token:Tt,named:e},useDynamic:function(t){return new xt(e,t.container,n)},lifecycle:r.Lifecycle.singleton})}function _t(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var At=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=void 0,this.inversifyModule=void 0,this.baseRegistry=void 0,this.optionCollection=void 0,this.inversifyRegister=function(t,e,i,r){var a={bind:t,unbind:e,isBound:i,rebind:r},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.isInjectOption(t)?mt.resolveOption(a,t):mt.resolveTarget(a,t,e)};n.baseRegistry&&n.baseRegistry(s),n.optionCollection&&n.optionCollection.forEach((function(t){return s(t)}))},this.baseRegistry=e,this.inversifyModule=new Y.ContainerModule(this.inversifyRegister),this.id=this.inversifyModule.id}var e,n,i;return e=t,n=[{key:"options",get:function(){return this.optionCollection||(this.optionCollection=[]),this.optionCollection}},{key:"register",value:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];return n.forEach((function(e){return t.options.push(e)})),this}},{key:"contribution",value:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];return n.forEach((function(e){return t.options.push(Nt(e))})),this}}],n&&_t(e.prototype,n),i&&_t(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mt(t){return t&&"inversifyModule"in t}function Ot(t){return new At(t)}function It(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Rt,Lt=new Map,Dt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.loadedModules=[],this.container=void 0,this.inversify=!0,this.parent=void 0,this.container=e||new Y.Container,t.setContainer(this.container,this)}var e,n,i;return e=t,n=[{key:"load",value:function(t,e){var n=this;return e||!this.loadedModules.includes(t.id)?(Mt(t)&&this.container.load(t.inversifyModule),this.loadedModules.push(t.id),{dispose:function(){n.unload(t)}}):(console.warn("Unsupported module."),{dispose:function(){}})}},{key:"unload",value:function(t){Mt(t)&&(this.container.unload(t.inversifyModule),this.loadedModules=this.loadedModules.filter((function(e){return e!==t.id})))}},{key:"remove",value:function(t){return this.container.unbind(rt(t))}},{key:"get",value:function(t){return this.container.get(rt(t))}},{key:"getNamed",value:function(t,e){return this.container.getNamed(rt(t),it(e))}},{key:"getAll",value:function(t){return this.container.getAll(rt(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(rt(t),it(e))}},{key:"isBound",value:function(t){return this.container.isBound(rt(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(rt(t),it(e))}},{key:"createChild",value:function(){var e=new t(this.container.createChild());return e.parent=this,e}},{key:"register",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.isInjectOption(t)?mt.resolveOption(this.container,t):mt.resolveTarget(this.container,t,e)}}],i=[{key:"setContainer",value:function(t,e){return Lt.set(t.id,e)}},{key:"getContainer",value:function(e){var n=Lt.get(e.id);if(!n){var i=new t(e);return t.setContainer(e,i),i}return n}},{key:"config",value:function(t){mt.globalConfig=t}}],n&&It(e.prototype,n),i&&It(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ut=new Dt(ot),Ft=Ut.register.bind(Ut),Bt=function(t){return function(e,n,i){pt(t)(e,n,i),ht(Tt)(e,n,i)}};!function(t){t.Provider=Tt,t.register=Ct}(Rt||(Rt={}));var Vt=Object.freeze({__proto__:null,postConstruct:Y.postConstruct,optional:Y.optional,unmanaged:Y.unmanaged,decorate:Y.decorate,injectable:ct,singleton:lt,transient:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ct(st(st({},t),{},{lifecycle:r.Lifecycle.transient}))},inject:ht,named:pt,Container:Dt,GlobalContainer:Ut,register:Ft,SyringeModule:At,isSyringeModule:Mt,Module:Ot,Provider:Tt,DefaultContributionProvider:xt,contrib:Bt,get Contribution(){return Rt},get Syringe(){return r},get Utils(){return o},OptionSymbol:ft,registerSideOption:function(t,e){Reflect.defineMetadata(ft,t,e)}});function Gt(){
|
|
15
|
+
***************************************************************************** */()}},n.exports),n.exports}!function(t){!function(e){var r="object"==typeof n?n:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(t);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=t:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return rt(Object.create(null))}:a?function(){return rt({__proto__:null})}:function(){return rt({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),l="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,f=new(l||"function"!=typeof WeakMap?nt():WeakMap);function d(t,e,n,r){if(L(n)){if(!z(t))throw new TypeError;if(!q(e))throw new TypeError;return P(t,e)}if(!z(t))throw new TypeError;if(!F(e))throw new TypeError;if(!F(r)&&!L(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),k(t,e,n=H(n),r)}function y(t,e){function n(n,r){if(!F(n))throw new TypeError;if(!L(r)&&!Y(r))throw new TypeError;M(t,e,n,r)}return n}function v(t,e,n,r){if(!F(n))throw new TypeError;return L(r)||(r=H(r)),M(t,e,n,r)}function g(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),C(t,e,n)}function m(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),N(t,e,n)}function T(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),_(t,e,n)}function b(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),A(t,e,n)}function E(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),O(t,e)}function S(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),I(t,e)}function w(t,e,n){if(!F(e))throw new TypeError;L(n)||(n=H(n));var r=x(e,n,!1);if(L(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=f.get(e);return i.delete(n),i.size>0||f.delete(e),!0}function P(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!L(r)&&!D(r)){if(!q(r))throw new TypeError;e=r}}return e}function k(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!L(o)&&!D(o)){if(!F(o))throw new TypeError;r=o}}return r}function x(t,e,n){var r=f.get(t);if(L(r)){if(!n)return;r=new h,f.set(t,r)}var i=r.get(e);if(L(i)){if(!n)return;i=new h,r.set(e,i)}return i}function C(t,e,n){if(N(t,e,n))return!0;var r=$(e);return!D(r)&&C(t,r,n)}function N(t,e,n){var r=x(e,n,!1);return!L(r)&&G(r.has(t))}function _(t,e,n){if(N(t,e,n))return A(t,e,n);var r=$(e);return D(r)?void 0:_(t,r,n)}function A(t,e,n){var r=x(e,n,!1);if(!L(r))return r.get(t)}function M(t,e,n,r){x(n,r,!0).set(t,e)}function O(t,e){var n=I(t,e),r=$(t);if(null===r)return n;var i=O(r,e);if(0>=i.length)return n;if(0>=n.length)return i;for(var o=new p,a=[],s=0,u=n;u.length>s;s++){o.has(h=u[s])||(o.add(h),a.push(h))}for(var c=0,l=i;l.length>c;c++){var h;o.has(h=l[c])||(o.add(h),a.push(h))}return a}function I(t,e){var n=[],r=x(t,e,!1);if(L(r))return n;for(var i=K(r.keys()),o=0;;){var a=J(i);if(!a)return n.length=o,n;var s=Z(a);try{n[o]=s}catch(t){try{Q(i)}finally{throw t}}o++}}function R(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function L(t){return void 0===t}function D(t){return null===t}function U(t){return"symbol"==typeof t}function F(t){return"object"==typeof t?null!==t:"function"==typeof t}function B(t,e){switch(R(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=X(t,r);if(void 0!==i){var o=i.call(t,n);if(F(o))throw new TypeError;return o}return V(t,"default"===n?"number":n)}function V(t,e){if("string"===e){var n=t.toString;if(W(n))if(!F(i=n.call(t)))return i;if(W(r=t.valueOf))if(!F(i=r.call(t)))return i}else{var r;if(W(r=t.valueOf))if(!F(i=r.call(t)))return i;var i,o=t.toString;if(W(o))if(!F(i=o.call(t)))return i}throw new TypeError}function G(t){return!!t}function j(t){return""+t}function H(t){var e=B(t,3);return U(e)?e:j(e)}function z(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function W(t){return"function"==typeof t}function q(t){return"function"==typeof t}function Y(t){switch(R(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!W(n))throw new TypeError;return n}}function K(t){var e=X(t,i);if(!W(e))throw new TypeError;var n=e.call(t);if(!F(n))throw new TypeError;return n}function Z(t){return t.value}function J(t){var e=t.next();return!e.done&&e}function Q(t){var e=t.return;e&&e.call(t)}function $(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&this._keys.length>t){var n=this._selector(this._keys[t],this._values[t]);return this._keys.length>t+1?this._index++:(this._index=-1,this._keys=e,this._values=e),{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw 0>this._index||(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return 0>this._index||(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return 0>e?void 0:this._values[e]},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;r>i;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),0>this._cacheIndex&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new h}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}()}function nt(){var t=16,n=u.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var t;do{t="@@WeakMap@@"+c()}while(u.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,r)){if(!n)return;Object.defineProperty(t,r,{value:u.create()})}return t[r]}function a(t,e){for(var n=0;e>n;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function c(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;t>r;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),16>i&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function rt(t){return t.__=void 0,delete t.__,t}t("decorate",d),t("metadata",y),t("defineMetadata",v),t("hasMetadata",g),t("hasOwnMetadata",m),t("getMetadata",T),t("getOwnMetadata",b),t("getMetadataKeys",E),t("getOwnMetadataKeys",S),t("deleteMetadata",w)}(i)}()}(e||(e={}));var i,o,a=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]})),s=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0;e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}})),u=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}})),c=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var n=function(){function t(t,e){this.id=u.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=s.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===s.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=n})),l=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]};e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"})),h=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var n=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(a.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(a.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(a.TAGGED_PROP,t)||[]},t}();e.MetadataReader=n})),p=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0;e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}})),f=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0,e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===l.STACK_OVERFLOW}})),d=r((function(t,e){function n(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function r(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||r(t.parentRequest,e))}function i(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0,e.getServiceIdentifierAsString=n,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",o=n(t,e);return 0!==o.length&&(r="\nRegistered bindings:",o.forEach((function(t){var e="Object";null!==t.implementationType&&(e=i(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(r(e,e.serviceIdentifier)){var i=function(t){return function t(e,r){void 0===r&&(r=[]);var i=n(e.serviceIdentifier);return r.push(i),null!==e.parentRequest?t(e.parentRequest,r):r}(t).reverse().join(" --\x3e ")}(e);throw new Error(l.CIRCULAR_DEPENDENCY+" "+i)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=i})),y=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var n=function(){function t(t){this.id=u.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=n})),v=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var n=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===a.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=n})),g=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0,e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}})),m=r((function(t,e){function n(t,e,n,r,i){var o={},a="number"==typeof i,s=void 0!==i&&a?i.toString():n;if(a&&void 0!==n)throw new Error(l.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var u=o[s];if(Array.isArray(u))for(var c=0,h=u;h.length>c;c++){var p=h[c];if(p.key===r.key)throw new Error(l.DUPLICATED_METADATA+" "+p.key.toString())}else u=[];u.push(r),o[s]=u,Reflect.defineMetadata(t,o,e)}function r(t,e){Reflect.decorate(t,e)}function i(t,e){return function(n,r){e(n,r,t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0,e.tagParameter=function(t,e,r,i){n(a.TAGGED,t,e,i,r)},e.tagProperty=function(t,e,r){n(a.TAGGED_PROP,t.constructor,e,r)},e.decorate=function(t,e,n){"number"==typeof n?r([i(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):r([t],e)}})),T=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var n=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=n,e.inject=function(t){return function(e,n,r){if(void 0===t)throw new Error(l.UNDEFINED_INJECT_ANNOTATION(e.name));var i=new v.Metadata(a.INJECT_TAG,t);"number"==typeof r?m.tagParameter(e,n,r,i):m.tagProperty(e,n,i)}}})),b=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n})),E=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var n=function(){function t(t,e,n,r){this.id=u.id(),this.type=t,this.serviceIdentifier=n,this.name=new b.QueryableString(e||""),this.metadata=new Array;var i=null;"string"==typeof r?i=new v.Metadata(a.NAMED_TAG,r):r instanceof v.Metadata&&(i=r),null!==i&&this.metadata.push(i)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;n.length>e;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(a.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(a.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(a.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return a.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(a.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===a.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return a.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(a.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;i.length>r;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=n})),S=r((function(t,e){var r=n&&n.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};function i(t,e,n,i){var a=t.getConstructorMetadata(n),s=a.compilerGeneratedMetadata;if(void 0===s)throw new Error(l.MISSING_INJECTABLE_ANNOTATION+" "+e+".");var c=a.userGeneratedMetadata,h=Object.keys(c),p=function(t,e,n,r,i){for(var a=[],s=0;i>s;s++){var u=o(s,t,e,n,r);null!==u&&a.push(u)}return a}(i,e,s,c,0===n.length&&h.length>0||h.length>n.length?h.length:n.length),f=u(t,n);return r(r([],p),f)}function o(t,e,n,r,i){var o=i[t.toString()]||[],a=c(o),u=!0!==a.unmanaged,h=r[t],p=a.inject||a.multiInject;if((h=p||h)instanceof T.LazyServiceIdentifer&&(h=h.unwrap()),u){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(l.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".");var f=new E.Target(s.TargetTypeEnum.ConstructorArgument,a.targetName,h);return f.metadata=o,f}return null}function u(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,a=Object.keys(n);a.length>o;o++){var l=a[o],h=n[l],p=c(n[l]),f=new E.Target(s.TargetTypeEnum.ClassProperty,p.targetName||l,p.inject||p.multiInject);f.metadata=h,i.push(f)}var d=Object.getPrototypeOf(e.prototype).constructor;if(d!==Object){var y=u(t,d);i=r(r([],i),y)}return i}function c(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[a.INJECT_TAG],multiInject:e[a.MULTI_INJECT_TAG],targetName:e[a.NAME_TAG],unmanaged:e[a.UNMANAGED_TAG]}}Object.defineProperty(e,"__esModule",{value:!0}),e.getFunctionName=e.getBaseClassDependencyCount=e.getDependencies=void 0,Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return d.getFunctionName}}),e.getDependencies=function(t,e){return i(t,d.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var o=i(e,d.getFunctionName(r),r,!0),s=o.map((function(t){return t.metadata.filter((function(t){return t.key===a.UNMANAGED_TAG}))})),u=[].concat.apply([],s).length,c=o.length-u;return c>0?c:t(e,r)}return 0}})),w=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var n=function(){function t(t,e,n,r,i){this.id=u.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=i,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=n})),P=r((function(t,e){function n(t){return t._bindingDictionary}function r(t,e,n,r,i,o){var s=new v.Metadata(t?a.MULTI_INJECT_TAG:a.INJECT_TAG,n),u=new E.Target(e,r,n,s);if(void 0!==i){var c=new v.Metadata(i,o);u.metadata.push(c)}return u}function i(t,e,n,r,i){var o=u(n.container,i.serviceIdentifier),a=[];return o.length===p.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof i.serviceIdentifier&&t.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(i.serviceIdentifier).toSelf(),o=u(n.container,i.serviceIdentifier)),a=e?o:o.filter((function(t){var e=new w.Request(t.serviceIdentifier,n,r,t,i);return t.constraint(e)})),function(t,e,n,r){switch(e.length){case p.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var i=d.getServiceIdentifierAsString(t),o=l.NOT_REGISTERED;throw o+=d.listMetadataForTarget(i,n),o+=d.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o);case p.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;default:if(n.isArray())return e;i=d.getServiceIdentifierAsString(t),o=l.AMBIGUOUS_MATCH+" "+i;throw o+=d.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o)}}(i.serviceIdentifier,a,i,n.container),a}function o(t,e,n,r,a,u){var c,h;if(null===a){c=i(t,e,r,null,u),h=new w.Request(n,r,null,c,u);var p=new g.Plan(r,h);r.addPlan(p)}else c=i(t,e,r,a,u),h=a.addChildRequest(u.serviceIdentifier,c,u);c.forEach((function(e){var n=null;if(u.isArray())n=h.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=h}if(e.type===s.BindingTypeEnum.Instance&&null!==e.implementationType){var i=S.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks)if(S.getBaseClassDependencyCount(t,e.implementationType)>i.length){var a=l.ARGUMENTS_LENGTH_MISMATCH(S.getFunctionName(e.implementationType));throw new Error(a)}i.forEach((function(e){o(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function u(t,e){var r=[],i=n(t);return i.hasKey(e)?r=i.get(e):null!==t.parent&&(r=u(t.parent,e)),r}Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0,e.getBindingDictionary=n,e.plan=function(t,e,n,i,a,s,u,c){void 0===c&&(c=!1);var l=new y.Context(e),h=r(n,i,a,"",s,u);try{return o(t,c,a,l,null,h),l}catch(t){throw f.isStackOverflowExeption(t)&&l.plan&&d.circularDependencyToException(l.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new E.Target(s.TargetTypeEnum.Variable,"",e,new v.Metadata(n,r)),o=new y.Context(t);return new w.Request(e,o,null,[],i)}})),k=r((function(t,e){var r=n&&n.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0,e.resolveInstance=function(t,e,n){var i,o=null;if(e.length>0){var u=e.filter((function(t){return null!==t.target&&t.target.type===s.TargetTypeEnum.ConstructorArgument})).map(n);o=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===s.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value(),t[r]=i[n]})),t}(o=new((i=t).bind.apply(i,r([void 0],u))),e,n)}else o=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(l.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,o),o}})),x=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var n=function(t,e,n){try{return n()}catch(n){throw f.isStackOverflowExeption(n)?new Error(l.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},r=function(t){return function(e){e.parentContext.setCurrentRequest(e);var i=e.bindings,o=e.childRequests,a=e.target&&e.target.isArray(),u=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(a&&u)return o.map((function(e){return r(t)(e)}));var c=null;if(!e.target.isOptional()||0!==i.length){var h=i[0],p=h.scope===s.BindingScopeEnum.Singleton,f=h.scope===s.BindingScopeEnum.Request;if(p&&h.activated)return h.cache;if(f&&null!==t&&t.has(h.id))return t.get(h.id);if(h.type===s.BindingTypeEnum.ConstantValue)c=h.cache,h.activated=!0;else if(h.type===s.BindingTypeEnum.Function)c=h.cache,h.activated=!0;else if(h.type===s.BindingTypeEnum.Constructor)c=h.implementationType;else if(h.type===s.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)c=n("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(e.parentContext)}));else if(h.type===s.BindingTypeEnum.Factory&&null!==h.factory)c=n("toFactory",h.serviceIdentifier,(function(){return h.factory(e.parentContext)}));else if(h.type===s.BindingTypeEnum.Provider&&null!==h.provider)c=n("toProvider",h.serviceIdentifier,(function(){return h.provider(e.parentContext)}));else{if(h.type!==s.BindingTypeEnum.Instance||null===h.implementationType){var y=d.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(l.INVALID_BINDING_TYPE+" "+y)}c=k.resolveInstance(h.implementationType,o,r(t))}return"function"==typeof h.onActivation&&(c=h.onActivation(e.parentContext,c)),p&&(h.cache=c,h.activated=!0),f&&null!==t&&!t.has(h.id)&&t.set(h.id,c),c}}};e.resolve=function(t){return r(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}})),C=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var n=function(t,e){var r=t.parentRequest;return null!==r&&(!!e(r)||n(r,e))};e.traverseAncerstors=n;var r=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new v.Metadata(t,e),n}};e.taggedConstraint=r;var i=r(a.NAMED_TAG);e.namedConstraint=i;e.typeConstraint=function(t){return function(e){return null!==e&&("string"==typeof t?e.bindings[0].serviceIdentifier===t:t===e.bindings[0].implementationType)}}})),N=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=C.namedConstraint(t),new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=C.taggedConstraint(t)(e),new _.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return C.typeConstraint(t)(e.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return C.namedConstraint(t)(e.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return C.taggedConstraint(t)(e)(n.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return C.traverseAncerstors(e,C.typeConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!C.traverseAncerstors(e,C.typeConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return C.traverseAncerstors(e,C.namedConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!C.traverseAncerstors(e,C.namedConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return C.traverseAncerstors(n,C.taggedConstraint(t)(e))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!C.traverseAncerstors(n,C.taggedConstraint(t)(e))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return C.traverseAncerstors(e,t)},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!C.traverseAncerstors(e,t)},new _.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=n})),_=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new N.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=n})),A=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new N.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=n})),M=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=s.BindingScopeEnum.Request,new A.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=s.BindingScopeEnum.Transient,new A.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=n})),O=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new N.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _.BindingOnSyntax(this._binding),this._bindingInSyntax=new M.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=n})),I=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=s.BindingTypeEnum.Instance,this._binding.implementationType=t,new O.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+l.INVALID_TO_SELF_VALUE);return this.to(this._binding.serviceIdentifier)},t.prototype.toConstantValue=function(t){return this._binding.type=s.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=s.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new O.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=s.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=s.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(l.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=s.BindingTypeEnum.Function,this._binding.scope=s.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=s.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=s.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=s.BindingScopeEnum.Singleton,new A.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=n})),R=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=n})),L=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var n=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(l.NULL_ARGUMENT);if(null==e)throw new Error(l.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(l.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(l.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=n})),D=r((function(t,e){var r=n&&n.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=n&&n.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){a.label=o[1];break}if(6===o[0]&&i[1]>a.label){a.label=i[1],i=o;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=n&&n.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var p=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+l.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=s.BindingScopeEnum.Transient;else if(e.defaultScope!==s.BindingScopeEnum.Singleton&&e.defaultScope!==s.BindingScopeEnum.Transient&&e.defaultScope!==s.BindingScopeEnum.Request)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=u.id(),this._bindingDictionary=new L.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new h.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;arguments.length>i;i++)r[i-2]=arguments[i];var a=new t,s=o([e,n],r).map((function(t){return P.getBindingDictionary(t)})),u=P.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return s.forEach((function(t){c(t,u)})),a},t.prototype.load=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;i.length>r;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return r.length>n?(a=e((o=r[n]).id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=new c.Binding(t,this.options.defaultScope||s.BindingScopeEnum.Transient);return this._bindingDictionary.add(t,e),new I.BindingToSyntax(e)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(l.CANNOT_UNBIND+" "+d.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new L.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,a.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=P.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(R.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(l.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,s.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,a.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,s.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,a.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(l.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=P.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),x.resolve(n)}},t}();e.Container=p})),U=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0,e.ContainerModule=function(t){this.id=u.id(),this.registry=t},e.AsyncContainerModule=function(t){this.id=u.id(),this.registry=t}})),F=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0,e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(a.PARAM_TYPES,t))throw new Error(l.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(a.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(a.PARAM_TYPES,e,t),t}}})),B=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0,e.tagged=function(t,e){return function(n,r,i){var o=new v.Metadata(t,e);"number"==typeof i?m.tagParameter(n,r,i,o):m.tagProperty(n,r,o)}}})),V=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0,e.named=function(t){return function(e,n,r){var i=new v.Metadata(a.NAMED_TAG,t);"number"==typeof r?m.tagParameter(e,n,r,i):m.tagProperty(e,n,i)}}})),G=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0,e.optional=function(){return function(t,e,n){var r=new v.Metadata(a.OPTIONAL_TAG,!0);"number"==typeof n?m.tagParameter(t,e,n,r):m.tagProperty(t,e,r)}}})),j=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0,e.unmanaged=function(){return function(t,e,n){var r=new v.Metadata(a.UNMANAGED_TAG,!0);m.tagParameter(t,e,n,r)}}})),H=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0,e.multiInject=function(t){return function(e,n,r){var i=new v.Metadata(a.MULTI_INJECT_TAG,t);"number"==typeof r?m.tagParameter(e,n,r,i):m.tagProperty(e,n,i)}}})),z=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0,e.targetName=function(t){return function(e,n,r){var i=new v.Metadata(a.NAME_TAG,t);m.tagParameter(e,n,r,i)}}})),W=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0,e.postConstruct=function(){return function(t,e,n){var r=new v.Metadata(a.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(a.POST_CONSTRUCT,t.constructor))throw new Error(l.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(a.POST_CONSTRUCT,r,t.constructor)}}})),q=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0;e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}})),Y=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0,e.METADATA_KEY=a,Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return D.Container}}),Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return s.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return s.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return s.TargetTypeEnum}}),Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return U.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return U.ContainerModule}}),Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return F.injectable}}),Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return B.tagged}}),Object.defineProperty(e,"named",{enumerable:!0,get:function(){return V.named}}),Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return T.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return T.LazyServiceIdentifer}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return G.optional}}),Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return j.unmanaged}}),Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return H.multiInject}}),Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return z.targetName}}),Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return W.postConstruct}}),Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return h.MetadataReader}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return m.decorate}}),Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return C.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return C.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return C.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return C.typeConstraint}}),Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return d.getServiceIdentifierAsString}}),Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return q.multiBindToService}})}));function X(t){return X="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},X(t)}function K(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Z(t,e,n){return e&&K(t.prototype,e),n&&K(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function J(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t){return Q="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},Q(t)}function $(t,e){return e.lifecycle===i.Lifecycle.singleton?function(t){return t.inSingletonScope()}(t):function(t){return t.inTransientScope()}(t)}function tt(t,e){t.whenTargetNamed(rt(e))}function et(t,e){return e.bind(it(t))}function nt(t,e){if(e.isBound(it(t)))try{return e.rebind(it(t))}catch(n){return e.bind(it(t))}return e.bind(it(t))}function rt(t){return o.isDefinedToken(t)?t.symbol:t}function it(t){return o.isDefinedToken(t)?t.symbol:t}!function(t){t.defineToken=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{multiple:!0};return new t.DefinedToken(e,n)};var e,n=Z((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};J(this,t),this.prototype={},this.name=void 0,this.multiple=void 0,this.symbol=void 0;var r=n.multiple,i=void 0!==r&&r;this.name=e,this.symbol=Symbol(this.name),this.multiple=i}));t.DefinedToken=n,t.isModule=function(t){return!!t&&"object"===X(t)&&"id"in t},function(t){t.singleton="singleton",t.transient="transient"}(e=t.Lifecycle||(t.Lifecycle={})),t.ClassOptionSymbol=Symbol("SyringeClassOptionSymbol"),t.DefaultOption={lifecycle:e.transient}}(i||(i={})),function(t){t.toArray=function(t){return Array.isArray(t)?t:void 0===t?[]:[t]},t.isClass=function(t){return!(!t||"function"!=typeof t||!("prototype"in t))},t.isDefinedToken=function(t){return!!(t&&"object"===X(t)&&"symbol"in t&&"multiple"in t)},t.isInjectOption=function(t){return!(!t||"object"!==X(t)||!("token"in t))},t.isNamedToken=function(t){return!!(t&&"object"===X(t)&&"token"in t&&"named"in t)},t.isMultipleEnabled=function(e){return t.isDefinedToken(e)&&e.multiple}}(o||(o={}));var ot=new Y.Container;function at(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function st(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?at(Object(n),!0).forEach((function(e){ut(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ut(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Y.injectable();return function(n){Reflect.defineMetadata(i.ClassOptionSymbol,st(st({},t),{},{target:n}),n),e(n)}}function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ct(st(st({},t),{},{lifecycle:i.Lifecycle.singleton}))}function ht(t){return Y.inject(it(t))}function pt(t){return Y.named(rt(t))}var ft=Symbol("SyringeOptionSymbol");function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){vt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function vt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gt(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var mt=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.token=void 0,this.rawToken=void 0,this.named=void 0,this.generalToken=void 0,this.option=void 0,this.register=void 0,this.mutiple=void 0,this.register=e,this.token=n,this.option=r,this.rawToken=o.isNamedToken(n)?n.token:n,this.named=o.isNamedToken(n)?n.named:void 0,this.mutiple=!!this.named||o.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}var e,n,r;return e=t,n=[{key:"resolve",value:function(){var t=this,e=this.register;(function(t){return t&&"object"===Q(t)&&"bind"in t&&"unbind"in t&&"rebind"in t&&"isBound"in t})(e)&&(this.mutiple?this.resolveMutilple(e):(this.resolveMono(e),!this.named&&this.option.contrib.length>0&&this.option.contrib.forEach((function(n){o.isMultipleEnabled(n)?et(n,e).toService(t.generalToken):nt(n,e).toService(t.generalToken)}))))}},{key:"resolveMono",value:function(t){if("useValue"in this.option)return nt(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var e=this.option.useDynamic[this.option.useDynamic.length-1];return $(nt(this.generalToken,t).toDynamicValue((function(t){var n=Dt.getContainer(t.container);return e({container:n})})),this.option)}if(this.option.useFactory.length>0){var n=this.option.useFactory[this.option.useFactory.length-1];return nt(this.generalToken,t).toFactory((function(t){var e=Dt.getContainer(t.container);return n({container:e})}))}if(this.option.useClass.length>0){var r=this.option.useClass[this.option.useClass.length-1];return $(nt(this.generalToken,t).to(r),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return $(et(e.generalToken,t).to(n),e.option)})),r=this.option.useDynamic.map((function(n){return $(et(e.generalToken,t).toDynamicValue((function(t){var e=Dt.getContainer(t.container);return n({container:e})})),e.option)})),i=this.option.useFactory.map((function(n){return et(e.generalToken,t).toFactory((function(t){var e=Dt.getContainer(t.container);return n({container:e})}))})),o="useValue"in this.option?et(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&tt(t,e.named)})),r.forEach((function(t){return e.named&&tt(t,e.named)})),i.forEach((function(t){return e.named&&tt(t,e.named)})),o&&tt(o,this.named))}}],r=[{key:"resolveTarget",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var a=Reflect.getMetadata(ft,n);a&&t.resolveOption(e,a)}catch(t){}if(o.isClass(n))if(r.useClass){var s=o.toArray(r.useClass);s.unshift(n),r.useClass=s}else r.useClass=[n];var u;try{u=Reflect.getMetadata(i.ClassOptionSymbol,n)}catch(t){}if((u=yt(yt({},u||{}),r)).token){var c=o.toArray(u.token);c.unshift(n),u.token=c}else u.token=[n];t.resolveOption(e,u)}catch(t){}}},{key:"resolveOption",value:function(e,n){var r=function(t){var e=o.toArray(t.token),n=o.toArray(t.useClass),r=o.toArray(t.useDynamic),a=o.toArray(t.useFactory),s=o.toArray(t.contrib),u={token:e,useClass:n,lifecycle:s.length>0?i.Lifecycle.singleton:t.lifecycle||i.Lifecycle.transient,contrib:s,useDynamic:r,useFactory:a};return"useValue"in t&&(u.useValue=t.useValue),u}(yt(yt({},t.globalConfig),n));(0!==r.useClass.length||0!==r.useDynamic.length||0!==r.useFactory.length||"useValue"in r)&&r.token.forEach((function(n){new t(e,n,yt({},r)).resolve()}))}}],n&>(e.prototype,n),r&>(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();mt.globalConfig=i.DefaultOption;var Tt=i.defineToken("ContributionProvider");function bt(t){return function(t){if(Array.isArray(t))return Et(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Et(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);e>n;n++)r[n]=t[n];return r}function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(Object(n),!0).forEach((function(e){Pt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Pt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kt(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var xt=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.option={recursive:!1,cache:!0},this.services=void 0,this.serviceIdentifier=void 0,this.container=void 0,this.container=n,this.serviceIdentifier=e,r&&(this.option=wt(wt({},this.option),r))}var e,n,r;return e=t,n=[{key:"setServices",value:function(t){for(var e=[],n=this.container;n;){if(n.isBound(this.serviceIdentifier)){var r=n.getAll(this.serviceIdentifier);e.push.apply(e,bt(r))}n=t?n.parent:void 0}return e}},{key:"getContributions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=wt(wt({},this.option),t),n=e.cache,r=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!r)),this.services}}],n&&kt(e.prototype,n),r&&kt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ct(t,e){return{token:{token:Tt,named:t},useDynamic:function(n){return new xt(t,n.container,e)},lifecycle:i.Lifecycle.singleton}}function Nt(t,e,n){t({token:{token:Tt,named:e},useDynamic:function(t){return new xt(e,t.container,n)},lifecycle:i.Lifecycle.singleton})}function _t(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var At=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=void 0,this.inversifyModule=void 0,this.baseRegistry=void 0,this.optionCollection=void 0,this.inversifyRegister=function(t,e,r,i){var a={bind:t,unbind:e,isBound:r,rebind:i},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.isInjectOption(t)?mt.resolveOption(a,t):mt.resolveTarget(a,t,e)};n.baseRegistry&&n.baseRegistry(s),n.optionCollection&&n.optionCollection.forEach((function(t){return s(t)}))},this.baseRegistry=e,this.inversifyModule=new Y.ContainerModule(this.inversifyRegister),this.id=this.inversifyModule.id}var e,n,r;return e=t,n=[{key:"options",get:function(){return this.optionCollection||(this.optionCollection=[]),this.optionCollection}},{key:"register",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(e)})),this}},{key:"contribution",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(Ct(e))})),this}}],n&&_t(e.prototype,n),r&&_t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mt(t){return t&&"inversifyModule"in t}function Ot(t){return new At(t)}function It(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Rt,Lt=new Map,Dt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.loadedModules=[],this.container=void 0,this.inversify=!0,this.parent=void 0,this.container=e||new Y.Container,t.setContainer(this.container,this)}var e,n,r;return e=t,n=[{key:"load",value:function(t,e){var n=this;return e||!this.loadedModules.includes(t.id)?(Mt(t)&&this.container.load(t.inversifyModule),this.loadedModules.push(t.id),{dispose:function(){n.unload(t)}}):(console.warn("Unsupported module."),{dispose:function(){}})}},{key:"unload",value:function(t){Mt(t)&&(this.container.unload(t.inversifyModule),this.loadedModules=this.loadedModules.filter((function(e){return e!==t.id})))}},{key:"remove",value:function(t){return this.container.unbind(it(t))}},{key:"get",value:function(t){return this.container.get(it(t))}},{key:"getNamed",value:function(t,e){return this.container.getNamed(it(t),rt(e))}},{key:"getAll",value:function(t){return this.container.getAll(it(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(it(t),rt(e))}},{key:"isBound",value:function(t){return this.container.isBound(it(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(it(t),rt(e))}},{key:"createChild",value:function(){var e=new t(this.container.createChild());return e.parent=this,e}},{key:"register",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.isInjectOption(t)?mt.resolveOption(this.container,t):mt.resolveTarget(this.container,t,e)}}],r=[{key:"setContainer",value:function(t,e){return Lt.set(t.id,e)}},{key:"getContainer",value:function(e){var n=Lt.get(e.id);if(!n){var r=new t(e);return t.setContainer(e,r),r}return n}},{key:"config",value:function(t){mt.globalConfig=t}}],n&&It(e.prototype,n),r&&It(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ut=new Dt(ot),Ft=Ut.register.bind(Ut),Bt=function(t){return function(e,n,r){pt(t)(e,n,r),ht(Tt)(e,n,r)}};!function(t){t.Provider=Tt,t.register=Nt}(Rt||(Rt={}));var Vt=Object.freeze({__proto__:null,postConstruct:Y.postConstruct,optional:Y.optional,unmanaged:Y.unmanaged,decorate:Y.decorate,injectable:ct,singleton:lt,transient:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ct(st(st({},t),{},{lifecycle:i.Lifecycle.transient}))},inject:ht,named:pt,Container:Dt,GlobalContainer:Ut,register:Ft,SyringeModule:At,isSyringeModule:Mt,Module:Ot,Provider:Tt,DefaultContributionProvider:xt,contrib:Bt,get Contribution(){return Rt},get Syringe(){return i},get Utils(){return o},OptionSymbol:ft,registerSideOption:function(t,e){Reflect.defineMetadata(ft,t,e)}});function Gt(){
|
|
16
16
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
17
|
-
Gt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var r=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(i||[]);return r._invoke=function(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return P()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=c(t,e,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),r}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function p(){}function f(){}var d={};s(d,r,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(k([])));y&&y!==e&&n.call(y,r)&&(d=y);var g=f.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function i(r,o,a,s){var u=c(t[r],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var r;this._invoke=function(t,n){function o(){return new e((function(e,r){i(t,n,e,r)}))}return r=r?r.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var r=i.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function k(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=f,s(g,"constructor",f),s(f,"constructor",p),p.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(T.prototype),s(T.prototype,o,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new T(u(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),s(g,a,"Generator"),s(g,r,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return i(o.catchLoc,!0);if(o.finallyLoc>this.prev)return i(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(this.prev>=r.tryLoc&&n.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var o=r;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},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),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function jt(t,e,n,i,r,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(i,r)}function Ht(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){jt(o,i,r,a,s,"next",t)}function s(t){jt(o,i,r,a,s,"throw",t)}a(void 0)}))}}function zt(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Wt(t,e,n){return e&&zt(t.prototype,e),n&&zt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function qt(){return qt=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},qt.apply(this,arguments)}function Yt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Xt(t,e)}function Xt(t,e){return Xt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Xt(t,e)}function Kt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Zt(t,e,n){return Zt=Kt()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&Xt(r,n.prototype),r},Zt.apply(null,arguments)}function Jt(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;o.length>i;i++)0>e.indexOf(n=o[i])&&(r[n]=t[n]);return r}function Qt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);e>n;n++)i[n]=t[n];return i}function te(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $t(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$t(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return t.length>i?{done:!1,value:t[i++]}:{done:!0}}}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 ee,ne=i((function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var i=0,r=e.length,o=new Array(r);r>i;i++)o[i]=e[i].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,i,r,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,r),!0;case 5:return l.fn.call(l.context,e,i,r,o),!0;case 6:return l.fn.call(l.context,e,i,r,o,a),!0}for(c=1,u=new Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,i);break;case 4:l[c].fn.call(l[c].context,e,i,r);break;default:if(!u)for(p=1,u=new Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,i,r){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||r&&!s[u].once||i&&s[u].context!==i)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));function ie(t,e,n,i){var r,o=arguments.length,a=3>o?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(3>o?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function re(t,e){return function(n,i){e(n,i,t)}}function oe(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}(ee=t.Shape||(t.Shape={})).GROUP="g",ee.CIRCLE="circle",ee.ELLIPSE="ellipse",ee.IMAGE="image",ee.RECT="rect",ee.LINE="line",ee.POLYLINE="polyline",ee.POLYGON="polygon",ee.TEXT="text",ee.PATH="path",ee.HTML="html",ee.MESH="mesh";var ae=r.defineToken("CanvasConfig");t.DisplayObjectPool=function(){function e(){this.pool={},this.htmlPool=[]}var n=e.prototype;return n.getByEntity=function(t){return this.pool[t]},n.add=function(e,n){this.pool[e]=n,n.nodeName===t.Shape.HTML&&this.htmlPool.push(n)},n.remove=function(e){var n=this.pool[e];if(delete this.pool[e],n.nodeName===t.Shape.HTML){var i=this.htmlPool.indexOf(n);this.htmlPool.splice(i,1)}},n.getHTMLs=function(){return this.htmlPool},e}(),t.DisplayObjectPool=ie([lt()],t.DisplayObjectPool);var se=1e-6,ue="undefined"!=typeof Float32Array?Float32Array:Array;function ce(){var t=new ue(9);return ue!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function le(){var t=new ue(16);return ue!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function he(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function pe(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function fe(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],v=e[13],y=e[14],g=e[15],m=n*s-i*a,T=n*u-r*a,b=n*c-o*a,E=i*u-r*s,S=i*c-o*s,w=r*c-o*u,k=l*v-h*d,P=l*y-p*d,x=l*g-f*d,N=h*y-p*v,C=h*g-f*v,_=p*g-f*y,A=m*_-T*C+b*N+E*x-S*P+w*k;return A?(t[0]=(s*_-u*C+c*N)*(A=1/A),t[1]=(r*C-i*_-o*N)*A,t[2]=(v*w-y*S+g*E)*A,t[3]=(p*S-h*w-f*E)*A,t[4]=(u*x-a*_-c*P)*A,t[5]=(n*_-r*x+o*P)*A,t[6]=(y*b-d*w-g*T)*A,t[7]=(l*w-p*b+f*T)*A,t[8]=(a*C-s*x+c*k)*A,t[9]=(i*x-n*C-o*k)*A,t[10]=(d*S-v*b+g*m)*A,t[11]=(h*b-l*S-f*m)*A,t[12]=(s*P-a*N-u*k)*A,t[13]=(n*N-i*P+r*k)*A,t[14]=(v*T-d*E-y*m)*A,t[15]=(l*E-h*T+p*m)*A,t):null}function de(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],v=e[12],y=e[13],g=e[14],m=e[15],T=n[0],b=n[1],E=n[2],S=n[3];return t[0]=T*i+b*s+E*h+S*v,t[1]=T*r+b*u+E*p+S*y,t[2]=T*o+b*c+E*f+S*g,t[3]=T*a+b*l+E*d+S*m,t[4]=(T=n[4])*i+(b=n[5])*s+(E=n[6])*h+(S=n[7])*v,t[5]=T*r+b*u+E*p+S*y,t[6]=T*o+b*c+E*f+S*g,t[7]=T*a+b*l+E*d+S*m,t[8]=(T=n[8])*i+(b=n[9])*s+(E=n[10])*h+(S=n[11])*v,t[9]=T*r+b*u+E*p+S*y,t[10]=T*o+b*c+E*f+S*g,t[11]=T*a+b*l+E*d+S*m,t[12]=(T=n[12])*i+(b=n[13])*s+(E=n[14])*h+(S=n[15])*v,t[13]=T*r+b*u+E*p+S*y,t[14]=T*o+b*c+E*f+S*g,t[15]=T*a+b*l+E*d+S*m,t}function ve(t,e,n){var i,r,o,a,s,u,c,l,h,p,f,d,v=n[0],y=n[1],g=n[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(r=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=i=e[0],t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=i*v+s*y+h*g+e[12],t[13]=r*v+u*y+p*g+e[13],t[14]=o*v+c*y+f*g+e[14],t[15]=a*v+l*y+d*g+e[15]),t}function ye(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ge(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function me(t,e){var n=e[4],i=e[5],r=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,i,r),t[2]=Math.hypot(o,a,s),t}function Te(t,e){var n=new ue(3);me(n,e);var i=1/n[0],r=1/n[1],o=1/n[2],a=e[0]*i,s=e[1]*r,u=e[2]*o,c=e[4]*i,l=e[5]*r,h=e[6]*o,p=e[8]*i,f=e[9]*r,d=e[10]*o,v=a+l+d,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(h-f)/y,t[1]=(p-u)/y,t[2]=(s-c)/y):a>l&&a>d?(y=2*Math.sqrt(1+a-l-d),t[3]=(h-f)/y,t[0]=.25*y,t[1]=(s+c)/y,t[2]=(p+u)/y):l>d?(y=2*Math.sqrt(1+l-a-d),t[3]=(p-u)/y,t[0]=(s+c)/y,t[1]=.25*y,t[2]=(h+f)/y):(y=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/y,t[0]=(p+u)/y,t[1]=(h+f)/y,t[2]=.25*y),t}function be(t,e,n,i,r){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,v=a*l,y=a*h,g=s*h,m=u*c,T=u*l,b=u*h,E=i[0],S=i[1],w=i[2],k=r[0],P=r[1],x=r[2],N=(1-(v+g))*E,C=(f+b)*E,_=(d-T)*E,A=(f-b)*S,M=(1-(p+g))*S,O=(y+m)*S,I=(d+T)*w,R=(y-m)*w,L=(1-(p+v))*w;return t[0]=N,t[1]=C,t[2]=_,t[3]=0,t[4]=A,t[5]=M,t[6]=O,t[7]=0,t[8]=I,t[9]=R,t[10]=L,t[11]=0,t[12]=n[0]+k-(N*k+A*P+I*x),t[13]=n[1]+P-(C*k+M*P+R*x),t[14]=n[2]+x-(_*k+O*P+L*x),t[15]=1,t}function Ee(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n+n,s=i+i,u=r+r,c=n*a,l=i*a,h=i*s,p=r*a,f=r*s,d=r*u,v=o*a,y=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=p-y,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=f+v,t[7]=0,t[8]=p+y,t[9]=f-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Se=function(t,e,n,i,r,o,a){var s=1/(e-n),u=1/(i-r),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*u,t[14]=(a+o)*c,t[15]=1,t};function we(){var t=new ue(3);return ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ke(t){var e=new ue(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Pe(t){return Math.hypot(t[0],t[1],t[2])}function xe(t,e,n){var i=new ue(3);return i[0]=t,i[1]=e,i[2]=n,i}function Ne(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ce(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function _e(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Ae(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Me(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function Oe(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Ie(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}function Re(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Le(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function De(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=r*u-o*s,t[1]=o*a-i*u,t[2]=i*s-r*a,t}function Ue(t,e,n,i){var r=e[0],o=e[1],a=e[2];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=a+i*(n[2]-a),t}function Fe(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[3]*i+n[7]*r+n[11]*o+n[15];return t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/a,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/a,t}function Be(t,e){var n=t[0],i=t[1],r=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=se*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=se*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-s)<=se*Math.max(1,Math.abs(r),Math.abs(s))}var Ve,Ge=Ae,je=Me,He=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},ze=Pe;Ve=we();function We(){var t=new ue(4);return ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function qe(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*a,t[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*a,t[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*a,t[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*a,t}!function(){var t=We()}();function Ye(){var t=new ue(4);return ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Xe(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function Ke(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=i*l+a*s+r*c-o*u,t[1]=r*l+a*u+o*s-i*c,t[2]=o*l+a*c+i*u-r*s,t[3]=a*l-i*s-r*u-o*c,t}function Ze(t,e,n,i){var r,o,a,s,u,c=e[0],l=e[1],h=e[2],p=e[3],f=n[0],d=n[1],v=n[2],y=n[3];return 0>(o=c*f+l*d+h*v+p*y)&&(o=-o,f=-f,d=-d,v=-v,y=-y),1-o>se?(r=Math.acos(o),a=Math.sin(r),s=Math.sin((1-i)*r)/a,u=Math.sin(i*r)/a):(s=1-i,u=i),t[0]=s*c+u*f,t[1]=s*l+u*d,t[2]=s*h+u*v,t[3]=s*p+u*y,t}function Je(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n*n+i*i+r*r+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-i*s,t[2]=-r*s,t[3]=o*s,t}function Qe(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(i),l=Math.cos(i);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var $e,tn,en,nn,rn,on,an=function(t,e,n,i){var r=new ue(4);return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r},sn=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},un=Ke,cn=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n*n+i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=i*a,t[2]=r*a,t[3]=o*a,t};$e=we(),tn=xe(1,0,0),en=xe(0,1,0),nn=Ye(),rn=Ye(),on=ce();!function(){var t,e=(t=new ue(2),ue!=Float32Array&&(t[0]=0,t[1]=0),t)}();var ln,hn=function(){function t(t,e){this.center=void 0,this.halfExtents=void 0,this.min=we(),this.max=we(),this.update(t,e)}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){this.center=Ne(we(),t||we()),this.halfExtents=Ne(we(),e||xe(0,0,0)),this.min=Ge(this.min,this.center,this.halfExtents),this.max=_e(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){_e(this.center,e,t),Oe(this.center,this.center,.5),Ge(this.halfExtents,e,t),Oe(this.halfExtents,this.halfExtents,.5),Ne(this.min,t),Ne(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,i=n[0],r=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=i-s,h=i+s,p=r-u,f=r+u,d=o-c,v=o+c,y=e.center,g=y[0],m=y[1],T=y[2],b=e.halfExtents,E=b[0],S=b[1],w=b[2],k=g-E,P=g+E,x=m-S,N=m+S,C=T-w,_=T+w;l>k&&(l=k),P>h&&(h=P),p>x&&(p=x),N>f&&(f=N),d>C&&(d=C),_>v&&(v=_),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+v),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(v-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=v}},e.setFromTransformedAABB=function(t,e){var n=this.center,i=this.halfExtents,r=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],v=Math.abs(a),y=Math.abs(s),g=Math.abs(u),m=Math.abs(c),T=Math.abs(l),b=Math.abs(h),E=Math.abs(p),S=Math.abs(f),w=Math.abs(d);Ce(n,e[12]+a*r[0]+s*r[1]+u*r[2],e[13]+c*r[0]+l*r[1]+h*r[2],e[14]+p*r[0]+f*r[1]+d*r[2]),Ce(i,v*o[0]+y*o[1]+g*o[2],m*o[0]+T*o[1]+b*o[2],E*o[0]+S*o[1]+w*o[2]),this.min=Ge(this.min,n,i),this.max=_e(this.max,n,i)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),i=t.getMax(),r=t.getMin();return!(n[0]>i[0]||r[0]>e[0]||n[1]>i[1]||r[1]>e[1]||n[2]>i[2]||r[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,i,r,o=new t,a=(n=we(),i=this.getMin(),r=e.getMin(),n[0]=Math.max(i[0],r[0]),n[1]=Math.max(i[1],r[1]),n[2]=Math.max(i[2],r[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}(we(),this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Ne(we(),this.min):272===t.pnVertexFlag?xe(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?xe(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?xe(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?xe(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?xe(this.max[0],this.min[1],this.max[2]):xe(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Ne(we(),this.max):272===t.pnVertexFlag?xe(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?xe(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?xe(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?xe(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?xe(this.min[0],this.max[1],this.min[2]):xe(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),pn=we(),fn=function(){function t(t,e){this.center=void 0,this.radius=void 0,this.center=t||we(),this.radius=e||.5}var e=t.prototype;return e.containsPoint=function(t){return Ge(pn,t,this.center),Pe(pn)<this.radius*this.radius},e.intersects=function(t){Ge(pn,t.center,this.center);var e=t.radius+this.radius;return Pe(pn)<=e*e},t}(),dn=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||xe(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return Le(t,this.normal)-this.distance},e.normalize=function(){var t=1/ze(this.normal);Oe(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var i=this.distanceToPoint(t),r=i/(i-this.distanceToPoint(e)),o=r>=0&&1>=r;return o&&n&&Ue(n,t,e,r),o},t}();(ln=t.Mask||(t.Mask={}))[ln.OUTSIDE=4294967295]="OUTSIDE",ln[ln.INSIDE=0]="INSIDE",ln[ln.INDETERMINATE=2147483647]="INDETERMINATE";var vn=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new dn)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],v=t[14],y=t[15];Ce(this.planes[0].normal,r-e,u-o,p-c),this.planes[0].distance=y-f,Ce(this.planes[1].normal,r+e,u+o,p+c),this.planes[1].distance=y+f,Ce(this.planes[2].normal,r+n,u+a,p+l),this.planes[2].distance=y+d,Ce(this.planes[3].normal,r-n,u-a,p-l),this.planes[3].distance=y-d,Ce(this.planes[4].normal,r-i,u-s,p-h),this.planes[4].distance=y-v,Ce(this.planes[5].normal,r+i,u+s,p+h),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),yn=we(),gn=we(),mn=we(),Tn=we(),bn=we(),En=function(){function t(t,e){this.origin=void 0,this.direction=void 0,this.origin=t||we(),this.direction=e||xe(0,0,-1)}var e=t.prototype;return e.intersectsAABB=function(t,e){return e?this.intersectAABBWithIntersection(t,e):this.intersectsAABBWithoutIntersection(t)},e.intersectsSphere=function(t,e){var n=Ge(yn,this.origin,t.center);Re(gn,Ne(gn,this.direction));var i=Le(n,gn),r=Le(n,n)-t.radius*t.radius;if(r>0&&i>0)return null;var o=i*i-r;if(0>o)return!1;var a=Math.abs(-i-Math.sqrt(o));return e&&(Ne(e,this.direction),Ie(e,this.origin,e,a)),!0},e.intersectsPlane=function(t,e){var n=(t.distance-Le(t.normal,this.origin))/Le(t.normal,this.direction),i=n>=0;return i&&e&&Ie(e,this.origin,this.direction,n),i},e.intersectsAABBWithoutIntersection=function(t){var e=yn,n=gn,i=mn,r=Tn,o=bn,a=this.direction;return Ge(e,this.origin,t.center),Ce(r,Math.abs(e[0]),Math.abs(e[1]),Math.abs(e[2])),je(i,e,a),!(r[0]>t.halfExtents[0]&&i[0]>=0||r[1]>t.halfExtents[1]&&i[1]>=0||r[2]>t.halfExtents[2]&&i[2]>=0)&&(Ce(o,Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2])),De(n,a,e),Ce(n,Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])),!(n[0]>t.halfExtents[1]*o[2]+t.halfExtents[2]*o[1]||n[1]>t.halfExtents[0]*o[2]+t.halfExtents[2]*o[0]||n[2]>t.halfExtents[0]*o[1]+t.halfExtents[1]*o[0]))},e.intersectAABBWithIntersection=function(t,e){var n=Ne(we(),t.getMin());Ge(n,n,this.origin);var i=Ne(we(),t.getMax());Ge(i,i,this.origin);var r=this.direction;0===r[0]?(n[0]=0>n[0]?-Number.MAX_VALUE:Number.MAX_VALUE,i[0]=0>i[0]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[0]/=r[0],i[0]/=r[0]),0===r[1]?(n[1]=0>n[1]?-Number.MAX_VALUE:Number.MAX_VALUE,i[1]=0>i[1]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[1]/=r[1],i[1]/=r[1]),0===r[2]?(n[2]=0>n[2]?-Number.MAX_VALUE:Number.MAX_VALUE,i[2]=0>i[2]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[2]/=r[2],i[2]/=r[2]);var o=Ce(mn,Math.min(n[0],i[0]),Math.min(n[1],i[1]),Math.min(n[2],i[2])),a=Ce(Tn,Math.max(n[0],i[0]),Math.max(n[1],i[1]),Math.max(n[2],i[2])),s=Math.min(Math.min(a[0],a[1]),a[2]),u=Math.max(Math.max(o[0],o[1]),o[2]),c=s>=u&&u>=0;return c&&(Ne(e,this.direction),Ie(e,this.origin,e,u)),c},t}(),Sn=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),wn=function(){function t(t,e,n,i){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=i,this.left=t,this.right=t+n,this.top=e,this.bottom=e+i}return t.prototype.toJSON=function(){},t}();function kn(t){if(!t)throw new Error}function Pn(t,e){if(t!==e)throw new Error}function xn(t,e){if(t===e)throw new Error}function Nn(t){return void 0===t}function Cn(t){return null==t}function _n(t){return"number"==typeof t}function An(t){return"function"==typeof t}function Mn(t){return"boolean"==typeof t}function On(t){return"[object Object]"===Object.prototype.toString.call(t)}var In={},Rn=0;function Ln(t,e){if(t){var n="string"==typeof t?t:t.id||Rn++;In[n]&&In[n].destroy(),In[n]=e}}var Dn="undefined"!=typeof window&&void 0!==window.document,Un=.1,Fn="function"==typeof Float32Array,Bn=function(t,e){return 1-3*e+3*t},Vn=function(t,e){return 3*e-6*t},Gn=function(t){return 3*t},jn=function(t,e,n){return((Bn(e,n)*t+Vn(e,n))*t+Gn(e))*t},Hn=function(t,e,n){return 3*Bn(e,n)*t*t+2*Vn(e,n)*t+Gn(e)},zn=function(t,e,n,i){if(0>t||t>1||0>n||n>1)throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===i)return function(t){return t};for(var r=Fn?new Float32Array(11):new Array(11),o=0;11>o;++o)r[o]=jn(o*Un,t,n);var a=function(e){for(var i=0,o=1;10!==o&&e>=r[o];++o)i+=Un;--o;var a=i+(e-r[o])/(r[o+1]-r[o])*Un,s=Hn(a,t,n);return.001>s?0===s?a:function(t,e,n,i,r){var o,a,s=0;do{(o=jn(a=e+(n-e)/2,i,r)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,i,i+Un,t,n):function(t,e,n,i){for(var r=0;4>r;++r){var o=Hn(e,n,i);if(0===o)return e;e-=(jn(e,n,i)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:jn(a(t),e,i)}};function Wn(t,e,n){return n?Math.min(t,e)===t?e:Math.max(t,n)===t?n:t:Math.max(t,e)===e?t:e}function qn(t){return void 0===t?0:t>360||-360>t?t%360:t}function Yn(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),_n(t)?xe(t,e,n):Array.isArray(t)&&3===t.length?ke(t):xe(t[0],t[1]||e,t[2]||n)}function Xn(t){return t*(180/Math.PI)}function Kn(t){return 360*t}function Zn(t,e){return 16===e.length?function(t,e){var n,i,r=.5*Math.PI,o=me(we(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return r>c?c>-r?(n=Math.atan2(e[6]/s,e[10]/u),i=Math.atan2(e[1]/a,e[0]/a)):(i=0,n=-Math.atan2(e[4]/s,e[5]/s)):(i=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=i,t}(t,e):function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=i*i,s=r*r,u=o*o,c=n*n+a+s+u,l=n*o-i*r;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(i,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(i,n),t[2]=0):(t[0]=Math.asin(2*(n*r-o*i)),t[1]=Math.atan2(2*(n*o+i*r),1-2*(s+u)),t[2]=Math.atan2(2*(n*i+r*o),1-2*(a+s))),t}(t,e)}function Jn(t,e,n,i,r){var o,a,s,u,c,l,h,p,f,d,v=Math.cos(t),y=Math.sin(t);return o=i*v,a=r*y,s=0,u=-i*y,c=r*v,l=0,h=e,p=n,f=1,(d=new ue(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=p,d[8]=f,d}function Qn(t,e,n,i,r,o,a){var s=2*o/(i-r),u=(n+e)/(n-e),c=(i+r)/(i-r),l=-(a+o)/(a-o),h=-2*a*o/(a-o);return t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function $n(t){var e=t[0],n=t[1],i=t[3],r=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(i*i+r*r);0>e*r-n*i&&(r>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(i*=1/a,r*=1/a);var s=Xn(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var ti=function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substr(1):t},ei=function(t){return Math.pow(t,2)},ni=function(t){return Math.pow(t,3)},ii=function(t){return Math.pow(t,4)},ri=function(t){return Math.pow(t,5)},oi=function(t){return Math.pow(t,6)},ai=function(t){return 1-Math.cos(t*Math.PI/2)},si=function(t){return 1-Math.sqrt(1-t*t)},ui=function(t){return t*t*(3*t-2)},ci=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},li=function(t,e){void 0===e&&(e=[]);var n=e[0],i=e[1],r=void 0===i?.5:i,o=Wn(Number(void 0===n?1:n),1,10),a=Wn(Number(r),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-a/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/a)},hi=function(t,e,n){void 0===e&&(e=[]);var i=e[0],r=void 0===i?1:i,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;r=Wn(r,.1,1e3),a=Wn(a,.1,1e3),u=Wn(u,.1,1e3),l=Wn(l,.1,1e3);var h=Math.sqrt(a/r),p=u/(2*Math.sqrt(a*r)),f=1>p?h*Math.sqrt(1-p*p):0,d=1>p?(p*h-l)/f:-l+h,v=n?n*t/1e3:t;return v=1>p?Math.exp(-v*p*h)*(1*Math.cos(f*v)+d*Math.sin(f*v)):(1+d*v)*Math.exp(-v*h),0===t||1===t?t:1-v},pi=function(t,e){void 0===e&&(e=[]);var n=e[0],i=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(Wn(t,0,1)*i)/i},fi=function(t,e){void 0===e&&(e=[]);return zn(e[0],e[1],e[2],e[3])(t)},di=zn(.42,0,1,1),vi=function(t){return function(e,n,i){return void 0===n&&(n=[]),1-t(1-e,n,i)}},yi=function(t){return function(e,n,i){return void 0===n&&(n=[]),.5>e?t(2*e,n,i)/2:1-t(-2*e+2,n,i)/2}},gi=function(t){return function(e,n,i){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,i))/2:(t(2*e-1,n,i)+1)/2}},mi={steps:pi,"step-start":function(t){return pi(t,[1,"start"])},"step-end":function(t){return pi(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":fi,ease:function(t){return fi(t,[.25,.1,.25,1])},in:di,out:vi(di),"in-out":yi(di),"out-in":gi(di),"in-quad":ei,"out-quad":vi(ei),"in-out-quad":yi(ei),"out-in-quad":gi(ei),"in-cubic":ni,"out-cubic":vi(ni),"in-out-cubic":yi(ni),"out-in-cubic":gi(ni),"in-quart":ii,"out-quart":vi(ii),"in-out-quart":yi(ii),"out-in-quart":gi(ii),"in-quint":ri,"out-quint":vi(ri),"in-out-quint":yi(ri),"out-in-quint":gi(ri),"in-expo":oi,"out-expo":vi(oi),"in-out-expo":yi(oi),"out-in-expo":gi(oi),"in-sine":ai,"out-sine":vi(ai),"in-out-sine":yi(ai),"out-in-sine":gi(ai),"in-circ":si,"out-circ":vi(si),"in-out-circ":yi(si),"out-in-circ":gi(si),"in-back":ui,"out-back":vi(ui),"in-out-back":yi(ui),"out-in-back":gi(ui),"in-bounce":ci,"out-bounce":vi(ci),"in-out-bounce":yi(ci),"out-in-bounce":gi(ci),"in-elastic":li,"out-elastic":vi(li),"in-out-elastic":yi(li),"out-in-elastic":gi(li),spring:hi,"spring-in":hi,"spring-out":vi(hi),"spring-in-out":yi(hi),"spring-out-in":gi(hi)},Ti=function(t){return mi[function(t){return ti(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||mi.linear},bi=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,i=!1,r=!1,o=t.then((function(t){return r=!0,n=!1,e=t,t}),(function(t){throw i=!0,n=!1,t}));return o.isFulfilled=function(){return r},o.isPending=function(){return n},o.isRejected=function(){return i},o.getFullFilledValue=function(){return e},o},Ei=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Si={keys:Object.keys,values:Object.values,entries:Object.entries};var wi,ki={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};(wi=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",wi.COLOR="<color>",wi.PAINT="<paint>",wi.NUMBER="<number>",wi.OPACITY_VALUE="<opacity-value>",wi.SHADOW_BLUR="<shadow-blur>",wi.LENGTH="<length>",wi.PERCENTAGE="<percentage>",wi.LENGTH_PERCENTAGE="<length> | <percentage>",wi.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",wi.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",wi.LIST_OF_POINTS="<list-of-points>",wi.PATH="<path>",wi.FILTER="<filter>",wi.Z_INDEX="<z-index>",wi.OFFSET_PATH="<offset-path>",wi.OFFSET_DISTANCE="<offset-distance>",wi.CLIP_PATH="<clip-path>",wi.TRANSFORM="<transform>",wi.TRANSFORM_ORIGIN="<transform-origin>",wi.TEXT="<text>",wi.TEXT_TRANSFORM="<text-transform>";var Pi,xi=r.defineToken("StyleValueRegistry"),Ni=r.defineToken("GeometryUpdaterFactory"),Ci=r.defineToken("GeometryAABBUpdater");(Pi=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",Pi.ATTR_MODIFIED="DOMAttrModified",Pi.INSERTED="DOMNodeInserted",Pi.CHILD_INSERTED="child-inserted",Pi.REMOVED="removed",Pi.CHILD_REMOVED="child-removed",Pi.MOUNTED="DOMNodeInsertedIntoDocument",Pi.UNMOUNTED="DOMNodeRemovedFromDocument",Pi.BOUNDS_CHANGED="bounds-changed",Pi.GEOMETRY_BOUNDS_CHANGED="geometry-bounds-changed",Pi.RENDER_ORDER_CHANGED="render-order-changed";var _i=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Sn,this.page=new Sn,this.canvas=new Sn,this.viewport=new Sn,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},Wt(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),Ai=function(t){function e(e,n){var i;return(i=t.call(this,null)||this).type=e,i.detail=n,Object.assign(Qt(i),n),i}return Yt(e,t),e}(_i),Mi=function(){function t(){this.emitter=new ne.EventEmitter}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var i=Mn(n)&&n||On(n)&&n.capture,r=On(n)&&n.once,o=An(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=i?t+"capture":t,e=An(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return r?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var i,r=Mn(n)&&n||On(n)&&n.capture,o=An(e)?void 0:e;return t=r?t+"capture":t,e=An(e)?e:null===(i=e)||void 0===i?void 0:i.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new Ai(t,e))},e.dispatchEvent=function(t){if(!(t instanceof _i))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var e,n,i=this.ownerDocument||this.document;i&&(t.manager=(null===(e=i.defaultView)||void 0===e?void 0:e.getEventService())||null,t.defaultPrevented=!1,t.path=[],t.target=this,null===(n=t.manager)||void 0===n||n.dispatchEvent(t));return!t.defaultPrevented},t}(),Oi=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}Yt(n,e),n.isNode=function(t){return!!t.childNodes};var i=n.prototype;return i.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},i.hasChildNodes=function(){return this.childNodes.length>0},i.isDefaultNamespace=function(t){throw new Error("Method not implemented.")},i.lookupNamespaceURI=function(t){throw new Error("Method not implemented.")},i.lookupPrefix=function(t){throw new Error("Method not implemented.")},i.normalize=function(){throw new Error("Method not implemented.")},i.isEqualNode=function(t){return this===t},i.isSameNode=function(t){return this.isEqualNode(t)},i.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,i=this,r=[e],o=[i];null!==(a=e.parentNode)&&void 0!==a?a:i.parentNode;){var a;e=e.parentNode?(r.push(e.parentNode),e.parentNode):e,i=i.parentNode?(o.push(i.parentNode),i.parentNode):i}if(e!==i)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=r.length>o.length?r:o,u=s===r?o:r;if(s[s.length-u.length]===u[0])return s===r?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===r?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===r?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},i.contain=function(t){return this.contains(t)},i.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},i.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},i.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},Wt(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,i=te(this.childNodes);!(n=i()).done;){var r=n.value;e+=r.nodeName===t.Shape.TEXT?r.nodeValue:r.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t,!0)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}}]),n}(Mi);Oi.DOCUMENT_POSITION_DISCONNECTED=1,Oi.DOCUMENT_POSITION_PRECEDING=2,Oi.DOCUMENT_POSITION_FOLLOWING=4,Oi.DOCUMENT_POSITION_CONTAINS=8,Oi.DOCUMENT_POSITION_CONTAINED_BY=16,Oi.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Ii=function(){this.contentBounds=void 0,this.renderBounds=void 0};Ii.tag="c-geometry";var Ri=function(){this.bounds=void 0,this.boundsDirty=!0,this.renderBounds=void 0,this.renderBoundsDirty=!0,this.dirtyRenderBounds=void 0,this.dirty=!1};Ri.tag="c-renderable";var Li,Di=function(){this.dirtyFlag=!1,this.localDirtyFlag=!1,this.frozen=!1,this.localPosition=xe(0,0,0),this.localRotation=an(0,0,0,1),this.localScale=xe(1,1,1),this.localTransform=le(),this.position=xe(0,0,0),this.rotation=an(0,0,0,1),this.scaling=xe(1,1,1),this.worldTransform=le(),this.origin=xe(0,0,0)};Di.tag="c-transform",(Li=t.Strategy||(t.Strategy={}))[Li.Standard=0]="Standard";var Ui=function(){function e(){this.strategy=t.Strategy.Standard,this.visibilityPlaneMask=-1,this.visible=!0,this.enable=!0}return e.prototype.isCulled=function(){return this.enable&&!this.visible},e}();Ui.tag="c-cullable";var Fi=function(){this.dirty=!1,this.sorted=void 0,this.lastSortedIndex=void 0,this.renderOrder=0};Fi.tag="c-sortable";var Bi=function(t){function e(e,n,i,r,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=i,c.newValue=r,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return Yt(e,t),e}(_i);Bi.ADDITION=2,Bi.MODIFICATION=1,Bi.REMOVAL=3;var Vi=0,Gi=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).sceneGraphService=Ut.get(Tc),t.entity=Vi++,t.renderable=new Ri,t.cullable=new Ui,t.transformable=new Di,t.sortable=new Fi,t.geometry=new Ii,t.id=void 0,t.name=void 0,t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}Yt(n,e),n.isElement=function(t){return!!t.getAttribute};var i=n.prototype;return i.cloneNode=function(t){throw new Error("Method not implemented.")},i.appendChild=function(e,n){return this.sceneGraphService.attach(e,this,n),this.emit(t.ElementEvent.CHILD_INSERTED,{child:e}),e.dispatchEvent(new Bi(t.ElementEvent.INSERTED,this,"","","",0,"","")),e},i.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},i.replaceChild=function(t,e,n){var i=this.childNodes.indexOf(e);return this.removeChild(e,n),this.appendChild(t,i),e},i.removeChild=function(e,n){return void 0===n&&(n=!0),e.dispatchEvent(new Bi(t.ElementEvent.REMOVED,this,"","","",0,"","")),n&&(e.emit(t.ElementEvent.DESTROY,{}),e.destroyed=!0),this.emit(t.ElementEvent.CHILD_REMOVED,{child:e}),this.sceneGraphService.detach(e),n&&e.emitter.removeAllListeners(),e},i.removeChildren=function(t){var e=this;void 0===t&&(t=!0),this.childNodes.slice().forEach((function(n){e.removeChild(n,t)}))},i.matches=function(t){return this.sceneGraphService.matches(t,this)},i.getElementById=function(t){return this.sceneGraphService.querySelector("#"+t,this)},i.getElementsByName=function(t){return this.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},i.getElementsByClassName=function(t){return this.sceneGraphService.querySelectorAll("."+t,this)},i.getElementsByTagName=function(t){return this.sceneGraphService.querySelectorAll(t,this)},i.querySelector=function(t){return this.sceneGraphService.querySelector(t,this)},i.querySelectorAll=function(t){return this.sceneGraphService.querySelectorAll(t,this)},i.closest=function(t){var e=this;do{if(this.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},i.find=function(t){var e=this,n=null;return this.forEach((function(i){return!(i===e||!t(i))&&(n=i,!0)})),n},i.findAll=function(t){var e=this,n=[];return this.forEach((function(i){i!==e&&t(i)&&n.push(i)})),n},i.after=function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];i.forEach((function(n,i){var r;return null===(r=t.parentNode)||void 0===r?void 0:r.appendChild(n,e+i+1)}))}},i.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=n[0],o=n.slice(1);this.parentNode.appendChild(r,t),r.after.apply(r,o)}},i.replaceWith=function(){this.after.apply(this,arguments),this.remove()},i.append=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];n.forEach((function(e){return t.appendChild(e)}))},i.prepend=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];n.forEach((function(e,n){return t.appendChild(e,n)}))},i.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},i.remove=function(t){return void 0===t&&(t=!0),this.parentNode?this.parentNode.removeChild(this,t):this},i.destroy=function(){this.emit(t.ElementEvent.DESTROY,{}),this.remove(!1),this.emitter.removeAllListeners(),this.destroyed=!0},i.getGeometryBounds=function(){return this.sceneGraphService.getGeometryBounds(this)},i.getRenderBounds=function(){return this.sceneGraphService.getBounds(this,!0)},i.getBounds=function(){return this.sceneGraphService.getBounds(this)},i.getLocalBounds=function(){return this.sceneGraphService.getLocalBounds(this)},i.getBoundingClientRect=function(){return this.sceneGraphService.getBoundingClientRect(this)},i.getClientRects=function(){return[this.getBoundingClientRect()]},i.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},i.getAttributeNames=function(){return Object.keys(this.attributes)},i.getAttribute=function(t){var e=Vu(t.toString(),""),n=this.attributes[e[0]];return Cn(n)?null:n},i.hasAttribute=function(t){return this.getAttributeNames().includes(t)},i.hasAttributes=function(){return!!this.getAttributeNames().length},i.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},i.setAttribute=function(t,e,n){this.attributes[t]=e},i.getAttributeNS=function(t,e){throw new Error("Method not implemented.")},i.getAttributeNode=function(t){throw new Error("Method not implemented.")},i.getAttributeNodeNS=function(t,e){throw new Error("Method not implemented.")},i.hasAttributeNS=function(t,e){throw new Error("Method not implemented.")},i.removeAttributeNS=function(t,e){throw new Error("Method not implemented.")},i.removeAttributeNode=function(t){throw new Error("Method not implemented.")},i.setAttributeNS=function(t,e,n){throw new Error("Method not implemented.")},i.setAttributeNode=function(t){throw new Error("Method not implemented.")},i.setAttributeNodeNS=function(t){throw new Error("Method not implemented.")},i.toggleAttribute=function(t,e){throw new Error("Method not implemented.")},Wt(n,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}}]),n}(Oi),ji=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=i,o.timelineTime=r,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=i,o.timelineTime=r,o}return Yt(e,t),e}(_i),Hi=0,zi=function(){function t(t,e){this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+Hi++,this._inEffect=!!this.effect.update(0),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this.totalDuration:0,this._startTime=this.totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this.totalDuration>=1/0)throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this.totalDuration}else this.currentTime=0},e.persist=function(){throw new Error("Method not implemented.")},e.addEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.removeEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.dispatchEvent=function(t){throw new Error("Method not implemented.")},e.commitStyles=function(){throw new Error("Method not implemented.")},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this.totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new ji(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var i=new ji(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}},Wt(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this.totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){var t;return Number(null===(t=this.effect)||void 0===t?void 0:t.getComputedTiming().endTime)}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}();function Wi(t,e){return Number(t.id)-Number(e.id)}var qi,Yi,Xi,Ki,Zi,Ji=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(Wi),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t){var e=new zi(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Wi),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var i,r,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var i=n._inEffect||n._needsTick;n._inTimeline=i,i?u.push(n):c.push(n)})),(i=this.pendingEffects).push.apply(i,a),(r=this.pendingEffects).push.apply(r,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();(qi=t.UnitType||(t.UnitType={}))[qi.kUnknown=0]="kUnknown",qi[qi.kNumber=1]="kNumber",qi[qi.kPercentage=2]="kPercentage",qi[qi.kEms=3]="kEms",qi[qi.kExs=4]="kExs",qi[qi.kPixels=5]="kPixels",qi[qi.kCentimeters=6]="kCentimeters",qi[qi.kMillimeters=7]="kMillimeters",qi[qi.kInches=8]="kInches",qi[qi.kPoints=9]="kPoints",qi[qi.kPicas=10]="kPicas",qi[qi.kQuarterMillimeters=11]="kQuarterMillimeters",qi[qi.kViewportWidth=12]="kViewportWidth",qi[qi.kViewportHeight=13]="kViewportHeight",qi[qi.kViewportInlineSize=14]="kViewportInlineSize",qi[qi.kViewportBlockSize=15]="kViewportBlockSize",qi[qi.kViewportMin=16]="kViewportMin",qi[qi.kViewportMax=17]="kViewportMax",qi[qi.kSmallViewportWidth=18]="kSmallViewportWidth",qi[qi.kSmallViewportHeight=19]="kSmallViewportHeight",qi[qi.kSmallViewportInlineSize=20]="kSmallViewportInlineSize",qi[qi.kSmallViewportBlockSize=21]="kSmallViewportBlockSize",qi[qi.kSmallViewportMin=22]="kSmallViewportMin",qi[qi.kSmallViewportMax=23]="kSmallViewportMax",qi[qi.kLargeViewportWidth=24]="kLargeViewportWidth",qi[qi.kLargeViewportHeight=25]="kLargeViewportHeight",qi[qi.kLargeViewportInlineSize=26]="kLargeViewportInlineSize",qi[qi.kLargeViewportBlockSize=27]="kLargeViewportBlockSize",qi[qi.kLargeViewportMin=28]="kLargeViewportMin",qi[qi.kLargeViewportMax=29]="kLargeViewportMax",qi[qi.kDynamicViewportWidth=30]="kDynamicViewportWidth",qi[qi.kDynamicViewportHeight=31]="kDynamicViewportHeight",qi[qi.kDynamicViewportInlineSize=32]="kDynamicViewportInlineSize",qi[qi.kDynamicViewportBlockSize=33]="kDynamicViewportBlockSize",qi[qi.kDynamicViewportMin=34]="kDynamicViewportMin",qi[qi.kDynamicViewportMax=35]="kDynamicViewportMax",qi[qi.kContainerWidth=36]="kContainerWidth",qi[qi.kContainerHeight=37]="kContainerHeight",qi[qi.kContainerInlineSize=38]="kContainerInlineSize",qi[qi.kContainerBlockSize=39]="kContainerBlockSize",qi[qi.kContainerMin=40]="kContainerMin",qi[qi.kContainerMax=41]="kContainerMax",qi[qi.kRems=42]="kRems",qi[qi.kChs=43]="kChs",qi[qi.kUserUnits=44]="kUserUnits",qi[qi.kDegrees=45]="kDegrees",qi[qi.kRadians=46]="kRadians",qi[qi.kGradians=47]="kGradians",qi[qi.kTurns=48]="kTurns",qi[qi.kMilliseconds=49]="kMilliseconds",qi[qi.kSeconds=50]="kSeconds",qi[qi.kHertz=51]="kHertz",qi[qi.kKilohertz=52]="kKilohertz",qi[qi.kDotsPerPixel=53]="kDotsPerPixel",qi[qi.kDotsPerInch=54]="kDotsPerInch",qi[qi.kDotsPerCentimeter=55]="kDotsPerCentimeter",qi[qi.kFraction=56]="kFraction",qi[qi.kInteger=57]="kInteger",qi[qi.kQuirkyEms=58]="kQuirkyEms",(Yi=t.UnitCategory||(t.UnitCategory={}))[Yi.kUNumber=0]="kUNumber",Yi[Yi.kUPercent=1]="kUPercent",Yi[Yi.kULength=2]="kULength",Yi[Yi.kUAngle=3]="kUAngle",Yi[Yi.kUTime=4]="kUTime",Yi[Yi.kUFrequency=5]="kUFrequency",Yi[Yi.kUResolution=6]="kUResolution",Yi[Yi.kUOther=7]="kUOther",(Xi=t.ValueRange||(t.ValueRange={}))[Xi.kAll=0]="kAll",Xi[Xi.kNonNegative=1]="kNonNegative",Xi[Xi.kInteger=2]="kInteger",Xi[Xi.kNonNegativeInteger=3]="kNonNegativeInteger",Xi[Xi.kPositiveInteger=4]="kPositiveInteger",(Ki=t.Nested||(t.Nested={}))[Ki.kYes=0]="kYes",Ki[Ki.kNo=1]="kNo",(Zi=t.ParenLess||(t.ParenLess={}))[Zi.kYes=0]="kYes",Zi[Zi.kNo=1]="kNo";var Qi,$i=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];(Qi=t.CSSStyleValueType||(t.CSSStyleValueType={}))[Qi.kUnknownType=0]="kUnknownType",Qi[Qi.kUnparsedType=1]="kUnparsedType",Qi[Qi.kKeywordType=2]="kKeywordType",Qi[Qi.kUnitType=3]="kUnitType",Qi[Qi.kSumType=4]="kSumType",Qi[Qi.kProductType=5]="kProductType",Qi[Qi.kNegateType=6]="kNegateType",Qi[Qi.kInvertType=7]="kInvertType",Qi[Qi.kMinType=8]="kMinType",Qi[Qi.kMaxType=9]="kMaxType",Qi[Qi.kClampType=10]="kClampType",Qi[Qi.kTransformType=11]="kTransformType",Qi[Qi.kPositionType=12]="kPositionType",Qi[Qi.kURLImageType=13]="kURLImageType",Qi[Qi.kColorType=14]="kColorType",Qi[Qi.kUnsupportedColorType=15]="kUnsupportedColorType";var tr,er,nr=function(){function e(){}e.parse=function(t,e){return[][0]},e.parseAll=function(t,e){return[]},e.unitFromName=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:this.stringToUnitType(e):t.UnitType.kUnknown},e.unitTypeToUnitCategory=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return t.UnitCategory.kUNumber;case t.UnitType.kPercentage:return t.UnitCategory.kUPercent;case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:return t.UnitCategory.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.UnitCategory.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.UnitCategory.kUAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.UnitCategory.kUFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.UnitCategory.kUResolution;default:return t.UnitCategory.kUOther}},e.unitTypeToString=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:case t.UnitType.kUserUnits:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:case t.UnitType.kQuirkyEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},e.stringToUnitType=function(t){return $i.find((function(e){return e.name===t})).unit_type},e.canonicalUnitTypeForCategory=function(e){switch(e){case t.UnitCategory.kUNumber:return t.UnitType.kNumber;case t.UnitCategory.kULength:return t.UnitType.kPixels;case t.UnitCategory.kUPercent:return t.UnitType.kUnknown;case t.UnitCategory.kUTime:return t.UnitType.kSeconds;case t.UnitCategory.kUAngle:return t.UnitType.kDegrees;case t.UnitCategory.kUFrequency:return t.UnitType.kHertz;case t.UnitCategory.kUResolution:return t.UnitType.kDotsPerPixel;default:return t.UnitType.kUnknown}},e.conversionToCanonicalUnitsScaleFactor=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kSeconds:case t.UnitType.kHertz:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kCentimeters:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kDotsPerInch:case t.UnitType.kPoints:case t.UnitType.kPicas:break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360;break;case t.UnitType.kKilohertz:n=1e3}return n},e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isViewportPercentageLength=function(e){return e>=t.UnitType.kViewportWidth&&t.UnitType.kDynamicViewportMax>=e},e.isContainerPercentageLength=function(e){return e>=t.UnitType.kContainerWidth&&t.UnitType.kContainerMax>=e},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kUserUnits>=e||e==t.UnitType.kQuirkyEms},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kExs||e===t.UnitType.kRems||e===t.UnitType.kChs||this.isViewportPercentageLength(e)||this.isContainerPercentageLength(e)},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds},e.isFrequency=function(e){return e==t.UnitType.kHertz||e==t.UnitType.kKilohertz},e.isResolution=function(e){return e>=t.UnitType.kDotsPerPixel&&t.UnitType.kDotsPerCentimeter>=e},e.isFlex=function(e){return e===t.UnitType.kFraction};var n=e.prototype;return n.toString=function(){return this.buildCSSText(t.Nested.kNo,t.ParenLess.kNo,"")},n.isNumericValue=function(){return this.getType()>=t.CSSStyleValueType.kUnitType&&this.getType()<=t.CSSStyleValueType.kClampType},e}(),ir=function(e){function n(t){var n;return(n=e.call(this)||this).colorSpace=void 0,n.colorSpace=t,n}Yt(n,e);var i=n.prototype;return i.getType=function(){return t.CSSStyleValueType.kColorType},i.to=function(t){return this},n}(nr),rr=function(e){function n(t){var n;return(n=e.call(this)||this).value=void 0,n.value=t,n}Yt(n,e);var i=n.prototype;return i.clone=function(){return new n(this.value)},i.getType=function(){return t.CSSStyleValueType.kKeywordType},i.buildCSSText=function(t,e,n){return n+this.value},n}(nr);function or(e){switch(xn(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kExs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:case t.UnitType.kRems:case t.UnitType.kChs:return t.BaseType.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.BaseType.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.BaseType.kAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.BaseType.kFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.BaseType.kResolution;case t.UnitType.kFraction:return t.BaseType.kFlex;case t.UnitType.kPercentage:return t.BaseType.kPercent;default:return t.BaseType.kLength}}function ar(e){switch(e){case t.BaseType.kLength:return"length";case t.BaseType.kAngle:return"angle";case t.BaseType.kTime:return"time";case t.BaseType.kFrequency:return"frequency";case t.BaseType.kResolution:return"resolution";case t.BaseType.kFlex:return"flex";case t.BaseType.kPercent:return"percent"}return""}(tr=t.CSSMathOperator||(t.CSSMathOperator={})).kAdd="+",tr.kSubtract="-",tr.kMultiply="*",tr.kDivide="/",tr.kMin="min",tr.kMax="max",tr.kClamp="clamp",tr.kInvalid="",(er=t.BaseType||(t.BaseType={}))[er.kLength=0]="kLength",er[er.kAngle=1]="kAngle",er[er.kTime=2]="kTime",er[er.kFrequency=3]="kFrequency",er[er.kResolution=4]="kResolution",er[er.kFlex=5]="kFlex",er[er.kPercent=6]="kPercent",er[er.kNumBaseTypes=7]="kNumBaseTypes";var sr=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=t.BaseType.kPercent,this.hasPercentHint=!1,this.exponents=new Array(t.BaseType.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(or(e),n)}var n=e.prototype;return n.applyPercentHint=function(e){xn(e,t.BaseType.kPercent),this.setExponent(e,this.exponent(e)+this.exponent(t.BaseType.kPercent)),this.setExponent(t.BaseType.kPercent,0),this.percentHint=e,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return xn(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},n.exponent=function(t){return this.exponents[t]},n.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},e.negateExponents=function(t){return t.exponents.forEach((function(t){return-1*t})),t},n.matchesBaseType=function(e){return xn(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesBaseTypePercentage=function(e){return xn(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},e.add=function(e,n,i){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint),Pn(e.percentHint,n.percentHint);for(var r=0;t.BaseType.kNumBaseTypes>r;++r){var o=r;if(e.exponents[r]!==n.exponents[r]&&(o!==t.BaseType.kPercent&&(e.applyPercentHint(o),n.applyPercentHint(o)),e.exponents[r]!==n.exponents[r]))return e}return e},e.multiply=function(e,n,i){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint);for(var r=0;t.BaseType.kNumBaseTypes>r;++r){var o=r;e.setExponent(o,e.exponent(o)+n.exponent(o))}return e},e}(),ur=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}Yt(n,e),n.fromNumberish=function(e){return"number"==typeof e?new dr(e,t.UnitType.kNumber):e},n.fromPercentish=function(e){return"number"==typeof e?new dr(100*e,t.UnitType.kPercentage):e};var i=n.prototype;return i.getType=function(){return t.CSSStyleValueType.kUnknownType},i.equals=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=cr(n);return r.every((function(e){return t.equals(e)}))},i.add=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=cr(n);lr(t.CSSStyleValueType.kSumType,r,this);var o=pr(r,t.CSSMathOperator.kAdd);return o||wr.create(r)},i.sub=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=cr(n);r=r.map((function(t){return t.negate()})),lr(t.CSSStyleValueType.kSumType,r,this);var o=pr(r,t.CSSMathOperator.kAdd);return o||wr.create(r)},i.mul=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=cr(n);lr(t.CSSStyleValueType.kProductType,r,this);var o=fr(r);return o||kr.create(r)},i.div=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=cr(n);r=r.map((function(t){return t.invert()})),lr(t.CSSStyleValueType.kProductType,r,this);var o=fr(r);return o||kr.create(r)},i.min=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=cr(n);lr(t.CSSStyleValueType.kMinType,r,this);var o=pr(r,t.CSSMathOperator.kMin);return o||Er.create(r)},i.max=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=cr(n);lr(t.CSSStyleValueType.kMaxType,r,this);var o=pr(r,t.CSSMathOperator.kMax);return o||Sr.create(r)},i.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,i=hr(e[0]);return i?(n="string"==typeof t?dr.unitFromName(t):t,i.convertTo(n)):null},i.toSum=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];for(var r=0,o=e;o.length>r;r++){var a=o[r];if(!n.isValidUnit(n.unitFromName(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=te(s);!(u=l()).done;){var h=u.value,p=hr(h);if(!p)return null;c.push(p)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var f=wr.create(c);return kn(!!f),f}for(var d=[],v=function(){var t=n.unitFromName(g[y]);kn(n.isValidUnit(t));var e=c.reduce((function(e,n,i){if(n){var r=n.convertTo(t);r&&(e+=r.value,c[i]=null)}return e}),0);d.push(new dr(e,t))},y=0,g=e;g.length>y;y++)v();if(c.some((function(t){return!!t})))throw new Error("There were leftover terms that were not converted");return wr.create(d)},i.type=function(){var e={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},n=this.type_.exponent(t.BaseType.kLength);return n&&(e.length=n),(n=this.type_.exponent(t.BaseType.kAngle))&&(e.angle=n),(n=this.type_.exponent(t.BaseType.kTime))&&(e.time=n),(n=this.type_.exponent(t.BaseType.kFrequency))&&(e.frequency=n),(n=this.type_.exponent(t.BaseType.kResolution))&&(e.resolution=n),(n=this.type_.exponent(t.BaseType.kFlex))&&(e.flex=n),(n=this.type_.exponent(t.BaseType.kPercent))&&(e.percent=n),this.type_.hasPercentHint&&(e.percentHint=ar(this.type_.percentHint)),e},n.isValidUnit=function(e){return e!==t.UnitType.kUserUnits&&!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e)||this.isFrequency(e)||this.isResolution(e)||this.isFlex(e))},i.negate=function(){return gr.create(this)},i.invert=function(){return yr.create(this)},n}(nr);function cr(t){return t.map(ur.fromNumberish)}function lr(t,e,n){kn(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function hr(t){return 0===Object.keys(t.units).length?new dr(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new dr(t.value,Number(Object.keys(t.units)[0])):null}function pr(e,n){kn(!!e.length);var i=e[0]instanceof dr?e[0]:null;if(!i)return null;for(var r=i.value,o=1;e.length>o;o++){var a=e[o]instanceof dr?e[o]:null;if(!a||a.unit!==i.unit)return null;n===t.CSSMathOperator.kAdd?r+=a.value:n===t.CSSMathOperator.kMax?r=Math.max(r,a.value):n===t.CSSMathOperator.kMin&&(r=Math.min(r,a.value))}return new dr(r,i.unit)}function fr(e){kn(!!e.length);for(var n=t.UnitType.kNumber,i=1,r=0;e.length>r;r++){var o=e[r]instanceof dr?e[r]:null;if(!o)return null;if(o.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=o.unit}i*=o.value}return new dr(i,n)}var dr=function(e){function n(i,r){var o,a;return void 0===r&&(r=t.UnitType.kNumber),a="string"==typeof r?n.unitFromName(r):r,kn(n.isValidUnit(a)),(o=e.call(this,new sr(a))||this).unit=void 0,o.value=void 0,o.unit=a,o.value=i,o}Yt(n,e),n.toCanonicalUnit=function(t){return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(t))},n.toCanonicalUnitIfPossible=function(e){var n=this.toCanonicalUnit(e);return n===t.UnitType.kUnknown?e:n},n.formatInfinityOrNaN=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(kn(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},n.formatNumber=function(t,e){return void 0===e&&(e=""),t+e};var i=n.prototype;return i.clone=function(){return new n(this.value,this.unit)},i.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var i=n.toCanonicalUnit(this.unit);if(i!==n.toCanonicalUnit(e)||i===t.UnitType.kUnknown)return null;var r=nr.conversionToCanonicalUnitsScaleFactor(this.unit)/nr.conversionToCanonicalUnitsScaleFactor(e);return new n(this.value*r,e)},i.equals=function(t){return this.value===t.value&&this.unit===t.unit},i.getType=function(){return t.CSSStyleValueType.kUnitType},i.sumValue=function(){var e=[],i={};return this.unit!==t.UnitType.kNumber&&(i[n.toCanonicalUnitIfPossible(this.unit)]=1),e.push({value:this.value*nr.conversionToCanonicalUnitsScaleFactor(this.unit),units:i}),e},i.negate=function(){return new n(-this.value,this.unit)},i.invert=function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new n(1/this.value,this.unit):yr.create(this)},i.buildCSSText=function(e,i,r){var o;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:o=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kQuirkyEms:case t.UnitType.kExs:case t.UnitType.kRems:case t.UnitType.kChs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kHertz:case t.UnitType.kKilohertz:case t.UnitType.kTurns:case t.UnitType.kFraction:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:var a=this.value,s=n.unitTypeToString(this.unit);if(-999999>a||a>999999){var u=n.unitTypeToString(this.unit);o=!Number.isFinite(a)||Number.isNaN(a)?n.formatInfinityOrNaN(a,u):n.formatNumber(a,u)}else o=""+a+s}return r+=o},n}(ur),vr=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.isUnitValue=function(){return!1},e}(ur),yr=function(e){function n(t,n){var i;return(i=e.call(this,n)||this).value=void 0,i.operator="invert",i.value=t,i}Yt(n,e),n.create=function(t){return new n(t,sr.negateExponents(t.type_))};var i=n.prototype;return i.clone=function(){return new n(this.value,this.type_)},i.getType=function(){return t.CSSStyleValueType.kInvertType},i.equals=function(e){return e.getType()===t.CSSStyleValueType.kInvertType&&this.value.equals(e.value)},i.sumValue=function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)},i.buildCSSText=function(e,n,i){return n==t.ParenLess.kNo&&(i+=e===t.Nested.kYes?"(":"calc("),i=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+="1 / "),n===t.ParenLess.kNo&&(i+=")"),i},n}(vr),gr=function(e){function n(t,n){var i;return(i=e.call(this,n)||this).value=void 0,i.operator="negate",i.value=t,i}Yt(n,e),n.create=function(t){return new n(t,t.type_)};var i=n.prototype;return i.clone=function(){return new n(this.value,this.type_)},i.getType=function(){return t.CSSStyleValueType.kNegateType},i.equals=function(e){return e.getType()===t.CSSStyleValueType.kNegateType&&this.value.equals(e.value)},i.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},i.buildCSSText=function(e,n,i){return n==t.ParenLess.kNo&&(i+=e===t.Nested.kYes?"(":"calc("),i=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+="-"),n===t.ParenLess.kNo&&(i+=")"),i},n}(vr);function mr(t,e,n){for(var i=t[0].type_,r=1;t.length>r;r++)i=e(i,t[r].type_,false);return i}var Tr,br=function(t){function e(e,n){var i;return(i=t.call(this,n)||this).values=void 0,i.values=e,i}Yt(e,t);var n=e.prototype;return n.numericValues=function(){return this.values},n.equals=function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))},e}(vr),Er=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).operator="min",t}Yt(n,e),n.create=function(t){return new n(t,mr(t,sr.add))};var i=n.prototype;return i.clone=function(){return new n(this.values,this.type_)},i.getType=function(){return t.CSSStyleValueType.kMinType},i.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=te(this.numericValues());!(e=n()).done;){var i=e.value.sumValue();if(!i.length||JSON.stringify(i[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>i[0].value&&(t=i)}return t},i.buildCSSText=function(e,n,i){i+="min(";for(var r,o=!0,a=te(this.numericValues());!(r=a()).done;){o||(i+=", "),o=!1,i=r.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,i)}return i+=")"},n}(br),Sr=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).operator="max",t}Yt(n,e),n.create=function(t){return new n(t,mr(t,sr.add))};var i=n.prototype;return i.clone=function(){return new n(this.values,this.type_)},i.getType=function(){return t.CSSStyleValueType.kMaxType},i.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=te(this.numericValues());!(e=n()).done;){var i=e.value.sumValue();if(!i.length||JSON.stringify(i[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>i[0].value&&(t=i)}return t},i.buildCSSText=function(e,n,i){i+="max(";for(var r,o=!0,a=te(this.numericValues());!(r=a()).done;){o||(i+=", "),o=!1,i=r.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,i)}return i+=")"},n}(br),wr=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).operator="sum",t}Yt(n,e),n.create=function(t){return new n(t,mr(t,sr.add))},n.numericTypeFromUnitMap=function(t){var e=new sr;return Object.keys(t).forEach((function(n){var i=t[n];e=sr.multiply(e,new sr(Number(n),i),false),kn(!0)})),e},n.canCreateNumericTypeFromSumValue=function(t){var e=this;kn(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return sr.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var i=n.prototype;return i.clone=function(){return new n(this.values,this.type_)},i.getType=function(){return t.CSSStyleValueType.kSumType},i.sumValue=function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(qt({},e)):t[n].value+=e.value}))})),n.canCreateNumericTypeFromSumValue(t)?t:null},i.buildCSSText=function(e,n,i){n==t.ParenLess.kNo&&(i+=e===t.Nested.kYes?"(":"calc(");var r=this.numericValues();i=r[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i);for(var o=1;r.length>o;o++){var a=r[o];i=a.getType()===t.CSSStyleValueType.kNegateType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+=" - "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+=" + ")}return n===t.ParenLess.kNo&&(i+=")"),i},n}(br),kr=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).operator="product",t}Yt(n,e),n.create=function(t){return new n(t,mr(t,sr.multiply))},n.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){xn(e[n].value,0);var i=n in t?t[n].value:0;i+e[n].value===0?delete t[n]:t[n]=i+e[n].value})),t};var i=n.prototype;return i.clone=function(){return new n(this.values,this.type_)},i.getType=function(){return t.CSSStyleValueType.kProductType},i.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(e){var i=e.sumValue();if(!i.length)return null;var r=[];t.forEach((function(t){i.forEach((function(e){r.push({value:t.value*e.value,units:n.multiplyUnitMaps(t.units,e.units)})}))})),t=r})),t},i.buildCSSText=function(e,n,i){n==t.ParenLess.kNo&&(i+=e===t.Nested.kYes?"(":"calc(");var r=this.numericValues();i=r[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i);for(var o=1;r.length>o;o++){var a=r[o];i=a.getType()===t.CSSStyleValueType.kInvertType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+=" / "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+=" * ")}return n===t.ParenLess.kNo&&(i+=")"),i},n}(br),Pr=new dr(0,"px"),xr=new dr(0,"deg"),Nr=function(t){function e(e,n,i,r,o){var a;return void 0===r&&(r=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=i,a.alpha=r,a.isNone=o,a}Yt(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(ir);(Tr=t.GradientPatternType||(t.GradientPatternType={}))[Tr.Constant=0]="Constant",Tr[Tr.LinearGradient=1]="LinearGradient",Tr[Tr.RadialGradient=2]="RadialGradient",Tr[Tr.Pattern=3]="Pattern";var Cr=function(e){function n(t,n){var i;return(i=e.call(this)||this).type=void 0,i.value=void 0,i.type=t,i.value=n,i}Yt(n,e);var i=n.prototype;return i.clone=function(){return new n(this.type,this.value)},i.buildCSSText=function(e,n,i){var r="";return this.type===t.GradientPatternType.LinearGradient?r="linear-gradient("+this.value.steps.map((function(t){return t.join(",")})).join(",")+")":this.type===t.GradientPatternType.RadialGradient?r="radial-gradient("+this.value.steps.map((function(t){return t.join(",")})).join(",")+")":this.type===t.GradientPatternType.Pattern&&(r="url("+this.value.src+")"),i+r},i.getType=function(){return t.CSSStyleValueType.kColorType},n}(nr);function _r(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ar(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Mr(){}var Or=.7,Ir=1/Or,Rr="\\s*([+-]?\\d+)\\s*",Lr="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dr="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ur=/^#([0-9a-f]{3,8})$/,Fr=new RegExp("^rgb\\("+[Rr,Rr,Rr]+"\\)$"),Br=new RegExp("^rgb\\("+[Dr,Dr,Dr]+"\\)$"),Vr=new RegExp("^rgba\\("+[Rr,Rr,Rr,Lr]+"\\)$"),Gr=new RegExp("^rgba\\("+[Dr,Dr,Dr,Lr]+"\\)$"),jr=new RegExp("^hsl\\("+[Lr,Dr,Dr]+"\\)$"),Hr=new RegExp("^hsla\\("+[Lr,Dr,Dr,Lr]+"\\)$"),zr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Wr(){return this.rgb().formatHex()}function qr(){return this.rgb().formatRgb()}function Yr(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ur.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Xr(e):3===n?new Jr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Kr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Kr(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Fr.exec(t))?new Jr(e[1],e[2],e[3],1):(e=Br.exec(t))?new Jr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Vr.exec(t))?Kr(e[1],e[2],e[3],e[4]):(e=Gr.exec(t))?Kr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=jr.exec(t))?eo(e[1],e[2]/100,e[3]/100,1):(e=Hr.exec(t))?eo(e[1],e[2]/100,e[3]/100,e[4]):zr.hasOwnProperty(t)?Xr(zr[t]):"transparent"===t?new Jr(NaN,NaN,NaN,0):null}function Xr(t){return new Jr(t>>16&255,t>>8&255,255&t,1)}function Kr(t,e,n,i){return i>0||(t=e=n=NaN),new Jr(t,e,n,i)}function Zr(t){return t instanceof Mr||(t=Yr(t)),t?new Jr((t=t.rgb()).r,t.g,t.b,t.opacity):new Jr}function Jr(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Qr(){return"#"+to(this.r)+to(this.g)+to(this.b)}function $r(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function to(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function eo(t,e,n,i){return i>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new io(t,e,n,i)}function no(t){if(t instanceof io)return new io(t.h,t.s,t.l,t.opacity);if(t instanceof Mr||(t=Yr(t)),!t)return new io;if(t instanceof io)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,u=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(i>n):n===o?(i-e)/s+2:(e-n)/s+4,s/=.5>u?o+r:2-o-r,a*=60):s=u>0&&1>u?0:a,new io(a,s,u,t.opacity)}function io(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function ro(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}_r(Mr,Yr,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Wr,formatHex:Wr,formatHsl:function(){return no(this).formatHsl()},formatRgb:qr,toString:qr}),_r(Jr,(function(t,e,n,i){return 1===arguments.length?Zr(t):new Jr(t,e,n,null==i?1:i)}),Ar(Mr,{brighter:function(t){return t=null==t?Ir:Math.pow(Ir,t),new Jr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Or:Math.pow(Or,t),new Jr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Qr,formatHex:Qr,formatRgb:$r,toString:$r})),_r(io,(function(t,e,n,i){return 1===arguments.length?no(t):new io(t,e,n,null==i?1:i)}),Ar(Mr,{brighter:function(t){return t=null==t?Ir:Math.pow(Ir,t),new io(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Or:Math.pow(Or,t),new io(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(.5>n?n:1-n)*e,r=2*n-i;return new Jr(ro(240>t?t+120:t-240,r,i),ro(t,r,i),ro(120>t?t+240:t-120,r,i),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var oo=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ao=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,so=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,uo=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function co(e){if(Cn(e)&&(e=""),"transparent"===e)return new Nr(0,0,0,0);"currentColor"===e&&(e="black");var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var i=function(t){var e=oo.exec(t);if(e){var n,i,r,o=parseFloat(e[1])%360*(Math.PI/180),a=(null===(n=e[2].match(uo))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[],s=1,u=1,c=0,l=0;o>=0&&o<.5*Math.PI?(i={x:c,y:l},r={x:s,y:u}):.5*Math.PI<=o&&o<Math.PI?(i={x:s,y:l},r={x:c,y:u}):Math.PI<=o&&o<1.5*Math.PI?(i={x:s,y:u},r={x:c,y:l}):(i={x:c,y:u},r={x:s,y:l});var h=Math.tan(o),p=h*h;return{x0:i.x,y0:i.y,x1:(r.x-i.x+h*(r.y-i.y))/(p+1)+i.x,y1:h*(r.x-i.x+h*(r.y-i.y))/(p+1)+i.y,steps:a,hash:t}}return null}(e);if(i)return new Cr(t.GradientPatternType.LinearGradient,i)}else if("r"===n){var r=function(t){var e=ao.exec(t);if(e){var n,i=parseFloat(e[1]),r=parseFloat(e[2]),o=parseFloat(e[3]),a=(null===(n=e[4].match(uo))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];if(0===o){var s=e[4].match(uo);return s[s.length-1].split(":")[1]}return{x0:i,y0:r,r0:0,x1:.5,y1:.5,r1:o,steps:a,hash:t}}return null}(e);if(r){if(!Iu(r))return new Cr(t.GradientPatternType.RadialGradient,r);e=r}}else if("p"===n){var o=function(t){var e=so.exec(t);if(e){var n=e[1],i=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{src:i,repetition:n,hash:t}}return null}(e);if(o)return new Cr(t.GradientPatternType.Pattern,o)}var a=Yr(e),s=[0,0,0,0];return null!==a&&(s[0]=a.r||0,s[1]=a.g||0,s[2]=a.b||0,s[3]=a.opacity),Zt(Nr,s)}function lo(t,e){if(t instanceof Nr&&e instanceof Nr)return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(Wn(e[n],0,255));return e[3]=Wn(e[3],0,1),"rgba("+e.join(",")+")"}]}function ho(t,e){if(Cn(e))return new dr(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))&&"px".search(t)>=0)return new dr(Number(e),"px");var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var i="U("+t.source+")";return n.map((function(t){return new dr(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(i,"g"),"*0")),t)}))[0]}var po=ho.bind(null,new RegExp("px","g")),fo=ho.bind(null,new RegExp("%","g")),vo=ho.bind(null,new RegExp("px|%|em|rem","g")),yo=ho.bind(null,new RegExp("deg|rad|grad|turn","g"));function go(t,e,n,i,r){void 0===r&&(r=0);var o="",a=t.value||0,s=e.value||0;return(dr.isLength(t.unit)||dr.isLength(e.unit))&&(a=Eo(t,r,n),s=Eo(e,r,n),o="px"),(dr.isAngle(t.unit)||dr.isAngle(e.unit))&&(a=mo(t),s=mo(e),o="deg"),[a,s,function(t){return i&&(t=Math.max(t,0)),t+o}]}function mo(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Xn(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=Kn(Number(e.value))),n}function To(t){return Iu(t)?t.split(" ").map((function(t){return vo(t)})):t.map((function(t){return vo(t.toString())}))}function bo(t,e,n){if(t.length===e.length){var i=t[0].unit;return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t.map((function(t){return new dr(t,i)})).join(" ")}]}}function Eo(e,n,i){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&i){var r=i.getGeometryBounds(),o=0;return hn.isEmpty(r)||(o=2*r.halfExtents[n]),Number(e.value)/100*o}return 0}function So(t){return t.toString()}function wo(t){return"number"==typeof t?new dr(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?new dr(Number(t)):new dr(0)}function ko(t,e){return[t.value,e.value,So]}function Po(t,e){return function(n,i){return[n.value,i.value,function(n){return So(Wn(n,t,e))}]}}function xo(t,e,n,i){var r=t-n,o=e-i;return Math.sqrt(r*r+o*o)}function No(t,e){return.001>Math.abs(t-e)}function Co(t,e){var n=Math.min.apply(Math,t),i=Math.min.apply(Math,e);return{x:n,y:i,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-i}}var _o={box:function(t,e,n,i){return Co([t,n],[e,i])},length:function(t,e,n,i){return xo(t,e,n,i)},pointAt:function(t,e,n,i,r){return{x:(1-r)*t+r*n,y:(1-r)*e+r*i}},pointDistance:function(t,e,n,i,r,o){var a=(n-t)*(r-t)+(i-e)*(o-e);return 0>a?xo(t,e,r,o):a>(n-t)*(n-t)+(i-e)*(i-e)?xo(n,i,r,o):this.pointToLine(t,e,n,i,r,o)},pointToLine:function(t,e,n,i,r,o){var a=[n-t,i-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((r-t)*(r-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],i=e[1],r=n*n+i*i;r>0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([r-t,o-e],s))},tangentAngle:function(t,e,n,i){return Math.atan2(i-e,n-t)}};function Ao(t,e,n,i,r){var o=1-r;return o*o*o*t+3*e*r*o*o+3*n*r*r*o+i*r*r*r}function Mo(t,e,n,i,r){var o=1-r;return 3*(o*o*(e-t)+2*o*r*(n-e)+r*r*(i-n))}function Oo(t,e,n,i){var r,o,a,s=-3*t+9*e-9*n+3*i,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(No(s,0))No(u,0)||0>(r=-c/u)||r>1||l.push(r);else{var h=u*u-4*s*c;No(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(r=(-u+a)/(2*s))||r>1||l.push(r),0>o||o>1||l.push(o))}return l}function Io(t,e,n,i,r,o,a,s,u){var c=Ao(t,n,r,a,u),l=Ao(e,i,o,s,u),h=_o.pointAt(t,e,n,i,u),p=_o.pointAt(n,i,r,o,u),f=_o.pointAt(r,o,a,s,u),d=_o.pointAt(h.x,h.y,p.x,p.y,u),v=_o.pointAt(p.x,p.y,f.x,f.y,u);return[[t,e,h.x,h.y,d.x,d.y,c,l],[c,l,v.x,v.y,f.x,f.y,a,s]]}function Ro(t,e,n,i,r,o,a,s,u){if(0===u)return function(t,e){for(var n=0,i=t.length,r=0;i>r;r++)n+=xo(t[r],e[r],t[(r+1)%i],e[(r+1)%i]);return n/2}([t,n,r,a],[e,i,o,s]);var c=Io(t,e,n,i,r,o,a,s,.5),l=[].concat(c[0],[u-1]),h=[].concat(c[1],[u-1]);return Ro.apply(void 0,l)+Ro.apply(void 0,h)}var Lo={extrema:Oo,box:function(t,e,n,i,r,o,a,s){for(var u=[t,a],c=[e,s],l=Oo(t,n,r,a),h=Oo(e,i,o,s),p=0;l.length>p;p++)u.push(Ao(t,n,r,a,l[p]));for(var f=0;h.length>f;f++)c.push(Ao(e,i,o,s,h[f]));return Co(u,c)},length:function(t,e,n,i,r,o,a,s){return Ro(t,e,n,i,r,o,a,s,3)},nearestPoint:function(t,e,n,i,r,o,a,s,u,c,l){return function(t,e,n,i,r,o){var a=-1,s=1/0,u=[n,i],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,p=0;c>=p;p++){var f=p*l,d=[r.apply(void 0,t.concat([f])),r.apply(void 0,e.concat([f]))],v=xo(u[0],u[1],d[0],d[1]);s>v&&(a=f,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}s=1/0;for(var g=0;32>g&&h>=1e-4;g++){var m=a-h,T=a+h,b=[r.apply(void 0,t.concat([m])),r.apply(void 0,e.concat([m]))],E=xo(u[0],u[1],b[0],b[1]);if(m>=0&&s>E)a=m,s=E;else{var S=[r.apply(void 0,t.concat([T])),r.apply(void 0,e.concat([T]))],w=xo(u[0],u[1],S[0],S[1]);1>=T&&s>w?(a=T,s=w):h*=.5}}return{x:r.apply(void 0,t.concat([a])),y:r.apply(void 0,e.concat([a]))}}([t,n,r,a],[e,i,o,s],u,c,Ao,l)},pointDistance:function(t,e,n,i,r,o,a,s,u,c,l){var h=this.nearestPoint(t,e,n,i,r,o,a,s,u,c,l);return xo(h.x,h.y,u,c)},interpolationAt:Ao,pointAt:function(t,e,n,i,r,o,a,s,u){return{x:Ao(t,n,r,a,u),y:Ao(e,i,o,s,u)}},divide:function(t,e,n,i,r,o,a,s,u){return Io(t,e,n,i,r,o,a,s,u)},tangentAngle:function(t,e,n,i,r,o,a,s,u){var c=Mo(t,n,r,a,u),l=Mo(e,i,o,s,u);return(Math.atan2(l,c)+2*Math.PI)%(2*Math.PI)}};var Do=function(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var i=t[n],r=t[n+1];e+=xo(i[0],i[1],r[0],r[1])}return e}(t)},Uo=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,Fo=/[^\s,]+/gi;var Bo=new RegExp("([a-z])[\\s,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\s]*,?[\\s]*)+)","ig"),Vo=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\\s]*,?[\\s]*","ig");var Go=/[a-z]/;function jo(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Ho(t){var e=function(t){if("string"==typeof t){if(t){var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return t.replace(Bo,(function(t,i,r){var o=[],a=i.toLowerCase();if(r.replace(Vo,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([i].concat(o.splice(0,2))),a="l",i="m"===i?"l":"L"),"o"===a&&1===o.length&&n.push([i,o[0]]),"r"===a)n.push([i].concat(o));else for(;o.length>=e[a]&&(n.push([i].concat(o.splice(0,e[a]))),e[a]););return""})),n}return null}if(Array.isArray(t))return t}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,i=0;e.length>i;i++){if(Go.test(p=e[i][0])||["V","H","T","S"].indexOf(p)>=0){n=!0;break}}if(!n)return e;var r=[],o=0,a=0,s=0,u=0,c=0,l=e[0];"M"!==l[0]&&"m"!==l[0]||(s=o=+l[1],u=a=+l[2],c++,r[0]=["M",o,a]);i=c;for(var h=e.length;h>i;i++){var p,f=e[i],d=r[i-1],v=[],y=(p=f[0]).toUpperCase();if(p!==y)switch(v[0]=y,y){case"A":v[1]=f[1],v[2]=f[2],v[3]=f[3],v[4]=f[4],v[5]=f[5],v[6]=+f[6]+o,v[7]=+f[7]+a;break;case"V":v[1]=+f[1]+a;break;case"H":v[1]=+f[1]+o;break;case"M":u=+f[2]+a,v[1]=s=+f[1]+o,v[2]=u;break;default:for(var g=1,m=f.length;m>g;g++)v[g]=+f[g]+(g%2?o:a)}else v=e[i];switch(y){case"Z":o=+s,a=+u;break;case"H":v=["L",o=v[1],a];break;case"V":v=["L",o,a=v[1]];break;case"T":o=v[1],a=v[2];var T=jo([d[1],d[2]],[d[3],d[4]]);v=["Q",T[0],T[1],o,a];break;case"S":o=v[v.length-2],a=v[v.length-1];var b=d.length,E=jo([d[b-4],d[b-3]],[d[b-2],d[b-1]]);v=["C",E[0],E[1],v[1],v[2],o,a];break;case"M":s=v[v.length-2],u=v[v.length-1];break;default:o=v[v.length-2],a=v[v.length-1]}r.push(v)}return r}var zo=2*Math.PI,Wo=function(t,e,n,i,r,o,a){var s=t.x,u=t.y;return{x:i*(s*=e)-r*(u*=n)+o,y:r*s+i*u+a}},qo=function(t,e){var n=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),i=Math.cos(t),r=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:i-r*n,y:r+i*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},Yo=function(t,e,n,i){var r=t*n+e*i;return r>1&&(r=1),-1>r&&(r=-1),(0>t*i-e*n?-1:1)*Math.acos(r)},Xo=function(t){var e=t.px,n=t.py,i=t.cx,r=t.cy,o=t.rx,a=t.ry,s=t.xAxisRotation,u=void 0===s?0:s,c=t.largeArcFlag,l=void 0===c?0:c,h=t.sweepFlag,p=void 0===h?0:h,f=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:i,y:r}];var d=Math.sin(u*zo/360),v=Math.cos(u*zo/360),y=v*(e-i)/2+d*(n-r)/2,g=-d*(e-i)/2+v*(n-r)/2;if(0===y&&0===g)return[{x1:0,y1:0,x2:0,y2:0,x:i,y:r}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(y,2)/Math.pow(o,2)+Math.pow(g,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var T=function(t,e,n,i,r,o,a,s,u,c,l,h){var p=Math.pow(r,2),f=Math.pow(o,2),d=Math.pow(l,2),v=Math.pow(h,2),y=p*f-p*v-f*d;0>y&&(y=0),y/=p*v+f*d;var g=(y=Math.sqrt(y)*(a===s?-1:1))*r/o*h,m=y*-o/r*l,T=c*g-u*m+(t+n)/2,b=u*g+c*m+(e+i)/2,E=(l-g)/r,S=(h-m)/o,w=(-l-g)/r,k=(-h-m)/o,P=Yo(1,0,E,S),x=Yo(E,S,w,k);return 0===s&&x>0&&(x-=zo),1===s&&0>x&&(x+=zo),[T,b,P,x]}(e,n,i,r,o,a,l,p,d,v,y,g),b=T[0],E=T[1],S=T[2],w=T[3],k=Math.abs(w)/(zo/4);1e-7>Math.abs(1-k)&&(k=1);var P=Math.max(Math.ceil(k),1);w/=P;for(var x=0;P>x;x++)f.push(qo(S,w)),S+=w;return f.map((function(t){var e=Wo(t[0],o,a,v,d,b,E),n=e.x,i=e.y,r=Wo(t[1],o,a,v,d,b,E),s=r.x,u=r.y,c=Wo(t[2],o,a,v,d,b,E);return{x1:n,y1:i,x2:s,y2:u,x:c.x,y:c.y}}))};function Ko(t,e,n,i,r,o,a,s,u){return Xo({px:t,py:e,cx:s,cy:u,rx:n,ry:i,xAxisRotation:r,largeArcFlag:o,sweepFlag:a}).reduce((function(t,e){return t.push(e.x1,e.y1,e.x2,e.y2,e.x,e.y),t}),[])}function Zo(t,e,n,i,r,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*i,a*r+s*n,a*o+s*i,r,o]}function Jo(t,e,n,i){return[t,e,n,i,n,i]}function Qo(t,e){0>"TQ".indexOf(t[0])&&(e.qx=null,e.qy=null);var n=t.slice(1),i=n[0],r=n[1];switch(t[0]){case"M":return e.x=i,e.y=r,t;case"A":return["C"].concat(Ko.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=i,e.qy=r,["C"].concat(Zo.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Jo(e.x1,e.y1,t[1],t[2]));case"H":return["C"].concat(Jo(e.x1,e.y1,t[1],e.y1));case"V":return["C"].concat(Jo(e.x1,e.y1,e.x1,t[1]));case"Z":return["C"].concat(Jo(e.x1,e.y1,e.x,e.y))}return t}function $o(t,e,n){if(t[n].length>7){t[n].shift();for(var i=t[n],r=n;i.length;)e[n]="A",t.splice(r+=1,0,["C"].concat(i.splice(0,6)));t.splice(n,1)}}var ta=Math.PI/180;function ea(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function na(t,e){return ea(t)*ea(e)?(t[0]*e[0]+t[1]*e[1])/(ea(t)*ea(e)):1}function ia(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(na(t,e))}function ra(t,e){return t[0]===e[0]&&t[1]===e[1]}function oa(t,e){var n,i=e[1],r=e[2],o=(n=2*Math.PI,(ta*e[3]%n+n)%n),a=e[4],s=e[5],u=t[0],c=t[1],l=e[6],h=e[7],p=Math.cos(o)*(u-l)/2+Math.sin(o)*(c-h)/2,f=-1*Math.sin(o)*(u-l)/2+Math.cos(o)*(c-h)/2,d=p*p/(i*i)+f*f/(r*r);d>1&&(i*=Math.sqrt(d),r*=Math.sqrt(d));var v=i*i*(f*f)+r*r*(p*p),y=v?Math.sqrt((i*i*(r*r)-v)/v):1;a===s&&(y*=-1),isNaN(y)&&(y=0);var g=r?y*i*f/r:0,m=i?y*-r*p/i:0,T=(u+l)/2+Math.cos(o)*g-Math.sin(o)*m,b=(c+h)/2+Math.sin(o)*g+Math.cos(o)*m,E=[(p-g)/i,(f-m)/r],S=[(-1*p-g)/i,(-1*f-m)/r],w=ia([1,0],E),k=ia(E,S);return na(E,S)>-1||(k=Math.PI),1>na(E,S)||(k=0),0===s&&k>0&&(k-=2*Math.PI),1===s&&0>k&&(k+=2*Math.PI),{cx:T,cy:b,rx:ra(t,[l,h])?0:i,ry:ra(t,[l,h])?0:r,startAngle:w,endAngle:w+k,xRotation:o,arcFlag:a,sweepFlag:s}}function aa(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function sa(t){t=function(t){var e=t||[];return Array.isArray(e)?e:"string"==typeof e?((e=e.match(Uo)).forEach((function(t,n){if((t=t.match(Fo))[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}t.forEach((function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0}(t);for(var e=[],n=null,i=null,r=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];i=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":r=[u[1],u[2]],o=s;break;case"A":var h=oa(n,u);l.arcParams=h}if("Z"===c)n=r,i=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}i&&"Z"===i[0]&&(i=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&ra(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=i?[i[i.length-2],i[i.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c){l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===c){var d=aa((y=e[s-1]).currentPoint,f);"Q"===y.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var v=[u[3],u[4]];l.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],l.endTangent=[n[0]-v[0],n[1]-v[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-v[0],g[1]-v[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[v[0]-g[0],v[1]-g[1]])}else if("S"===c){var y,g=aa((y=e[s-1]).currentPoint,f);v=[u[1],u[2]];"C"===y.command?(l.command="C",l.startTangent=[f[0]-g[0],f[1]-g[1]],l.endTangent=[n[0]-v[0],n[1]-v[1]]):(l.command="SQ",l.startTangent=[f[0]-v[0],f[1]-v[1]],l.endTangent=[n[0]-v[0],n[1]-v[1]])}else if("A"===c){var m=.001,T=l.arcParams||{},b=T.cx,E=void 0===b?0:b,S=T.cy,w=void 0===S?0:S,k=T.rx,P=void 0===k?0:k,x=T.ry,N=void 0===x?0:x,C=T.sweepFlag,_=T.startAngle,A=void 0===_?0:_,M=T.endAngle,O=void 0===M?0:M;0===(void 0===C?0:C)&&(m*=-1);var I=P*Math.cos(A-m)+E,R=N*Math.sin(A-m)+w;l.startTangent=[I-r[0],R-r[1]];var L=P*Math.cos(A+O+m)+E,D=N*Math.sin(A+O-m)+w;l.endTangent=[f[0]-L,f[1]-D]}e.push(l)}return e}function ua(t,e,n){var i=t[0],r=t[1];return[i+(e[0]-i)*n,r+(e[1]-r)*n]}function ca(t){return t.map((function(t,e,n){var i=e&&n[e-1].slice(-2).concat(t.slice(1)),r=e?Lo.length.apply(Lo,i):0;return{s:t,ss:e?r?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),i=t.slice(2,4),r=t.slice(4,6),o=t.slice(6,8),a=ua(n,i,e),s=ua(i,r,e),u=ua(r,o,e),c=ua(a,s,e),l=ua(s,u,e),h=ua(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(i):[t,t]:[t],l:r}}))}function la(t,e,n){var i=ca(t),r=ca(e),o=i.length,a=r.length,s=i.filter((function(t){return t.l})).length,u=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,v=[i,r].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:la(v[0],v[1],h)}function ha(t){return fa(t)>=0}function pa(t,e,n,i,r,o,a,s){return 3*((s-e)*(n+r)-(a-t)*(i+o)+i*(t-r)-n*(e-o)+s*(r+t/3)-a*(o+e/3))/20}function fa(t){var e=0,n=0,i=0,r=0,o=0;return t.map((function(t){switch(t[0]){case"M":case"Z":return e=i="M"===t[0]?t[1]:i,n=r="M"===t[0]?t[2]:r,0;default:o=pa.apply(0,[e,n].concat(t.slice(1)));var a=t.slice(-2);return e=a[0],n=a[1],o}})).reduce((function(t,e){return t+e}),0)}function da(t){var e=t.slice(1).map((function(e,n,i){return n?i[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))}function va(t){return t.map((function(t){return Array.isArray(t)?va(t):Number.isNaN(+t)?t:+t}))}function ya(t,e){var n=t.length-1,i=[],r=0,o=function(t){var e=t.length,n=e-1;return t.map((function(i,r){return t.map((function(i,o){var a=r+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(i,o){r+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),i[a]=r,r=0})),o[i.indexOf(Math.min.apply(null,i))]}function ga(t,e,n,i){var r=(-1+Math.sqrt(2))/3*4,o=t*r,a=e*r,s=n-t,u=n+t,c=i-e,l=i+e;return[["M",s,i],["C",s,i-a,n-o,c,n,c],["C",n+o,c,u,i-a,u,i],["C",u,i+a,n+o,l,n,l],["C",n-o,l,s,i+a,s,i],["Z"]]}function ma(t,e){var n=Ho(t),i=function(t){for(var e=!1,n=t.length,i=0;n>i;i++){var r=t[i][0];if("C"===r||"A"===r||"Q"===r){e=!0;break}}return e}(n),r=n.slice(),o=function(t){for(var e=[],n=[],i=[],r=0;t.length>r;r++){var o=t[r],a=o[0];"M"===a?(i.length&&(n.push(i),i=[]),i.push([o[1],o[2]])):"Z"===a?i.length&&(e.push(i),i=[]):i.push([o[1],o[2]])}i.length>0&&n.push(i);return{polygons:e,polylines:n}}(r),a=o.polygons,s=o.polylines,u=function(t,e){void 0===e&&(e=!1);for(var n,i,r=Ho(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",u=r.length,c=[],l=0;u>l;l+=1)r[l]&&(s=r[l][0]),a[l]=s,r[l]=Qo(r[l],o),$o(r,a,l),u=r.length,"Z"===s&&c.push(l),o.x1=+(n=r[l])[(i=n.length)-2],o.y1=+n[i-1],o.x2=+n[i-4]||o.x1,o.y2=+n[i-3]||o.y1;return e?[r,c]:r}(r,!0),c=u[0],l=u[1],h=sa(r),p=function(t){var e,n,i,r,o=0,a=0,s=[];if(!t)return{curveSegments:[],totalLength:o};if(t.forEach((function(e,n){r=e.length,(i=t[n+1])&&(o+=Lo.length(e[r-2],e[r-1],i[1],i[2],i[3],i[4],i[5],i[6])||0)})),0===o)return{curveSegments:[],totalLength:o};return t.forEach((function(u,c){r=u.length,(i=t[c+1])&&((e=[])[0]=a/o,n=Lo.length(u[r-2],u[r-1],i[1],i[2],i[3],i[4],i[5],i[6]),e[1]=(a+=n||0)/o,s.push(e))})),{curveSegments:s,totalLength:o}}(c),f=p.totalLength,d=p.curveSegments,v=function(t){var e=0,n=0,i=[],r=[];t.forEach((function(t){var o=t.slice(-2),a=o[0],s=o[1];if("M"===t[0])e=a,n=s,i.push(a),r.push(s);else if("C"===t[0]){var u=Lo.box.apply(Lo,[e,n].concat(t.slice(1)));i=i.concat(u.x,u.x+u.width),r=r.concat(u.y,u.y+u.height),e=a,n=s}}));var o=Math.min.apply(0,i),a=Math.min.apply(0,r),s=Math.max.apply(0,i),u=Math.max.apply(0,r);return new wn(o,a,s-o,u-a)}(c);return e&&(e.parsedStyle.defX=v.x,e.parsedStyle.defY=v.y),{absolutePath:n,hasArc:i,segments:h,polygons:a,polylines:s,curve:c,totalLength:f,curveSegments:d,zCommandIndexes:l,rect:v}}function Ta(t,e,n){var i=t.curve,r=e.curve,o=[i,r];i.length!==r.length&&(o=la(i,r));var a=ha(o[0])!==ha(o[1])?da(o[0]):va(o[0]);return[a,ya(o[1],a),function(t){return t}]}function ba(t,e){var n;n=Iu(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var i,r,o=[],a=0,s=Do(n);n.forEach((function(t,e){n[e+1]&&((i=[0,0])[0]=a/s,r=_o.length(t[0],t[1],n[e+1][0],n[e+1][1]),i[1]=(a+=r)/s,o.push(i))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}var Ea,Sa,wa,ka,Pa=ho.bind(null,/deg|rad|grad|turn|px|%/g),xa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Na(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,i=[],r=0;e=n.exec(t);){if(e.index!==r)return[];if(r=e.index+e[0].length,xa.indexOf(e[1])>-1&&i.push({name:e[1],params:e[2].split(" ").map((function(t){return Pa(t)||co(t)}))}),n.lastIndex===t.length)return i}return[]}(Ea=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",Ea.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(Sa||(Sa={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(wa||(wa={})),(ka=t.PropertyName||(t.PropertyName={})).LAYOUT="display",ka.LEFT="left",ka.TOP="top",ka.BOTTOM="bottom",ka.RIGHT="right",ka.WIDTH="width",ka.HEIGHT="height",ka.MIN_WIDTH="minWidth",ka.MAX_WIDTH="maxWidth",ka.MIN_HEIGHT="minHeight",ka.MAX_HEIGHT="maxHeight",ka.BOX_SIZING="boxSizing",ka.PADDING="padding",ka.PADDING_TOP="paddingTop",ka.PADDING_BOTTOM="paddingBottom",ka.PADDING_START="paddingLeft",ka.PADDING_END="paddingRight",ka.MARGIN="margin",ka.MARGIN_TOP="marginTop",ka.MARGIN_BOTTOM="marginBottom",ka.MARGIN_START="marginLeft",ka.MARGIN_END="marginRight",ka.BORDER="border",ka.BORDER_TOP="borderTop",ka.BORDER_BOTTOM="borderBottom",ka.BORDER_START="borderLeft",ka.BORDER_END="borderRight",ka.FLEX_DIRECTION="flexDirection",ka.FLEX_WRAP="flexWrap",ka.FLEX_FLOW="flexFlow",ka.ALIGN_ITEMS="alignItems",ka.ALIGN_CONTENT="alignContent",ka.JUSTIFY_CONTENT="justifyContent",ka.FLEX="flex",ka.ALIGN_SELF="alignSelf",ka.FLEX_SHRINK="flexShrink",ka.FLEX_BASIS="flexBasis",ka.FLEX_GROW="flexGrow",ka.OFFSET_WIDTH="offsetWidth",ka.OFFSET_HEIGHT="offsetHeight",ka.ORDER="order";var Ca=1,_a=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=Ca++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return i.forEach((function(n){var i=t.style.get(n);i&&e.set(n,i)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,i,r;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(i=null===(r=this.style.get(t.PropertyName.HEIGHT))||void 0===r?void 0:r.value)&&void 0!==i?i:0}},n.computeLayout=function(){var t=Ht(Gt().mark((function t(){var e;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,vl.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},Wt(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),Aa=r.defineToken("LayoutContextFactory"),Ma=r.defineToken("LayoutContextOptions"),Oa=0;t.LayoutContext=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+Oa++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),t.LayoutContext=ie([lt(),re(0,ht(Ma)),oe("design:paramtypes",[Object])],t.LayoutContext);var Ia=r.defineToken("FragmentResultFactory"),Ra=r.defineToken("FragmentResultOptions"),La=r.defineToken("contextNode");t.FragmentResult=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e},t.FragmentResult=ie([ct(),re(0,ht(t.LayoutContext)),re(1,ht(La)),re(2,ht(Ra)),oe("design:paramtypes",[t.LayoutContext,_a,Object])],t.FragmentResult);var Da=r.defineToken("LayoutChildrenFactory"),Ua=r.defineToken("LayoutChildrenOptions");t.LayoutChildren=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new Ei;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw new Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new Ei;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),t.LayoutChildren=ie([ct(),re(0,ht(t.LayoutContext)),re(1,ht(Ua)),oe("design:paramtypes",[t.LayoutContext,Object])],t.LayoutChildren);var Fa=function(){};Fa.inputProperties=void 0,Fa.childrenInputProperties=void 0,Fa.layoutOptions=void 0;var Ba,Va,Ga=r.defineToken("LayoutEdgesFactory"),ja=r.defineToken("LayoutEdgesOptions"),Ha=[0,0,0,0];t.LayoutEdges=function(e){var n,i,r,o,a,s,u,c,l,h,p,f,d,v,y,g;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var m=e.node.getAllStyle(),T=null!==(n=null===(i=m.get(t.PropertyName.PADDING_TOP))||void 0===i?void 0:i.value)&&void 0!==n?n:0,b=null!==(r=null===(o=m.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==r?r:0,E=null!==(a=null===(s=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,S=null!==(u=null===(c=m.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,w=null!==(l=null===(h=m.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,k=null!==(p=null===(f=m.get(t.PropertyName.PADDING_END))||void 0===f?void 0:f.value)&&void 0!==p?p:0,P=null!==(d=null===(v=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===v?void 0:v.value)&&void 0!==d?d:0,x=null!==(y=null===(g=m.get(t.PropertyName.PADDING_START))||void 0===g?void 0:g.value)&&void 0!==y?y:0;this.blockStart=T+Ha[0]+w,this.inlineStart=b+Ha[1]+k,this.blockEnd=E+Ha[2]+P,this.inlineEnd=S+Ha[3]+x,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEdges=ie([ct(),re(0,ht(ja)),oe("design:paramtypes",[Object])],t.LayoutEdges),t.LayoutRegistry=((Ba=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw new Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(t,e){if(""===t)throw new TypeError("layout name cant't be empty");if(Va.reservedLayout.includes(t))throw new Error("layout name '"+t+"' is a system reserved layout name, please use another name");if(this.hasLayout(t))throw new Error("layout '"+t+"' already exist.");this.registry.set(t,e)},e.deleteLayout=function(t){this.registry.delete(t)},Wt(t,[{key:"size",get:function(){return this.registry.size}}]),t}()).reservedLayout=[],Va=Ba),t.LayoutRegistry=Va=ie([lt()],t.LayoutRegistry);var za=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))};t.LayoutEngine=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=Ht(Gt().mark((function t(e,n){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=Ht(Gt().mark((function t(e){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw new Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=Ht(Gt().mark((function t(e,n){var i;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(i,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=Ht(Gt().mark((function e(n,i,r){var o,a,s,u,c,l,h,p,f,d,v;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],r.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:i}),p=i.getStyle.apply(i,c),f=a.intrinsicSizes(l,h,p),(d=this.runWorkQueue(f,s.workQueue)).next(),e.next=13,za();case 13:v=d.next().value,s.clearWorkQueue(),i.setIntrisicSizes(v);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,i){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=Ht(Gt().mark((function t(e,n,i){var r;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(r,e,n,i);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=Ht(Gt().mark((function e(n,i,r,o){var a,s,u,c,l,h,p,f,d,v,y,g,m;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],r.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),p=this.layoutEdgesFactory({node:i}),f=i.getStyle.apply(i,l),d=s.layout(h,p,o,f),(v=this.runWorkQueue(d,u.workQueue)).next(),e.next=13,za();case 13:y=v.next().value,u.clearWorkQueue(),g=y instanceof t.FragmentResult?y:u.fragmentResultFactory(y),m=u.layoutFragmentFactory({inlineSize:g.inlineSize,blockSize:g.blockSize,data:g.data}),i.setComputedLayout(m),r.forEach((function(t,e){t.setComputedLayout(g.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,i,r){return e.apply(this,arguments)}}(),n.runWorkQueue=Gt().mark((function e(n,i){var r,o=this;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=bi(n),i.length>0&&r.isPending()&&i.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,i=e.deferred,r=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);i.resolve(r.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(r.isFulfilled()){e.next=6;break}throw new Error("promise not fullfilled!");case 6:return e.abrupt("return",r.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,i,r,o,a,s,u,c,l,h,p,f,d=e.getAllStyle();return{minContentInlineSize:(null===(n=d.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(i=e.intrisicSizes)||void 0===i?void 0:i.minContentInlineSize)||(null===(r=d.get(t.PropertyName.WIDTH))||void 0===r?void 0:r.value)||0,maxContentInlineSize:(null===(o=d.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=d.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=d.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=d.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=d.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(p=e.intrisicSizes)||void 0===p?void 0:p.maxContentBlockSize)||(null===(f=d.get(t.PropertyName.HEIGHT))||void 0===f?void 0:f.value)||0}},n.getNodeFragment=function(e,n){var i,r,o,a,s,u;return{inlineSize:(null===(i=e.getComputedLayout())||void 0===i?void 0:i.inlineSize)||(null===(r=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===r?void 0:r.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),t.LayoutEngine=ie([lt(),re(0,ht(t.LayoutRegistry)),re(1,ht(Aa)),re(2,ht(Ga)),oe("design:paramtypes",[t.LayoutRegistry,Function,Function])],t.LayoutEngine);var Wa=r.defineToken("LayoutFragmentFactory"),qa=r.defineToken("LayoutFragmentOptions");t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutFragment=ie([ct(),re(0,ht(t.LayoutContext)),re(1,ht(qa)),oe("design:paramtypes",[t.LayoutContext,Object])],t.LayoutFragment);var Ya={number:function(t){return new dr(t)},percent:function(t){return new dr(t,"%")},px:function(t){return new dr(t,"px")},em:function(t){return new dr(t,"em")},rem:function(t){return new dr(t,"rem")},deg:function(t){return new dr(t,"deg")},grad:function(t){return new dr(t,"grad")},rad:function(t){return new dr(t,"rad")},turn:function(t){return new dr(t,"turn")},s:function(t){return new dr(t,"s")},ms:function(t){return new dr(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,i=t.interpolable,r=t.initialValue,o=t.syntax;Ut.get(xi).registerMetadata({name:e,inherited:n,interpolable:i,defaultValue:r,syntax:o})},registerLayout:function(e,n){Ut.get(t.LayoutRegistry).registerLayout(e,n)}},Xa=null;function Ka(t){return function(e){var n=0;return t.map((function(t){return t===Xa?e[n++]:t}))}}function Za(t){return t}var Ja={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],scale:["Nn",Ka([Xa,Xa,Ya.number(1)]),Za],scalex:["N",Ka([Xa,Ya.number(1),Ya.number(1)]),Ka([Xa,Ya.number(1)])],scaley:["N",Ka([Ya.number(1),Xa,Ya.number(1)]),Ka([Ya.number(1),Xa])],scalez:["N",Ka([Ya.number(1),Ya.number(1),Xa])],scale3d:["NNN",Za],translate:["Tt",Ka([Xa,Xa,Pr]),Za],translatex:["T",Ka([Xa,Pr,Pr]),Ka([Xa,Pr])],translatey:["T",Ka([Pr,Xa,Pr]),Ka([Pr,Xa])],translatez:["L",Ka([Pr,Pr,Xa])],translate3d:["TTL",Za]};function Qa(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,i=[],r=0;e=n.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var o=e[1],a=Ja[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],p=u[l],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?xr:yo(t)},N:wo,T:vo,L:po}[p.toUpperCase()](h):{a:xr,n:c[0],t:Pr}[p]))return[];c.push(f)}if(i.push({t:o,d:c}),n.lastIndex===t.length)return i}return[]}function $a(t){return t.replace(/[xy]/,"")}function ts(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function es(e,n,i){var r=!1;if(!e.length||!n.length){e.length||(r=!0,e=n,n=[]);for(var o=function(t){var i=e[t],r=i.t,o=i.d,a="scale"===r.substr(0,5)?1:0;n.push({t:r,d:o.map((function(t){return"number"==typeof t?new dr(a):new dr(a,t.unit)}))})},a=0;e.length>a;a++)o(a)}var s,u,c=[],l=[],h=[];if(e.length!==n.length);else for(var p=0;e.length>p;p++){var f=e[p].t,d=n[p].t,v=e[p].d,y=n[p].d,g=Ja[f],m=Ja[d],T=void 0;if(u=d,("perspective"!==(s=f)||"perspective"!==u)&&("matrix"!==s&&"matrix3d"!==s||"matrix"!==u&&"matrix3d"!==u)){if(f===d)T=f;else if(g[2]&&m[2]&&$a(f)===$a(d))T=$a(f),v=g[2](v),y=m[2](y);else{if(!g[1]||!m[1]||ts(f)!==ts(d))break;T=ts(f),v=g[1](v),y=m[1](y)}for(var b=[],E=[],S=[],w=0;v.length>w;w++){var k=(v[w].unit===t.UnitType.kNumber?ko:go)(v[w],y[w],i,!1,w);b[w]=k[0],E[w]=k[1],S.push(k[2])}c.push(b),l.push(E),h.push([T,S])}}if(r){var P=c;c=l,l=P}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return h[e][1][n](t)})).join(",");return"matrix"===h[e][0]&&16===n.split(",").length&&(h[e][0]="matrix3d"),h[e][0]+"("+n+")"})).join(" ")}]}function ns(t){if(Iu(t)){var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[vo(is(e[0])),vo(is(e[1]))]}return[new dr(t[0]||0,"px"),new dr(t[1]||0,"px")]}function is(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}function rs(t){var e=t.parsedStyle.fontSize;return e&&!dr.isRelativeUnit(e.unit)?e.clone():new dr(0,"px")}var os={parser:vo,mixer:go,calculator:function(e,n,i,r,o){if(!dr.isRelativeUnit(i.unit))return i.clone();if(i.unit===t.UnitType.kPercentage)return new dr(0,"px");if(i.unit===t.UnitType.kEms){if(r.parentNode){var a=rs(r.parentNode);return a.value*=i.value,a}return new dr(0,"px")}if(i.unit===t.UnitType.kRems){var s;if(null==r||null===(s=r.ownerDocument)||void 0===s?void 0:s.documentElement){var u=rs(r.ownerDocument.documentElement);return u.value*=i.value,u}return new dr(0,"px")}}},as={parser:os.parser,mixer:os.mixer,calculator:os.calculator,postProcessor:function(e){var n,i,r;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,a=o.cx,s=o.cy;Cn(a)||(n=a.value),Cn(s)||(i=s.value);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1.value,u.x2.value),i=Math.min(c.value,l.value),r=0;break;default:Cn(e.parsedStyle.x)||(n=e.parsedStyle.x.value),Cn(e.parsedStyle.y)||(i=e.parsedStyle.y.value)}e.parsedStyle.defX=n||0,e.parsedStyle.defY=i||0;var h=e.getLocalPosition(),p=h[0],f=h[1],d=h[2];e.setLocalPosition(Cn(n)?p:n,Cn(i)?f:i,Cn(r)?d:r)}},ss={parser:wo,mixer:Po(0,1)},us={parser:co,calculator:function(t,e,n,i,r){return n instanceof rr?new Nr(0,0,0,0,"none"===n.value):n},mixer:lo},cs={parser:Na},ls={parser:function(t){var e=To(_n(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},mixer:bo},hs={parser:function(t){var e=To(_n(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},mixer:bo},ps={parser:os.parser,mixer:Po(0,1/0),calculator:os.calculator},fs={calculator:function(t,e,n,i){if(e&&e!==n&&e.style.offsetPathTargets){var r=e.style.offsetPathTargets.indexOf(i);e.style.offsetPathTargets.splice(r,1)}return n&&(n.style.offsetPathTargets||(n.style.offsetPathTargets=[]),n.style.offsetPathTargets.push(i)),n}},ds={parser:wo,mixer:Po(0,1),postProcessor:function(e){if(e.attributes.offsetPath){var n=e.attributes.offsetPath.nodeName;if(n===t.Shape.LINE||n===t.Shape.PATH||n===t.Shape.POLYLINE){var i=e.attributes.offsetPath.getPoint(e.parsedStyle.offsetDistance.value);i&&e.setLocalPosition(i.x,i.y)}}}},vs={parser:wo,postProcessor:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,i=e.sortable;n&&(n.dirty=!0),i&&(i.dirty=!0)}}},ys={parser:Qa,mixer:es,postProcessor:function(t){var e=t.parsedStyle,n=e.transform,i=e.defX,r=e.defY;n&&n.length&&(t.resetLocalTransform(),t.setLocalPosition(i,r),n.forEach((function(e){var n=e.t,i=e.d;if("scale"===n){var r=i.map((function(t){return t.value}))||[1,1];t.scaleLocal(r[0],r[1],1)}else if("scalex"===n){var o=i.map((function(t){return t.value}))||[1];t.scaleLocal(o[0],1,1)}else if("scaley"===n){var a=i.map((function(t){return t.value}))||[1];t.scaleLocal(1,a[0],1)}else if("scalez"===n){var s=i.map((function(t){return t.value}))||[1];t.scaleLocal(1,1,s[0])}else if("scale3d"===n){var u=i.map((function(t){return t.value}))||[1,1,1];t.scaleLocal(u[0],u[1],u[2])}else if("translate"===n){var c=i||[Pr,Pr];t.translateLocal(c[0].value,c[1].value,0)}else if("translatex"===n){t.translateLocal((i||[Pr])[0].value,0,0)}else if("translatey"===n){t.translateLocal(0,(i||[Pr])[0].value,0)}else if("translatez"===n){t.translateLocal(0,0,(i||[Pr])[0].value)}else if("translate3d"===n){var l=i||[Pr,Pr,Pr];t.translateLocal(l[0].value,l[1].value,l[2].value)}else if("rotate"===n){t.rotateLocal(0,0,(i||[xr])[0].value)}else if("rotatex"===n){t.rotateLocal((i||[xr])[0].value,0,0)}else if("rotatey"===n){t.rotateLocal(0,(i||[xr])[0].value,0)}else if("rotatez"===n){t.rotateLocal(0,0,(i||[xr])[0].value)}})))}},gs={parser:ns},ms={parser:ma,calculator:function(t,e,n){return n instanceof rr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,curveSegments:[],zCommandIndexes:[],rect:new wn(0,0,0,0)}:n},mixer:Ta,postProcessor:function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,i=n.defX,r=n.defY;e.setLocalPosition(void 0===i?0:i,void 0===r?0:r)}}},Ts={parser:ba,postProcessor:function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}}},bs={calculator:function(t,e,n,i){if(n instanceof rr&&(n=null),e&&e!==n&&e.style.clipPathTargets){var r=e.style.clipPathTargets.indexOf(i);e.style.clipPathTargets.splice(r,1)}return n&&(n.style.clipPathTargets||(n.style.clipPathTargets=[]),n.style.clipPathTargets.push(i)),mc(i),n}},Es={calculator:function(t,e,n,i){return n instanceof rr?"unset"===n.value?"":n.value:n},postProcessor:function(t){t.nodeValue=""+t.parsedStyle.text||""}},Ss={calculator:function(t,e,n,i){var r=i.getAttribute("text");if(r){var o=r;"capitalize"===n.value?o=r.charAt(0).toUpperCase()+r.slice(1):"lowercase"===n.value?o=r.toLowerCase():"uppercase"===n.value&&(o=r.toUpperCase()),i.parsedStyle.text=o}return n}},ws={anchor:[0,0],opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"0",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:""},ks=function(e){function n(n){var i,r,o,a;return(a=e.call(this)||this).config=void 0,a.styleValueRegistry=Ut.get(xi),a.isCustomElement=!1,a.activeAnimations=[],a.config=n,a.config.interactive=null!==(i=a.config.capture)&&void 0!==i?i:a.config.interactive,a.id=a.config.id||"",a.name=a.config.name||"",(a.config.className||a.config.class)&&(a.className=a.config.className||a.config.class),a.nodeName=a.config.type||t.Shape.GROUP,a.config.style=qt({},ws,{zIndex:null!==(r=a.config.zIndex)&&void 0!==r?r:0,interactive:null===(o=a.config.interactive)||void 0===o||o},a.config.style,a.config.attrs),null!=a.config.visible&&(a.config.style.visibility=!1===a.config.visible?"hidden":"visible"),null!=a.config.interactive&&(a.config.style.pointerEvents=!1===a.config.interactive?"none":"auto"),a.style=new Proxy(qt({},a.attributes,{setProperty:function(t,e){a.setAttribute(t,e)},getPropertyValue:function(t){return a.getAttribute(t)},removeProperty:function(t){a.removeAttribute(t)},item:function(){return""}}),{get:function(t,e){return e in t?t[e]:a.getAttribute(e)},set:function(t,e,n){return a.setAttribute(e,n),!0}}),a.initAttributes(a.config.style),Ut.get(t.DisplayObjectPool).add(a.entity,Qt(a)),a}Yt(n,e);var i=n.prototype;return i.destroy=function(){e.prototype.destroy.call(this),Ut.get(t.DisplayObjectPool).remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},i.cloneNode=function(t){var e=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:qt({},this.attributes)});return t&&this.children.forEach((function(n){var i=n.cloneNode(t);e.appendChild(i)})),e},i.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;this.styleValueRegistry.processProperties(this,t),e.dirty=!0},i.setAttribute=function(t,n,i){void 0===i&&(i=!1);var r=Vu(t,n),o=r[0],a=r[1];Nn(n)||(i||a!=this.attributes[o])&&(this.internalSetAttribute(o,a),e.prototype.setAttribute.call(this,o,a))},i.internalSetAttribute=function(e,n,i){var r,o=this;void 0===i&&(i={});var a=this.renderable,s=this.attributes[e],u=this.parsedStyle[e];this.styleValueRegistry.processProperties(this,((r={})[e]=n,r),i),this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&this.attributes.clipPathTargets.forEach((function(e){mc(e),e.dispatchEvent(new Bi(t.ElementEvent.ATTR_MODIFIED,e,o,o,"clipPath",Bi.MODIFICATION,o,o)),e.isCustomElement&&e.attributeChangedCallback&&e.attributeChangedCallback("clipPath",o,o)})),a.dirty=!0,this.dispatchEvent(new Bi(t.ElementEvent.ATTR_MODIFIED,this,s,n,e,Bi.MODIFICATION,u,this.parsedStyle[e])),this.isCustomElement&&this.attributeChangedCallback&&this.attributeChangedCallback(e,s,n)},i.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],i=e[1],r=t.getMax();return new wn(n,i,r[0]-n,r[1]-i)},i.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setOrigin(this,Yn(t,e,n)),this},i.getOrigin=function(){return this.sceneGraphService.getOrigin(this)},i.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setPosition(this,Yn(t,e,n)),this},i.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setLocalPosition(this,Yn(t,e,n)),this},i.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translate(this,Yn(t,e,n)),this},i.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translateLocal(this,Yn(t,e,n)),this},i.getPosition=function(){return this.sceneGraphService.getPosition(this)},i.getLocalPosition=function(){return this.sceneGraphService.getLocalPosition(this)},i.scale=function(t,e,n){return this.scaleLocal(t,e,n)},i.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Yn(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},i.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Yn(t,e=e||t,n=n||t)),this.sceneGraphService.setLocalScale(this,t),this},i.getLocalScale=function(){return this.sceneGraphService.getLocalScale(this)},i.getScale=function(){return this.sceneGraphService.getScale(this)},i.getEulerAngles=function(){var t=Zn(we(),this.sceneGraphService.getWorldTransform(this));return Xn(t[2])},i.getLocalEulerAngles=function(){var t=Zn(we(),this.sceneGraphService.getLocalRotation(this));return Xn(t[2])},i.setEulerAngles=function(t){return this.sceneGraphService.setEulerAngles(this,0,0,t),this},i.setLocalEulerAngles=function(t){return this.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},i.rotateLocal=function(t,e,n){return Cn(e)&&Cn(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},i.rotate=function(t,e,n){return Cn(e)&&Cn(n)?this.sceneGraphService.rotate(this,0,0,t):this.sceneGraphService.rotate(this,t,e,n),this},i.setRotation=function(t,e,n,i){return this.sceneGraphService.setRotation(this,t,e,n,i),this},i.setLocalRotation=function(t,e,n,i){return this.sceneGraphService.setLocalRotation(this,t,e,n,i),this},i.getRotation=function(){return this.sceneGraphService.getRotation(this)},i.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},i.getLocalTransform=function(){return this.sceneGraphService.getLocalTransform(this)},i.getWorldTransform=function(){return this.sceneGraphService.getWorldTransform(this)},i.setLocalTransform=function(t){return this.sceneGraphService.setLocalTransform(this,t),this},i.resetLocalTransform=function(){this.sceneGraphService.resetLocalTransform(this)},i.getAnimations=function(){return this.activeAnimations},i.animate=function(t,e){var n,i,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&(r=null===(i=this.attributes.clipPathTargets[0].ownerDocument)||void 0===i?void 0:i.timeline);return delete this.parsedStyle.transform,r?r.play(new Cu(this,t,e)):null},i.show=function(){this.style.visibility="visible"},i.hide=function(){this.style.visibility="hidden"},i.isVisible=function(){var t,e;return"visible"===(null===(t=this.parsedStyle)||void 0===t||null===(e=t.visibility)||void 0===e?void 0:e.value)},i.isInteractive=function(){var t,e;return"none"!==(null===(t=this.parsedStyle)||void 0===t||null===(e=t.pointerEvents)||void 0===e?void 0:e.value)},i.isCulled=function(){return!(!this.cullable||!this.cullable.isCulled())},i.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},i.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},i.getCount=function(){return this.childElementCount},i.getParent=function(){return this.parentElement},i.getChildren=function(){return this.children},i.getFirst=function(){return this.firstElementChild},i.getLast=function(){return this.lastElementChild},i.getChildByIndex=function(t){return this.children[t]||null},i.add=function(t,e){return this.appendChild(t,e)},i.setClip=function(t){this.style.clipPath=t},i.getClip=function(){return this.style.clipPath||null},i.set=function(t,e){this.config[t]=e},i.get=function(t){return this.config[t]},i.getConfig=function(){return this.config},i.attr=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=n[0],o=n[1];return r?On(r)?(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),this):2===n.length?(this.setAttribute(r,o),this):this.attributes[r]:this.attributes},i.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},i.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},i.setZIndex=function(t){return this.style.zIndex=t,this},i.getMatrix=function(t){var e=t||this.getWorldTransform(),n=ge(we(),e),i=n[0],r=n[1],o=me(we(),e),a=o[0],s=o[1],u=Te(Ye(),e),c=Zn(we(),u);return Jn(c[0]||c[2],i,r,a,s)},i.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},i.setMatrix=function(t){var e=$n(t),n=e[0],i=e[1],r=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,i).setLocalScale(r,o)},i.setLocalMatrix=function(t){var e=$n(t),n=e[0],i=e[1],r=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,i).setLocalScale(r,o)},Wt(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(Gi),Ps=["style"],xs=function(t){function e(e){var n,i=void 0===e?{}:e,r=i.style,o=Jt(i,Ps);return(n=t.call(this,qt({style:qt({x:"",y:""},r)},o))||this).isCustomElement=!0,n}return Yt(e,t),e}(ks),Ns=["style"],Cs=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,Ns);return e.call(this,qt({type:t.Shape.CIRCLE,style:qt({cx:"",cy:"",r:"",anchor:[.5,.5],transformOrigin:"center",lineWidth:"0"},r)},o))||this}return Yt(n,e),n}(ks),_s=["style"],As=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,_s);return e.call(this,qt({type:t.Shape.ELLIPSE,style:qt({cx:"",cy:"",rx:"",ry:"",anchor:[.5,.5],transformOrigin:"center",lineWidth:"0"},r)},o))||this}return Yt(n,e),n}(ks),Ms=["style"],Os=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,Ms);return e.call(this,qt({type:t.Shape.GROUP,style:qt({x:"",y:"",width:"",height:""},r)},o))||this}return Yt(n,e),n}(ks),Is=["style"],Rs=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,Is);return e.call(this,qt({type:t.Shape.IMAGE,style:qt({x:"",y:"",img:"",width:"",height:"",lineWidth:"0"},r)},o))||this}return Yt(n,e),n}(ks),Ls=["style"],Ds=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,Ls);return e.call(this,qt({type:t.Shape.LINE,style:qt({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,lineWidth:1,isBillboard:!1},r)},o))||this}Yt(n,e);var i=n.prototype;return i.getPoint=function(t){var e=this.parsedStyle,n=_o.pointAt(e.x1.value,e.y1.value,e.x2.value,e.y2.value,t);return new Sn(n.x,n.y)},i.getTotalLength=function(){var t=this.parsedStyle;return _o.length(t.x1.value,t.y1.value,t.x2.value,t.y2.value)},n}(ks),Us=["style"],Fs=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,Us);return e.call(this,qt({type:t.Shape.PATH,style:qt({path:"",lineWidth:1,miterLimit:4},r)},o))||this}Yt(n,e);var i=n.prototype;return i.getTotalLength=function(){return this.parsedStyle.path.totalLength},i.getPoint=function(t){var e=0,n=0,i=this.parsedStyle.path.curve;if(!this.parsedStyle.path.curveSegments.length)return i?new Sn(i[0][1],i[0][2]):null;this.parsedStyle.path.curveSegments.forEach((function(i,r){i[0]>t||t>i[1]||(e=(t-i[0])/(i[1]-i[0]),n=r)}));var r=i[n];if(Cn(r)||Cn(n))return null;var o=r.length,a=i[n+1],s=Lo.pointAt(r[o-2],r[o-1],a[1],a[2],a[3],a[4],a[5],a[6],e);return new Sn(s.x,s.y)},i.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,i=t[1].currentPoint,r=t[1].startTangent;e=[],r?(e.push([n[0]-r[0],n[1]-r[1]]),e.push([n[0],n[1]])):(e.push([i[0],i[1]]),e.push([n[0],n[1]]))}return e},i.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var i=t[e-2].currentPoint,r=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([r[0]-o[0],r[1]-o[1]]),n.push([r[0],r[1]])):(n.push([i[0],i[1]]),n.push([r[0],r[1]]))}return n},n}(ks),Bs=["style"],Vs=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,Bs);return e.call(this,qt({type:t.Shape.POLYGON,style:qt({points:"",miterLimit:4,lineWidth:1},r)},o))||this}return Yt(n,e),n}(ks),Gs=["style"],js=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,Gs);return e.call(this,qt({type:t.Shape.POLYLINE,style:qt({points:"",lineWidth:1,miterLimit:4},r)},o))||this}Yt(n,e);var i=n.prototype;return i.getTotalLength=function(){return this.parsedStyle.points.totalLength},i.getPoint=function(t){var e=this.parsedStyle.points,n=e.points,i=0,r=0;e.segments.forEach((function(e,n){e[0]>t||t>e[1]||(i=(t-e[0])/(e[1]-e[0]),r=n)}));var o=_o.pointAt(n[r][0],n[r][1],n[r+1][0],n[r+1][1],i);return new Sn(o.x,o.y)},i.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},i.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(ks),Hs=["style"],zs=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Jt(i,Hs);return e.call(this,qt({type:t.Shape.RECT,style:qt({x:"",y:"",width:"",height:"",radius:"",lineWidth:"0"},r)},o))||this}return Yt(n,e),n}(ks),Ws=["style"],qs=function(e){function n(n){var i,r=void 0===n?{}:n,o=r.style,a=Jt(r,Ws);return(i=e.call(this,qt({type:t.Shape.TEXT,style:qt({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",stroke:"black",letterSpacing:0,lineHeight:0,lineWidth:0,miterLimit:10,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},o)},a))||this).LENGTHADJUST_SPACING=1,i.LENGTHADJUST_SPACINGANDGLYPHS=2,i.LENGTHADJUST_UNKNOWN=0,i.lengthAdjust=void 0,i.textLength=void 0,i}Yt(n,e);var i=n.prototype;return i.getCharNumAtPosition=function(t){throw new Error("Method not implemented.")},i.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},i.getEndPositionOfChar=function(t){throw new Error("Method not implemented.")},i.getExtentOfChar=function(t){throw new Error("Method not implemented.")},i.getNumberOfChars=function(){throw new Error("Method not implemented.")},i.getRotationOfChar=function(t){throw new Error("Method not implemented.")},i.getStartPositionOfChar=function(t){throw new Error("Method not implemented.")},i.getSubStringLength=function(t,e){throw new Error("Method not implemented.")},i.selectSubString=function(t,e){throw new Error("Method not implemented.")},i.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},n}(ks),Ys=["style"],Xs=function(e){function n(n){var i,r=void 0===n?{}:n,o=r.style,a=Jt(r,Ys);return(i=e.call(this,qt({type:t.Shape.HTML,style:qt({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,i}Yt(n,e);var i=n.prototype;return i.getDomElement=function(){return this.parsedStyle.$el},i.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},i.getClientRects=function(){return[this.getBoundingClientRect()]},i.getBounds=function(){var t,e,n=this.getBoundingClientRect(),i=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(i){var r=n.left-i.left,o=n.top-i.top,a=new hn;return a.setMinMax(xe(r,o,0),xe(r+n.width,o+n.height,0)),a}return null},i.getLocalBounds=function(){if(this.parentNode){var t=fe(le(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!hn.isEmpty(e)){var n=new hn;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(ks),Ks=function(t){function e(){var e;(e=t.call(this)||this).defaultView=null,e.documentElement=void 0,e.timeline=void 0,e.ownerDocument=null,e.nodeName="document",e.timeline=new Ji(Qt(e));var n={};return Mu.forEach((function(t){var e=t.defaultValue;t.inherited&&e&&(n[t.name]=e)})),e.documentElement=new Os({id:"g-root",style:n}),e.documentElement.ownerDocument=Qt(e),e.documentElement.parentNode=Qt(e),e.childNodes=[e.documentElement],e}Yt(e,t);var n=e.prototype;return n.createElement=function(t,e){var n=this.defaultView.customElements.get(t);return n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?qs:Os),new n(e)},n.createElementNS=function(t,e,n){return this.createElement(e,n)},n.cloneNode=function(t){throw new Error("Method not implemented.")},n.destroy=function(){try{this.documentElement.destroy()}catch(t){}this.timeline.destroy()},n.elementFromPoint=function(){var t=Ht(Gt().mark((function t(e,n){var i,r,o,a,s,u,c,l,h,p;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,o=i.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>r||0>o||r>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:r,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:r,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(p=t.sent.picked)&&p[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.elementsFromPoint=function(){var t=Ht(Gt().mark((function t(e,n){var i,r,o,a,s,u,c,l,h,p;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,o=i.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>r||0>o||r>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:r,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:r,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(p=t.sent.picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),t.abrupt("return",p);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.appendChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.insertBefore=function(t,e){throw new Error("Use document.documentElement instead.")},n.removeChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.replaceChild=function(t,e,n){throw new Error("Use document.documentElement instead.")},n.append=function(){throw new Error("Use document.documentElement instead.")},n.prepend=function(){throw new Error("Use document.documentElement instead.")},n.getElementById=function(t){return this.documentElement.getElementById(t)},n.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.querySelector=function(t){return this.documentElement.querySelector(t)},n.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.find=function(t){return this.documentElement.find(t)},n.findAll=function(t){return this.documentElement.findAll(t)},Wt(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),e}(Oi),Zs=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new Sn,e.movement=new Sn,e.offset=new Sn,e.global=new Sn,e.screen=new Sn,e}Yt(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw new Error("Method not implemented.")},Wt(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),e}(_i),Js=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}Yt(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e}(Zs),Qs=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return Yt(e,t),e}(Zs),$s=function(t){return t};function tu(t,e){return function(n){if(n>=1)return 1;var i=1/t;return(n+=e*i)-n%i}}var eu="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",nu=new RegExp("cubic-bezier\\("+eu+","+eu+","+eu+","+eu+"\\)"),iu=/steps\(\s*(\d+)\s*\)/,ru=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function ou(t){var e=nu.exec(t);if(e)return zn.apply(void 0,e.slice(1).map(Number));var n=iu.exec(t);if(n)return tu(Number(n[1]),0);var i=ru.exec(t);return i?tu(Number(i[1]),{start:1,middle:.5,end:0}[i[2]]):Ti(t)}function au(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function su(t,e,n){var i=function(t,e,n){if(null===e)return 0;var i=n.endTime;return e<Math.min(n.delay,i)?1:e<Math.min(n.delay+t+n.endDelay,i)?3:2}(t,e,n),r=function(t,e,n,i,r){switch(i){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-r;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,i,n.delay);if(null===r)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,i,r){var o=r;return 0===t?1!==e&&(o+=n):o+=i/t,o}(o,i,n.iterations,r,n.iterationStart),s=function(t,e,n,i,r,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===i||0===r&&0!==o||(a=1),a}(a,n.iterationStart,i,n.iterations,r,o),u=function(t,e,n,i){return 2===t&&e===1/0?1/0:1===n?Math.floor(i)-1:Math.floor(i)}(i,n.iterations,s,a),c=function(t,e,n){var i=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),i="normal",r!==1/0&&r%2!=0&&(i="reverse")}return"normal"===i?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}var uu,cu,lu=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=$s,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return Wt(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=ou(t),this._easing=t}}]),t}(),hu=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),pu=0,fu=new WeakMap,du=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var i=function(t,e){return t===e?t:cu&&function(t){return t===cu||t===uu}(t)?cu:null}(e[n-1],t);if(i)return void(e[n-1]=i)}else Tu.push(this.observer),mu||(mu=!0,"undefined"!=typeof globalThis?globalThis.setTimeout(bu):bu());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=fu.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,i;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var r=e.attrName,o=e.relatedNode.namespaceURI;(n=yu("attributes",i=e.target)).attributeName=r,n.attributeNamespace=o;var a=e.attrChange===Bi.ADDITION?null:e.prevValue;gu(i,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(r)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return cu||((cu=hu.copy(uu)).oldValue=t,cu)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=yu("childList",i=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,gu(i,(function(t){if(t.childList)return n}))}uu=cu=void 0},e}(),vu=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=pu++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,i=fu.get(t);i||fu.set(t,i=[]);for(var r=0;i.length>r;r++)if(i[r].observer===this){(n=i[r]).removeListeners(),n.options=e;break}n||(n=new du(this,t,e),i.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=fu.get(e),i=0;n.length>i;i++){var r=n[i];if(r.observer===t){r.removeListeners(),n.splice(i,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function yu(t,e){return uu=new hu(t,e)}function gu(t,e){for(var n=t;n;n=n.parentNode){var i=fu.get(n);if(i)for(var r=0;i.length>r;r++){var o=i[r],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var mu=!1,Tu=[];function bu(){mu=!1;var t=Tu;Tu=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=fu.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&bu()}function Eu(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var i=t[n];Array.isArray(i)||(i=[i]);for(var r=i.length,o=0;r>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=i[o]&&(e[o][n]=i[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var i in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var r=t[i];if("offset"===i){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(0>r||r>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===i&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error(r+" compositing is not supported");n[i]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),i=!0,r=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(null!=a){if(r>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=a}else i=!1}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),i||function(){var t,e,i=n.length;n[i-1].computedOffset=Number(null!==(t=n[i-1].offset)&&void 0!==t?t:1),i>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var r=0,o=Number(n[0].computedOffset),a=1;i>a;a++){var s=Number(n[a].computedOffset);if(null!=s&&null!=o){for(var u=1;a-r>u;u++)n[r+u].computedOffset=o+(s-o)*u/(a-r);r=a,o=s}}}(),n}var Su="backwards|forwards|both|none".split("|"),wu="reverse|alternate|alternate-reverse".split("|");function ku(t,e){var n=new lu;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Su.indexOf(t[e]))return;if("direction"===e&&-1===wu.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Pu(t,e){var n;return ku(t=xu(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function xu(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var Nu,Cu=function(){function t(t,e,n){var i=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=Pu(n,!1),this.timing.effect=this,this.timing.activeDuration=au(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Eu(e,this.timing),this.interpolations=Ru(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=su(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=Eu(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}(),_u=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,Cs),this.define(t.Shape.ELLIPSE,As),this.define(t.Shape.RECT,zs),this.define(t.Shape.IMAGE,Rs),this.define(t.Shape.LINE,Ds),this.define(t.Shape.GROUP,Os),this.define(t.Shape.PATH,Fs),this.define(t.Shape.POLYGON,Vs),this.define(t.Shape.POLYLINE,js),this.define(t.Shape.TEXT,qs),this.define(t.Shape.HTML,Xs)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),Au=((Nu={})[t.PropertySyntax.COORDINATE]=as,Nu[t.PropertySyntax.COLOR]=us,Nu[t.PropertySyntax.PAINT]=us,Nu[t.PropertySyntax.OPACITY_VALUE]=ss,Nu[t.PropertySyntax.LENGTH_PERCENTAGE]=os,Nu[t.PropertySyntax.LENGTH_PERCENTAGE_12]=ls,Nu[t.PropertySyntax.LENGTH_PERCENTAGE_14]=hs,Nu[t.PropertySyntax.SHADOW_BLUR]=ps,Nu[t.PropertySyntax.LIST_OF_POINTS]=Ts,Nu[t.PropertySyntax.PATH]=ms,Nu[t.PropertySyntax.FILTER]=cs,Nu[t.PropertySyntax.Z_INDEX]=vs,Nu[t.PropertySyntax.OFFSET_PATH]=fs,Nu[t.PropertySyntax.OFFSET_DISTANCE]=ds,Nu[t.PropertySyntax.CLIP_PATH]=bs,Nu[t.PropertySyntax.TRANSFORM]=ys,Nu[t.PropertySyntax.TRANSFORM_ORIGIN]=gs,Nu[t.PropertySyntax.TEXT]=Es,Nu[t.PropertySyntax.TEXT_TRANSFORM]=Ss,Nu),Mu=[{name:"display",keywords:["none"]},{name:"opacity",interpolable:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fillOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"strokeOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fill",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"stroke",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"shadowColor",interpolable:!0,syntax:t.PropertySyntax.COLOR},{name:"shadowOffsetX",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowOffsetY",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowBlur",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.SHADOW_BLUR},{name:"lineWidth",interpolable:!0,inherited:!0,defaultValue:"1",layoutDependent:!0,alias:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"increasedLineWidthForHitTesting",inherited:!0,defaultValue:"0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"lineJoin",inherited:!0,layoutDependent:!0,alias:["strokeLinejoin"],keywords:["miter","bevel","round"],defaultValue:"miter"},{name:"lineCap",inherited:!0,layoutDependent:!0,alias:["strokeLinecap"],keywords:["butt","round","square"],defaultValue:"butt"},{name:"lineDash",interpolable:!0,inherited:!0,keywords:["none"],alias:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"lineDashOffset",interpolable:!0,inherited:!0,defaultValue:"0",alias:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"offsetPath",syntax:t.PropertySyntax.OFFSET_PATH},{name:"offsetDistance",interpolable:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{name:"dx",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"dy",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"zIndex",independent:!0,interpolable:!0,defaultValue:"0",keywords:["auto"],syntax:t.PropertySyntax.Z_INDEX},{name:"visibility",keywords:["visible","hidden"],independent:!0,inherited:!0,defaultValue:"visible"},{name:"pointerEvents",inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],defaultValue:"auto"},{name:"filter",independent:!0,layoutDependent:!0,syntax:t.PropertySyntax.FILTER},{name:"clipPath",syntax:t.PropertySyntax.CLIP_PATH},{name:"transform",parsePriority:100,interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.TRANSFORM},{name:"transformOrigin",parsePriority:100,defaultValue:"left top",layoutDependent:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{name:"anchor",parsePriority:99,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"cx",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"cy",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"r",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"rx",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"ry",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"x",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"y",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"z",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"width",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"height",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"radius",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{name:"x1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"x2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"path",interpolable:!0,layoutDependent:!0,defaultValue:"",alias:["d"],syntax:t.PropertySyntax.PATH},{name:"points",layoutDependent:!0,syntax:t.PropertySyntax.LIST_OF_POINTS},{name:"text",layoutDependent:!0,defaultValue:"",syntax:t.PropertySyntax.TEXT},{name:"textTransform",layoutDependent:!0,inherited:!0,keywords:["capitalize","uppercase","lowercase","none"],defaultValue:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM},{name:"font",layoutDependent:!0},{name:"fontSize",interpolable:!0,inherited:!0,defaultValue:"16px",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"fontFamily",layoutDependent:!0,inherited:!0,defaultValue:"sans-serif"},{name:"fontStyle",layoutDependent:!0,inherited:!0,keywords:["normal","italic","oblique"],defaultValue:"normal"},{name:"fontWeight",layoutDependent:!0,inherited:!0,keywords:["normal","bold","bolder","lighter"],defaultValue:"normal"},{name:"fontVariant",layoutDependent:!0,inherited:!0,keywords:["normal","small-caps"],defaultValue:"normal"},{name:"lineHeight",layoutDependent:!0},{name:"letterSpacing",layoutDependent:!0},{name:"wordWrap",layoutDependent:!0},{name:"wordWrapWidth",layoutDependent:!0},{name:"leading",layoutDependent:!0},{name:"textBaseline",layoutDependent:!0,inherited:!0,keywords:["top","hanging","middle","alphabetic","ideographic","bottom"],defaultValue:"alphabetic"},{name:"textAlign",layoutDependent:!0,inherited:!0,keywords:["start","center","end","left","right"],defaultValue:"start"},{name:"whiteSpace",layoutDependent:!0}];function Ou(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}function Iu(t){return!Cn(t)&&"string"==typeof t}function Ru(t,e,n){var i=function(t,e){for(var n={},i=0;t.length>i;i++)for(var r in t[i])if(Lu(r)){var o={offset:t[i].offset,computedOffset:t[i].computedOffset,easing:t[i].easing,easingFunction:ou(t[i].easing)||e.easingFunction,value:t[i][r]};n[r]=n[r]||[],n[r].push(o)}return n}(t,e),r=function(t,e){var n=[];for(var i in t)for(var r=t[i],o=0;r.length-1>o;o++){var a=o,s=o+1,u=r[a].computedOffset,c=r[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===r.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:r[a].computedOffset,endOffset:r[s].computedOffset,easingFunction:r[a].easingFunction,property:i,interpolation:Uu(i,r[a].value,r[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(i,n);return function(t,e){if(null!==e)r.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var i=n.endOffset-n.startOffset,r=0===i?0:n.easingFunction((e-n.startOffset)/i);t.style[n.property]=n.interpolation(r)}));else for(var n in i)Lu(n)&&(t.style[n]=null)}}function Lu(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}t.DefaultStyleValueRegistry=function(){function e(){this.dirty=!1,this.cache={},this.unresolvedProperties={},this.cascadeProperties={}}var n=e.prototype;return n.init=function(){var t=this;Mu.forEach((function(e){t.registerMetadata(e)}))},n.registerMetadata=function(t){var e=this;[t.name].concat(t.alias||[]).forEach((function(n){e.cache[n]=t}))},n.unregisterMetadata=function(t){delete this.cache[t]},n.getMetadata=function(t){return this.cache[t]},n.processProperties=function(t,e,n){var i=this;void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1});var r=n.skipUpdateAttribute,o=n.skipParse,a=!1;Object.keys(e).forEach((function(n){var o,s=Vu(n,e[n]),u=s[0];r||(t.attributes[u]=s[1]),!a&&(null===(o=i.getMetadata(u))||void 0===o?void 0:o.layoutDependent)&&(a=!0)}));var s=Object.keys(e).sort((function(t,e){var n,r;return((null===(n=i.getMetadata(t))||void 0===n?void 0:n.parsePriority)||0)-((null===(r=i.getMetadata(e))||void 0===r?void 0:r.parsePriority)||0)}));o||s.forEach((function(e){t.computedStyle[e]=i.parseProperty(e,t.attributes[e],t)}));var u=!1;s.forEach((function(e){e in t.computedStyle&&(u=i.computeProperty(e,t.computedStyle[e],t))})),u?this.dirty=!0:(a&&this.updateGeometry(t),s.forEach((function(e){e in t.parsedStyle&&i.postProcessProperty(e,t)})),s.forEach((function(e){e in t.parsedStyle&&i.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))})))},n.parseProperty=function(t,e,n){var i=this.getMetadata(t),r=e;if((""===e||Cn(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)r=new rr(e);else if(i){var o=i.keywords,a=i.syntax,s=a&&Au[a];if(o&&o.indexOf(e)>-1)r=new rr(e);else if(s){s&&s.parser&&(r=s.parser(e,n))}}return r},n.computeProperty=function(t,e,n){var i=this.getMetadata(t),r="g-root"===n.id,o=e instanceof nr?e.clone():e;if(i){var a=i.syntax,s=i.defaultValue;if(e instanceof rr){var u=e.value;if("unset"===u&&(u=i.inherited&&!r?"inherit":"initial"),"initial"===u)Cn(s)||(e=this.parseProperty(t,s,n));else if("inherit"===u){var c=this.tryToResolveProperty(n,t,{inherited:!0});return c?(n.parsedStyle[t]=c,!1):(this.addUnresolveProperty(n,t),!0)}}var l=a&&Au[a];if(l){if(l&&l.calculator)o=l.calculator(t,n.parsedStyle[t],e,n,this);else o=e}else o=e}return n.parsedStyle[t]=o,!1},n.postProcessProperty=function(t,e){var n=this.getMetadata(t);if(n&&n.syntax){var i=n.syntax&&Au[n.syntax];i&&i.postProcessor&&i.postProcessor(e)}},n.isPropertyResolved=function(t,e){return!this.unresolvedProperties[t.entity]||0===this.unresolvedProperties[t.entity].length||this.unresolvedProperties[t.entity].includes(e)},n.addUnresolveProperty=function(t,e){this.unresolvedProperties[t.entity]||(this.unresolvedProperties[t.entity]=[]),-1===this.unresolvedProperties[t.entity].indexOf(e)&&this.unresolvedProperties[t.entity].push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&this.isPropertyResolved(t.parentElement,e)){var i=t.parentElement.parsedStyle[e];return(!(i instanceof rr)||"unset"!==i.value&&"initial"!==i.value&&"inherit"!==i.value)&&(!(i instanceof dr&&dr.isRelativeUnit(i.unit))&&i)}return!1},n.recalc=function(t){var e=this.unresolvedProperties[t.entity];if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),delete this.unresolvedProperties[t.entity]}},n.updateGeometry=function(e){var n=Ut.get(Ni)(e.nodeName);if(n){var i,r=e.geometry;r.contentBounds||(r.contentBounds=new hn),r.renderBounds||(r.renderBounds=new hn);var o=e.parsedStyle,a=n.update(o,e),s=a.depth,u=a.offsetX,c=void 0===u?0:u,l=a.offsetY,h=void 0===l?0:l,p=a.offsetZ,f=void 0===p?0:p,d=xe(a.width/2,a.height/2,(void 0===s?0:s)/2),v=o.lineWidth,y=o.increasedLineWidthForHitTesting,g=o.shadowColor,m=o.filter,T=void 0===m?[]:m,b=o.transformOrigin,E=o.anchor;e.nodeName===t.Shape.TEXT&&delete o.anchor;var S=xe((1-2*(E&&E[0].value||0))*d[0]+c,(1-2*(E&&E[1].value||0))*d[1]+h,(1-2*(E&&(null===(i=E[2])||void 0===i?void 0:i.value)||0))*d[2]+f);r.contentBounds.update(S,d);var w=(((null==v?void 0:v.value)||0)+((null==y?void 0:y.value)||0))/2;if(_e(d,d,xe(w,w,0)),r.renderBounds.update(S,d),g){var k=r.renderBounds,P=k.min,x=k.max,N=o.shadowBlur,C=o.shadowOffsetX,_=o.shadowOffsetY,A=N&&N.value||0,M=C&&C.value||0,O=_&&_.value||0,I=x[0]+A+M,R=P[1]-A+O,L=x[1]+A+O;P[0]=Math.min(P[0],P[0]-A+M),x[0]=Math.max(x[0],I),P[1]=Math.min(P[1],R),x[1]=Math.max(x[1],L),r.renderBounds.setMinMax(P,x)}T.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,_e(r.renderBounds.halfExtents,r.renderBounds.halfExtents,xe(i,i,0)))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=r.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),r.renderBounds.setMinMax(c,l)}})),E=o.anchor;var D=Eo(b[0],0,e),U=Eo(b[1],1,e);e.setOrigin(D-=(E&&E[0].value||0)*r.contentBounds.halfExtents[0]*2,U-=(E&&E[1].value||0)*r.contentBounds.halfExtents[1]*2),e.emit(t.ElementEvent.GEOMETRY_BOUNDS_CHANGED,{}),mc(e)}},n.isPropertyInheritable=function(t){var e=this.getMetadata(t);return!!e&&e.inherited},e}(),ie([Y.postConstruct(),oe("design:type",Function),oe("design:paramtypes",[]),oe("design:returntype",void 0)],t.DefaultStyleValueRegistry.prototype,"init",null),t.DefaultStyleValueRegistry=ie([lt({token:xi})],t.DefaultStyleValueRegistry);var Du=function(t,e,n){return function(i){return n(Fu(t,e,i))}};function Uu(t,e,n,i){var r=e,o=n,a=Ut.get(xi).getMetadata(t);if(a&&a.syntax&&a.interpolable&&Au[a.syntax]){var s=Au[a.syntax];if(s){s.parser&&(r=s.parser(e,i),o=s.parser(n,i));var u=s.mixer(r,o,i);if(u){var c=Du.apply(void 0,u);return function(t){return 0===t?e:1===t?n:c(t)}}}}return Du(!1,!0,(function(t){return t?n:e}))}function Fu(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(var i=[],r=0;t.length>r;r++)i.push(Fu(t[r],e[r],n));return i}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var Bu={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign",values:{middle:"center"}},src:{alias:"img"}};function Vu(t,e){var n,i=Ou(t),r=Bu[i];return[i=(null==r?void 0:r.alias)||i,(null==r||null===(n=r.values)||void 0===n?void 0:n[e])||e]}var Gu=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},ju=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},Hu=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},zu=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=Gu,this.call=Gu,this._callAsync=ju,this.callAsync=ju,this._promise=Hu,this.promise=Hu,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=te(this.interceptors);!(e=n()).done;){var i=e.value;if(i.register){var r=i.register(t);void 0!==r&&(t=r)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,i){return e.tap(n(t),i)},tapAsync:function(t,i){return e.tapAsync(n(t),i)},tapPromise:function(t,i){return e.tapPromise(n(t),i)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var i=this.taps.length;i>0;){i--;var r=this.taps[i];this.taps[i+1]=r;var o=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(n>=o){i++;break}}this.taps[i]=t},t}(),Wu=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,i=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),r="";r+='"use strict";\n',r+=this.header(),r+="return new Promise((function(_resolve, _reject) {\n",n&&(r+="var _sync = true;\n",r+="function _error(_err) {\n",r+="if(_sync)\n",r+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",r+="else\n",r+="_reject(_err);\n",r+="};\n"),r+=i,n&&(r+="_sync = false;\n"),r+="}));\n",e=new Function(this.args(),r)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,i=t.onResult,r=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var i="",r=0;e.options.interceptors.length>r;r++){e.options.interceptors[r].error&&(i+=e.getInterceptor(r)+".error("+t+");\n")}return i+=n(t)},onResult:i&&function(t){for(var n="",r=0;e.options.interceptors.length>r;r++){e.options.interceptors[r].result&&(n+=e.getInterceptor(r)+".result("+t+");\n")}return n+=i(t)},onDone:r&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=r()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=te(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,i=e.onResult,r=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=i?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),i&&(a+=i("_result"+t)),r&&(a+=r()),o||(a+="}\n");break;case"async":var h="";h+=i?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",i&&(h+=i("_result"+t)),r&&(h+=r()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",i&&(a+=i("_result"+t)),r&&(a+=r()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,i=t.onResult,r=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=r||a,l="",h=o,p=0,f=function(t){var r=t;h!==o&&("sync"!==e.options.taps[r].type||p++>20)&&(p=0,l+="function _next"+r+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+r+"();\n"});var a=h,f=function(t){return t?"":o()},d=e.callTap(r,{onError:function(t){return n(r,t,a,f)},onResult:i&&function(t){return i(r,t,a,f)},onDone:!i&&a,rethrowIfPossible:s&&(0>u||u>r)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)f(d);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,i=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var r=this.options.taps.every((function(t){return"sync"===t.type})),o="";r||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,i){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",r||(o+="if(_loopAsync) _looper();\n"),o+=i(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:i&&r}),o+="} while(_loop);\n",r||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,i=t.onResult,r=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:i,onDone:r,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",r&&(u+="var _done = (function() {\n",u+=r(),u+="});\n");for(var c=function(t){var a=function(){return r?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!r?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var i="";return i+="if(_counter > 0) {\n",i+=n(t,e,a,c),i+="}\n"},onResult:i&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=i(t,e,a,c),n+="}\n"},onDone:!i&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,i=e.after,r=this._args;return n&&(r=[n].concat(r)),i&&(r=r.concat(i)),0===r.length?"":r.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),qu=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,i,r){return e(n)+r(!0)},onDone:t.onDone})},e}(Wu),Yu=new qu,Xu=function(t){return Yu.setup(this,t),Yu.create(t)},Ku=function(t){function e(e,n){var i;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(i=t.call(this,e,n)||this).compile=Xu,i._call=void 0,i.call=void 0,i}return Yt(e,t),e}(zu),Zu=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.content=function(t){var e=this,n=t.onError,i=t.onResult;return this.callTapsSeries({onError:function(t,e,i,r){return n(e)+r(!0)},onResult:function(t,n,i){var r="";return r+="if("+n+" !== undefined) {\n",r+=e._args[0]+" = "+n+";\n",r+="}\n",r+=i()},onDone:function(){return i(e._args[0])}})},e}(Wu),Ju=new Zu,Qu=function(t){return Ju.setup(this,t),Ju.create(t)},$u=function(t){function e(e,n){var i;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(i=t.call(this,e,n)||this).compile=Qu,i._call=void 0,i.call=void 0,i}return Yt(e,t),e}(zu),tc=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(Wu),ec=new tc,nc=function(){throw new Error("tapAsync is not supported on a SyncHook")},ic=function(){throw new Error("tapPromise is not supported on a SyncHook")},rc=function(t){return ec.setup(this,t),ec.create(t)},oc=function(t){function e(e,n){var i;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(i=t.call(this,e,n)||this).tapAsync=nc,i.tapPromise=ic,i.compile=rc,i}return Yt(e,t),e}(zu),ac=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.content=function(t){var e=this,n=t.onError,i=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,i){var r="";return r+="if("+n+" !== undefined) {\n",r+=e._args[0]+" = "+n+";\n",r+="}\n",r+=i()},onDone:function(){return i(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(Wu),sc=new ac,uc=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},cc=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},lc=function(t){return sc.setup(this,t),sc.create(t)},hc=function(t){function e(e,n){var i;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(i=t.call(this,e,n)||this).tapAsync=uc,i.tapPromise=cc,i.compile=lc,i}return Yt(e,t),e}(oc),pc=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function fc(t){for(var e=t.fontSize,n=t.fontFamily,i=t.fontStyle,r=t.fontVariant,o=t.fontWeight,a=_n(e)?e+"px":e.toString(),s=Iu(n)?n.split(","):[n.value],u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&0>pc.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return i+" "+r+" "+o+" "+a+" "+s.join(",")}var dc=r.defineToken("SceneGraphSelectorFactory"),vc=r.defineToken("SceneGraphSelector",{multiple:!1}),yc=/\[\s*(.*)=(.*)\s*\]/;function gc(t,e){var n=Number(t.style.zIndex),i=Number(e.style.zIndex);if(n===i){var r=t.parentNode;if(r){var o=r.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-i}function mc(e,n){void 0===n&&(n=!1);for(var i=e;i;){var r=i.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0),i=i.parentNode}e.emit(t.ElementEvent.BOUNDS_CHANGED,{affectChildren:n})}t.DefaultSceneGraphSelector=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return e.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,o=i.value;return r?e.find((function(t){return e!==t&&("name"===r?t.name===o:n.attributeToString(t,r)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(i){return e!==i&&i.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.findAll((function(i){return e!==i&&i.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,o=i.value;return r?e.findAll((function(t){return e!==t&&("name"===r?t.name===o:n.attributeToString(t,r)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),i=n.name,r=n.value;return"name"===i?e.name===r:this.attributeToString(e,i)===r}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(yc),n="",i="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),i=e[2].replace(/"/g,"")),{name:n,value:i}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Cn(n)?"":n.toString?n.toString():""},t}(),t.DefaultSceneGraphSelector=ie([lt({token:vc})],t.DefaultSceneGraphSelector);var Tc=r.defineToken("SceneGraphService");t.DefaultSceneGraphService=function(){function e(){var t,e,n,i,r,o=this;this.sceneGraphSelectorFactory=void 0,this.rotate=(t=Ye(),function(e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=0),"number"==typeof n&&(n=xe(n,i,r));var a=e.transformable;if(null!==e.parentNode&&e.parentNode.transformable){var s=Ye();Qe(s,n[0],n[1],n[2]);var u=o.getRotation(e),c=o.getRotation(e.parentNode);sn(t,c),Je(t,t),Ke(s,t,s),Ke(a.localRotation,s,u),cn(a.localRotation,a.localRotation),o.dirtifyLocal(e,a)}else o.rotateLocal(e,n)}),this.rotateLocal=(e=Ye(),function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=0),"number"==typeof n&&(n=xe(n,i,r));var a=t.transformable;Qe(e,n[0],n[1],n[2]),un(a.localRotation,a.localRotation,e),o.dirtifyLocal(t,a)}),this.setEulerAngles=(n=Ye(),function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0),"number"==typeof e&&(e=xe(e,i,r));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Qe(a.localRotation,e[0],e[1],e[2]);var s=o.getRotation(t.parentNode);sn(n,Je(Ye(),s)),un(a.localRotation,a.localRotation,n),o.dirtifyLocal(t,a)}else o.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=xe(e,n,i));var r=t.transformable;Be(e,we())||(function(t,e,n){var i=n[0],r=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=r*u-o*s,l=o*a-i*u,h=i*s-r*a,p=r*h-o*l,f=o*c-i*h,d=i*l-r*c,v=2*n[3];l*=v,h*=v,f*=2,d*=2,t[0]=a+(c*=v)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,r.localRotation),_e(r.localPosition,r.localPosition,e),o.dirtifyLocal(t,r))},this.setPosition=(i=le(),function(t,e){var n=t.transformable;e=xe(e[0],e[1],e[2]||0),Be(o.getPosition(t),e)||(n.position=e,null!==t.parentNode&&t.parentNode.transformable?(he(i,t.parentNode.transformable.worldTransform),fe(i,i),Fe(n.localPosition,e,i)):Ne(n.localPosition,e),o.dirtifyLocal(t,n))}),this.translate=(r=we(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=xe(e,n,i)),Be(e,we())||(_e(r,o.getPosition(t),e),o.setPosition(t,r))}),this.setRotation=function(){var t=Ye();return function(e,n,i,r,a){var s=e.transformable;if("number"==typeof n&&(n=an(n,i,r,a)),null!==e.parentNode&&e.parentNode.transformable){var u=o.getRotation(e.parentNode);sn(t,u),Je(t,t),Ke(s.localRotation,t,n),cn(s.localRotation,s.localRotation),o.dirtifyLocal(e,s)}else o.setLocalRotation(e,n)}}}var n=e.prototype;return n.matches=function(t,e){return this.sceneGraphSelectorFactory().is(t,e)},n.querySelector=function(t,e){return this.sceneGraphSelectorFactory().selectOne(t,e)},n.querySelectorAll=function(t,e){return this.sceneGraphSelectorFactory().selectAll(t,e)},n.attach=function(t,e,n){t.parentNode&&this.detach(t),t.parentNode=e,Cn(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var i=e.sortable;i&&(i.dirty=!0);var r=t.transformable;r&&this.dirtifyWorld(t,r),r.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e=t.transformable,n=t.parentNode.sortable;n&&(n.dirty=!0);var i=t.parentNode.childNodes.indexOf(t);i>-1&&t.parentNode.childNodes.splice(i,1),e&&this.dirtifyWorld(t,e),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=xe(e,n,i));var r=t.transformable;if(!Be(e,r.origin)){var o=r.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,r)}},n.setLocalEulerAngles=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=xe(e,n,i));var r=t.transformable;Qe(r.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,r)},n.setLocalPosition=function(t,e){var n=t.transformable;e=xe(e[0],e[1],e[2]||0),Be(n.localPosition,e)||(Ne(n.localPosition,e),this.dirtifyLocal(t,n))},n.scaleLocal=function(t,e){var n=t.transformable;Me(n.localScale,n.localScale,xe(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},n.setLocalScale=function(t,e){var n=t.transformable,i=xe(e[0],e[1],e[2]||n.localScale[2]);Be(i,n.localScale)||(Ne(n.localScale,i),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,i,r){"number"==typeof e&&(e=an(e,n,i,r));var o=t.transformable;sn(o.localRotation,e),this.dirtifyLocal(t,o)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),mc(t,!0)},n.getPosition=function(t){var e=t.transformable;return ge(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return Te(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return me(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(be(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=ge(we(),e),i=Te(Ye(),e),r=me(we(),e);this.setLocalScale(t,r),this.setLocalPosition(t,n),this.setLocalRotation(t,i)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0])},n.getTransformedGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=this.getGeometryBounds(t,e);if(hn.isEmpty(n))return null;var i=new hn;return i.setFromTransformedAABB(n,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry,i=e?n.renderBounds:n.contentBounds||null;return i&&new hn(i.center,i.halfExtents)||new hn},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var i=t.renderable;if(!i.boundsDirty&&!e&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&e&&i.renderBounds)return i.renderBounds;var r=this.getTransformedGeometryBounds(t,e);t.childNodes.forEach((function(t){var i=n.getBounds(t,e);i&&(r?r.add(i):(r=new hn).update(i.center,i.halfExtents))}));var o=t.style.clipPath;if(o){var a,s=this.getTransformedGeometryBounds(o,!0);s&&(a=new hn).setFromTransformedAABB(s,this.getWorldTransform(t)),r?a&&(r=a.intersection(r)):r=a}return r&&(e?i.renderBounds=r:i.bounds=r),e?i.renderBoundsDirty=!1:i.boundsDirty=!1,r||new hn},n.getLocalBounds=function(t){if(t.parentNode){var e=le();t.parentNode.transformable&&(e=fe(le(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!hn.isEmpty(n)){var i=new hn;return i.setFromTransformedAABB(n,e),i}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,i,r=this.getGeometryBounds(t);hn.isEmpty(r)||(i=new hn).setFromTransformedAABB(r,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(i){var a=i.getMin(),s=a[0],u=a[1],c=i.getMax();return new wn(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new wn((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(e,n){var i=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,e.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||i.dirtifyWorldInternal(t,e)}));var r=e.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0),e.dispatchEvent(new Bi(t.ElementEvent.ATTR_MODIFIED,e,null,null,"modelMatrix",Bi.MODIFICATION,null,null))}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,i=0;n.length>i;i++)this.syncHierarchy(n[i])}},n.sync=function(t,e){if(e.localDirtyFlag&&(be(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,i=n&&n.transformable;null!==n&&i?de(e.worldTransform,i.worldTransform,e.localTransform):he(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),ie([ht(dc),oe("design:type",Function)],t.DefaultSceneGraphService.prototype,"sceneGraphSelectorFactory",void 0),t.DefaultSceneGraphService=ie([lt({token:Tc})],t.DefaultSceneGraphService);var bc,Ec=r.defineToken("ContextService",{multiple:!1});(bc=t.RenderReason||(t.RenderReason={}))[bc.CAMERA_CHANGED=0]="CAMERA_CHANGED",bc[bc.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",bc[bc.NONE=2]="NONE";var Sc=r.defineToken("RenderingContext"),wc=r.defineToken("RenderingPluginContribution");t.RenderingService=function(){function e(){this.renderingPluginProvider=void 0,this.renderingContext=void 0,this.sceneGraphService=void 0,this.styleValueRegistry=void 0,this.inited=!1,this.stats={total:0,rendered:0,renderedOnscreen:0},this.zIndexCounter=0,this.hooks={init:new Ku,dirtycheck:new hc(["object"]),cull:new hc(["object"]),beginFrame:new oc([]),beforeRender:new oc(["objectToRender"]),render:new oc(["objectToRender"]),afterRender:new oc(["objectToRender"]),endFrame:new oc([]),destroy:new oc([]),pick:new $u(["result"]),pointerDown:new oc(["event"]),pointerUp:new oc(["event"]),pointerMove:new oc(["event"]),pointerOut:new oc(["event"]),pointerOver:new oc(["event"]),pointerWheel:new oc(["event"]),pointerCancel:new oc(["event"])}}var n=e.prototype;return n.init=function(){var t=Ht(Gt().mark((function t(){var e=this;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.renderingPluginProvider.getContributions({cache:!1}).forEach((function(t){t.apply(e)})),t.next=3,this.hooks.init.promise();case 3:this.inited=!0;case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.render=function(t){this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root),(this.renderingContext.dirty||t.renderer.getConfig().enableDirtyRectangleRendering&&1===this.stats.total)&&(this.renderingContext.dirty||this.hooks.beginFrame.call(),this.stats.renderedOnscreen=this.stats.rendered,this.hooks.endFrame.call(),this.renderingContext.dirty=!1),this.renderingContext.renderReasons.clear())},n.renderDisplayObject=function(e){var n=this;this.styleValueRegistry.recalc(e);var i=this.hooks.dirtycheck.call(e);i&&(this.hooks.cull.call(i),this.stats.rendered++,this.renderingContext.dirty||(this.renderingContext.dirty=!0,this.hooks.beginFrame.call()),this.hooks.beforeRender.call(i),this.hooks.render.call(i),this.hooks.afterRender.call(i),e.renderable.dirty=!1),e.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var r=e.sortable,o=!1;r.dirty&&(r.sorted=e.childNodes.slice().sort(gc),o=!0,r.dirty=!1),(r.sorted||e.childNodes).forEach((function(t){n.renderDisplayObject(t)})),o&&e.forEach((function(e){e.emit(t.ElementEvent.RENDER_ORDER_CHANGED,{renderOrder:e.sortable.renderOrder})}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),ie([Bt(wc),oe("design:type",Object)],t.RenderingService.prototype,"renderingPluginProvider",void 0),ie([ht(Sc),oe("design:type",Object)],t.RenderingService.prototype,"renderingContext",void 0),ie([ht(Tc),oe("design:type",Object)],t.RenderingService.prototype,"sceneGraphService",void 0),ie([ht(xi),oe("design:type",Object)],t.RenderingService.prototype,"styleValueRegistry",void 0),t.RenderingService=ie([lt()],t.RenderingService);t.EventService=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).renderingContext=void 0,e.contextService=void 0,e.canvasConfig=void 0,e.displayObjectPool=void 0,e.rootTarget=void 0,e.cursor="default",e.mappingTable={},e.mappingState={trackingData:{}},e.eventPool=new Map,e.pickHandler=void 0,e.onPointerDown=function(){var t=Ht(Gt().mark((function t(n){var i;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Js){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:e.dispatchEvent(i=t.sent,"pointerdown"),"touch"===i.pointerType?e.dispatchEvent(i,"touchstart"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.dispatchEvent(i,2===i.button?"rightdown":"mousedown"),e.trackingData(n.pointerId).pressTargetsByButton[n.button]=i.composedPath(),e.freeEvent(i);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUp=function(){var t=Ht(Gt().mark((function t(n){var i,r,o,a,s,u,c,l;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Js){t.next=2;break}return t.abrupt("return");case 2:return i=performance.now(),t.next=5,e.createPointerEvent(n);case 5:if(e.dispatchEvent(r=t.sent,"pointerup"),"touch"===r.pointerType?e.dispatchEvent(r,"touchend"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||e.dispatchEvent(r,2===r.button?"rightup":"mouseup"),o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.pressTargetsByButton[n.button]),s=a,a&&!r.composedPath().includes(a)){for(u=a;u&&!r.composedPath().includes(u);)r.currentTarget=u,e.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?e.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||e.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),Oi.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[n.button],s=u}s&&((c=e.clonePointerEvent(r,"click")).target=s,c.path=[],o.clicksByButton[n.button]||(o.clicksByButton[n.button]={clickCount:0,target:c.target,timeStamp:i}),(l=o.clicksByButton[n.button]).target===c.target&&200>i-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=i,c.detail=l.clickCount,e.dispatchEvent(c,"mouse"===c.pointerType||"touch"===c.pointerType?"click":"pointertap"),e.freeEvent(c)),e.freeEvent(r);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerMove=function(){var t=Ht(Gt().mark((function t(n){var i,r,o,a,s,u,c,l,h,p;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Js){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:if(r="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.overTargets),!o.overTargets||a===i.target){t.next=23;break}return s="mousemove"===n.type?"mouseout":"pointerout",t.next=12,e.createPointerEvent(n,s,a||void 0);case 12:if(e.dispatchEvent(u=t.sent,"pointerout"),r&&e.dispatchEvent(u,"mouseout"),i.composedPath().includes(a)){t.next=22;break}return t.next=18,e.createPointerEvent(n,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!i.composedPath().includes(c.target);)c.currentTarget=c.target,e.notifyTarget(c),r&&e.notifyTarget(c,"mouseleave"),Oi.isNode(c.target)&&(c.target=c.target.parentNode);e.freeEvent(c);case 22:e.freeEvent(u);case 23:if(a===i.target){t.next=38;break}l=e.clonePointerEvent(i,"mousemove"===n.type?"mouseover":"pointerover"),e.dispatchEvent(l,"pointerover"),r&&e.dispatchEvent(l,"mouseover"),h=a&&Oi.isNode(a)&&a.parentNode;case 29:if(!h||h===(Oi.isNode(e.rootTarget)&&e.rootTarget.parentNode)){t.next=35;break}if(h!==i.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(Oi.isNode(e.rootTarget)&&e.rootTarget.parentNode)){for((p=e.clonePointerEvent(i,"pointerenter")).eventPhase=p.AT_TARGET;p.target&&p.target!==a&&p.target!==(Oi.isNode(e.rootTarget)&&e.rootTarget.parentNode);)p.currentTarget=p.target,e.notifyTarget(p),r&&e.notifyTarget(p,"mouseenter"),Oi.isNode(p.target)&&(p.target=p.target.parentNode);e.freeEvent(p)}e.freeEvent(l);case 38:e.dispatchEvent(i,"pointermove"),"touch"===i.pointerType&&e.dispatchEvent(i,"touchmove"),r&&(e.dispatchEvent(i,"mousemove"),e.cursor=e.getCursor(i.target)),o.overTargets=i.composedPath(),e.freeEvent(i);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOut=function(){var t=Ht(Gt().mark((function t(n){var i,r,o,a,s;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Js){t.next=2;break}return t.abrupt("return");case 2:if(!(i=e.trackingData(n.pointerId)).overTargets){t.next=19;break}return r="mouse"===n.pointerType||"pen"===n.pointerType,o=e.findMountedTarget(i.overTargets),t.next=8,e.createPointerEvent(n,"pointerout",o||void 0);case 8:return e.dispatchEvent(a=t.sent),r&&e.dispatchEvent(a,"mouseout"),t.next=13,e.createPointerEvent(n,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(Oi.isNode(e.rootTarget)&&e.rootTarget.parentNode);)s.currentTarget=s.target,e.notifyTarget(s),r&&e.notifyTarget(s,"mouseleave"),Oi.isNode(s.target)&&(s.target=s.target.parentNode);i.overTargets=null,e.freeEvent(a),e.freeEvent(s);case 19:e.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOver=function(){var t=Ht(Gt().mark((function t(n){var i,r,o,a;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Js){t.next=2;break}return t.abrupt("return");case 2:return i=e.trackingData(n.pointerId),t.next=5,e.createPointerEvent(n);case 5:for(o="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,e.dispatchEvent(r,"pointerover"),o&&e.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(e.cursor=e.getCursor(r.target)),(a=e.clonePointerEvent(r,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(Oi.isNode(e.rootTarget)&&e.rootTarget.parentNode);)a.currentTarget=a.target,e.notifyTarget(a),o&&e.notifyTarget(a,"mouseenter"),Oi.isNode(a.target)&&(a.target=a.target.parentNode);i.overTargets=r.composedPath(),e.freeEvent(r),e.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUpOutside=function(){var t=Ht(Gt().mark((function t(n){var i,r,o,a;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Js){t.next=2;break}return t.abrupt("return");case 2:return i=e.trackingData(n.pointerId),r=e.findMountedTarget(i.pressTargetsByButton[n.button]),t.next=6,e.createPointerEvent(n);case 6:if(o=t.sent,r){for(a=r;a;)o.currentTarget=a,e.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||e.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),Oi.isNode(a)&&(a=a.parentNode);delete i.pressTargetsByButton[n.button]}e.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onWheel=function(){var t=Ht(Gt().mark((function t(n){var i;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Qs){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createWheelEvent(n);case 4:e.dispatchEvent(i=t.sent),e.freeEvent(i);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e}Yt(e,t);var n=e.prototype;return n.init=function(){this.rootTarget=this.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},n.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new Sn(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},n.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new Sn(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},n.viewport2Canvas=function(t){var e=t.x,n=t.y,i=this.rootTarget.defaultView.getCamera(),r=this.canvasConfig,o=r.width,a=r.height,s=i.getPerspectiveInverse(),u=i.getWorldTransform(),c=de(le(),u,s),l=xe(e/o*2-1,2*(1-n/a)-1,0);return Fe(l,l,c),new Sn(l[0],l[1])},n.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),i=e.getViewTransform(),r=de(le(),n,i),o=xe(t.x,t.y,0);Fe(o,o,r);var a=this.canvasConfig;return new Sn((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},n.setPickHandler=function(t){this.pickHandler=t},n.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},n.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,i=e.length;i>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},n.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emit(e||t.type,t)},n.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=n.length-1;i>=1;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var r=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=r+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},n.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var i=0;2048>i&&t!==this.rootTarget;i++)Oi.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},n.hitTest=function(){var t=Ht(Gt().mark((function t(e){var n,i,r,o,a;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.viewportY,o=(r=this.canvasConfig).width,a=r.height,!(0>(n=e.viewportX)||0>i||n>o||i>a)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.isNativeEventFromCanvas=function(t){var e,n=this.contextService.getDomElement(),i=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(i){if(i===n)return!0;if(n&&n.contains)return n.contains(i)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},n.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=te(this.displayObjectPool.getHTMLs());!(e=n()).done;){var i=e.value;if(t.nativeEvent.composedPath().indexOf(i)>-1)return i}return null},n.pickTarget=function(){var t=Ht(Gt().mark((function t(e){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.createPointerEvent=function(){var t=Ht(Gt().mark((function t(e,n,i){var r,o;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.allocateEvent(Js),this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,o=this.getExistedHTML(r),null==i){t.next=11;break}t.t0=i,t.next=20;break;case 11:if(t.t1=o,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(r),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(r);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return r.target=t.t0,"string"==typeof n&&(r.type=n),t.abrupt("return",r);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),n.createWheelEvent=function(){var t=Ht(Gt().mark((function t(e){var n,i;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Qs),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,i=this.getExistedHTML(n),t.t0=i,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},n.clonePointerEvent=function(t,e){var n=this.allocateEvent(Js);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},n.copyPointerData=function(t,e){t instanceof Js&&e instanceof Js&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},n.copyMouseData=function(t,e){t instanceof Zs&&e instanceof Zs&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},n.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},n.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},n.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},n.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},n.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},n.notifyListeners=function(t,e){var n=t.currentTarget.emitter,i=n._events[e];if(i)if("fn"in i)i.once&&n.removeListener(e,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var r=0;i.length>r&&!t.propagationImmediatelyStopped;r++)i[r].once&&n.removeListener(e,i[r].fn,void 0,!0),i[r].fn.call(t.currentTarget||i[r].context,t)},n.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var i=t[n];if(!(i===this.rootTarget||Oi.isNode(i)&&i.parentNode===e))break;e=t[n]}return e},n.getCursor=function(t){for(var e=t;e;){var n=Gi.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Oi.isNode(e)&&e.parentNode}},e}(ne.EventEmitter),ie([ht(Sc),oe("design:type",Object)],t.EventService.prototype,"renderingContext",void 0),ie([ht(Ec),oe("design:type",Object)],t.EventService.prototype,"contextService",void 0),ie([ht(ae),oe("design:type",Object)],t.EventService.prototype,"canvasConfig",void 0),ie([ht(t.DisplayObjectPool),oe("design:type",t.DisplayObjectPool)],t.EventService.prototype,"displayObjectPool",void 0),ie([Y.postConstruct(),oe("design:type",Function),oe("design:paramtypes",[]),oe("design:returntype",void 0)],t.EventService.prototype,"init",null),t.EventService=ie([lt()],t.EventService),t.OffscreenCanvasCreator=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}(),t.OffscreenCanvasCreator=ie([lt()],t.OffscreenCanvasCreator);var kc={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Pc=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,xc=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),Nc=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source);t.TextService=function(){function t(){var t=this;this.cache={},this.offscreenCanvas=void 0,this.shouldBreakByKinsokuShorui=function(e,n){return!t.isBreakingSpace(n)&&!(!e||!Nc.exec(n)&&!xc.exec(e))},this.trimByKinsokuShorui=function(t){var e=[].concat(t),n=e[e.length-2];if(!n)return t;var i=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=i+e[e.length-1],e}}var e=t.prototype;return e.measureFont=function(t,e){if(this.cache[t])return this.cache[t];var n={ascent:0,descent:0,fontSize:0},i=this.offscreenCanvas.getOrCreateCanvas(e),r=this.offscreenCanvas.getOrCreateContext(e);r.font=t;var o=kc.MetricsString+kc.BaselineSymbol,a=Math.ceil(r.measureText(o).width),s=Math.ceil(r.measureText(kc.BaselineSymbol).width),u=kc.HeightMultiplier*s;s=s*kc.BaselineMultiplier|0,i.width=a,i.height=u,r.fillStyle="#f00",r.fillRect(0,0,a,u),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(o,0,s);var c=r.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var v=0;h>v;v+=4)if(255!==c[f+v]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.cache[t]=n,n},e.measureText=function(t,e,n){var i=e.fontSize,r=e.wordWrap,o=e.lineHeight,a=void 0===o?0:o,s=e.lineWidth,u=e.textBaseline,c=e.textAlign,l=e.letterSpacing,h=void 0===l?0:l,p=e.leading,f=void 0===p?0:p,d=fc(e),v=this.measureFont(d,n);0===v.fontSize&&(v.fontSize=i.value,v.ascent=i.value);var y=this.offscreenCanvas.getOrCreateContext(n);y.font=d;for(var g=(r?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=new Array(g.length),T=0,b=0;g.length>b;b++){var E=y.measureText(g[b]).width+(g[b].length-1)*h;m[b]=E,T=Math.max(T,E)}var S=T+s.value,w=a||v.fontSize+s.value,k=Math.max(w,v.fontSize+s.value)+(g.length-1)*(w+f),P=0;return"middle"===u.value?P=-k/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?P=-k:"top"!==u.value&&"hanging"!==u.value||(P=0),{font:d,width:S,height:k,lines:g,lineWidths:m,lineHeight:w+=f,maxLineWidth:T,fontProperties:v,lineMetrics:m.map((function(t,e){var n=0;return"center"===c.value?n-=t/2:"right"!==c.value&&"end"!==c.value||(n-=t),new wn(n-s.value/2,P+e*w,t+s.value,w)}))}},e.wordWrap=function(t,e,n){var i=this,r=e.wordWrapWidth,o=void 0===r?0:r,a=e.letterSpacing,s=void 0===a?0:a,u=this.offscreenCanvas.getOrCreateContext(n),c=o+s,l=[],h=0,p=0,f={},d=function(t){return i.getFromCache(t,s,f,u)};return Array.from(t).forEach((function(e,n){var r=t[n-1],o=t[n+1],a=d(e);if(i.isNewline(e))return h++,p=0,void(l[h]="");if(p>0&&p+a>c){if(h++,p=0,l[h]="",i.isBreakingSpace(e))return;i.canBreakInLastChar(e)||(l=i.trimToBreakable(l),p=i.sumTextWidthByCache(l[h]||"",f)),i.shouldBreakByKinsokuShorui(e,o)&&(l=i.trimByKinsokuShorui(l),p+=d(r||""))}p+=a,l[h]=(l[h]||"")+e})),l.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&kc.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&kc.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],i=this.findBreakableIndex(n);if(-1===i||!n)return e;var r=n.slice(i,i+1),o=i+(this.isBreakingSpace(r)?0:1);return e[e.length-1]+=n.slice(i+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!Pc.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!Pc.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,i){var r=n[t];if("number"!=typeof r){var o=t.length*e;r=i.measureText(t).width+o,n[t]=r}return r},t}(),ie([ht(t.OffscreenCanvasCreator),oe("design:type",t.OffscreenCanvasCreator)],t.TextService.prototype,"offscreenCanvas",void 0),t.TextService=ie([lt()],t.TextService),t.CircleUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n.value,height:2*n.value}},t}(),t.CircleUpdater=ie([lt({token:{token:Ci,named:t.Shape.CIRCLE}})],t.CircleUpdater),t.EllipseUpdater=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx.value,height:2*t.ry.value}},t}(),t.EllipseUpdater=ie([lt({token:{token:Ci,named:t.Shape.ELLIPSE}})],t.EllipseUpdater),t.RectUpdater=function(){function e(){}return e.prototype.update=function(e,n){var i=e.img,r=e.width,o=e.height,a=0,s=0;return r instanceof dr&&r.unit===t.UnitType.kPixels&&(a=r.value),o instanceof dr&&o.unit===t.UnitType.kPixels&&(s=o.value),i&&!Iu(i)&&(a||(a=i.width),s||(s=i.height)),r instanceof dr&&(r.value=a),o instanceof dr&&(o.value=s),{width:a,height:s}},e}(),t.RectUpdater=ie([lt({token:[{token:Ci,named:t.Shape.RECT},{token:Ci,named:t.Shape.IMAGE},{token:Ci,named:t.Shape.GROUP}]})],t.RectUpdater),t.TextUpdater=function(){function t(){this.textService=void 0}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline},e.update=function(t,e){var n,i,r=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(i=n.defaultView)||void 0===i?void 0:i.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.textService.measureText(r,t,l);t.metrics=h;var p=h.lineHeight,f=h.fontProperties,d=xe(h.width/2,h.height/2,0),v=[0,1],y=0;"center"===o.value?(y=a.value/2,v=[.5,1]):"right"!==o.value&&"end"!==o.value||(y=a.value,v=[1,1]);var g=0;return"middle"===s.value?g=d[1]:"top"===s.value||"hanging"===s.value?g=2*d[1]:"alphabetic"===s.value?g=p-f.ascent:"bottom"!==s.value&&"ideographic"!==s.value||(g=0),u&&(y+=u.value),c&&(g+=c.value),t.anchor=[new dr(v[0]),new dr(v[1]),new dr(0)],{width:2*d[0],height:2*d[1],offsetX:y,offsetY:g}},t}(),ie([ht(t.TextService),oe("design:type",t.TextService)],t.TextUpdater.prototype,"textService",void 0),t.TextUpdater=ie([lt({token:{token:Ci,named:t.Shape.TEXT}})],t.TextUpdater),t.LineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,i=t.x2,r=t.y2,o=Math.min(e.value,i.value),a=Math.max(e.value,i.value),s=Math.min(n.value,r.value);return{width:a-o,height:Math.max(n.value,r.value)-s}},t}(),t.LineUpdater=ie([lt({token:{token:Ci,named:t.Shape.LINE}})],t.LineUpdater),t.PolylineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),i=Math.max.apply(Math,e.map((function(t){return t[0]}))),r=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:i-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-r}},t}(),t.PolylineUpdater=ie([lt({token:[{token:Ci,named:t.Shape.POLYLINE},{token:Ci,named:t.Shape.POLYGON}]})],t.PolylineUpdater),t.PathUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),t.PathUpdater=ie([lt({token:{token:Ci,named:t.Shape.PATH}})],t.PathUpdater);var Cc,_c,Ac,Mc=Ot((function(e){Y.decorate(ct(),ne.EventEmitter),e(t.DisplayObjectPool),e(t.DefaultSceneGraphSelector),e({token:dc,useFactory:function(t){return function(){return t.container.get(vc)}}}),e(t.DefaultSceneGraphService),e(t.OffscreenCanvasCreator),e(t.TextService),e(t.CircleUpdater),e(t.EllipseUpdater),e(t.RectUpdater),e(t.TextUpdater),e(t.LineUpdater),e(t.PolylineUpdater),e(t.PathUpdater),e({token:Ni,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Ci,n)&&(e[n]=t.container.getNamed(Ci,n)),e[n]}}}),e(t.LayoutRegistry),e(t.DefaultStyleValueRegistry),e(t.LayoutEngine),e(t.LayoutEdges),e({token:Ga,useFactory:function(e){return function(n){var i=e.container.createChild();return i.register({token:ja,useValue:n}),i.get(t.LayoutEdges)}}}),e({token:Aa,useFactory:function(e){return function(n){var i=e.container.createChild();i.register(t.LayoutContext),i.register(t.LayoutChildren),i.register({token:Da,useFactory:function(e){return function(n){var i=e.container.createChild();return i.register({token:Ua,useValue:n}),i.get(t.LayoutChildren)}}}),i.register(t.FragmentResult),i.register({token:Ia,useFactory:function(e){return function(n,i){var r=e.container.createChild();return r.register({token:Ra,useValue:n}),r.register({token:La,useValue:i}),r.get(t.FragmentResult)}}}),i.register(t.LayoutFragment),i.register({token:Wa,useFactory:function(e){return function(n){var i=e.container.createChild();return i.register({token:qa,useValue:n}),i.get(t.LayoutFragment)}}});var r=i.get(Da),o=i.get(Wa),a=i.get(Ia);return i.register({token:Ma,useValue:qt({},n,{layoutChildrenFactory:r,layoutFragmentFactory:o,fragmentResultFactory:a})}),i.get(t.LayoutContext)}}})})),Oc=r.defineToken("DefaultCamera");(Cc=t.CameraType||(t.CameraType={}))[Cc.ORBITING=0]="ORBITING",Cc[Cc.EXPLORING=1]="EXPLORING",Cc[Cc.TRACKING=2]="TRACKING",(_c=t.CameraTrackingMode||(t.CameraTrackingMode={}))[_c.DEFAULT=0]="DEFAULT",_c[_c.ROTATIONAL=1]="ROTATIONAL",_c[_c.TRANSLATIONAL=2]="TRANSLATIONAL",_c[_c.CINEMATIC=3]="CINEMATIC",(Ac=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Ac.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Ac[Ac.PERSPECTIVE=1]="PERSPECTIVE";var Ic={UPDATED:"updated"},Rc=Math.PI/180,Lc=180/Math.PI,Dc=2e-4,Uc=function(e){function n(n,i){var r;return void 0===n&&(n=t.CameraType.EXPLORING),void 0===i&&(i=t.CameraTrackingMode.DEFAULT),(r=e.call(this)||this).canvas=void 0,r.matrix=le(),r.right=xe(1,0,0),r.up=xe(0,1,0),r.forward=xe(0,0,1),r.position=xe(0,0,1),r.focalPoint=xe(0,0,0),r.distanceVector=xe(0,0,-1),r.distance=1,r.azimuth=0,r.elevation=0,r.roll=0,r.relAzimuth=0,r.relElevation=0,r.relRoll=0,r.dollyingStep=0,r.maxDistance=1/0,r.minDistance=-1/0,r.zoom=1,r.rotateWorld=!1,r.fov=30,r.near=.1,r.far=1e3,r.aspect=1,r.left=void 0,r.rright=void 0,r.top=void 0,r.bottom=void 0,r.projectionMatrix=le(),r.projectionMatrixInverse=le(),r.jitteredProjectionMatrix=void 0,r.view=void 0,r.enableUpdate=!0,r.type=t.CameraType.EXPLORING,r.trackingMode=t.CameraTrackingMode.DEFAULT,r.projectionMode=t.CameraProjectionMode.PERSPECTIVE,r.frustum=new vn,r.landmarks=[],r.landmarkAnimationID=void 0,r.orthoMatrix=le(),r.setType(n,i),r}Yt(n,e);var i=n.prototype;return i.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},i.getProjectionMode=function(){return this.projectionMode},i.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},i.getPerspectiveInverse=function(){return this.projectionMatrixInverse},i.getFrustum=function(){return this.frustum},i.getPosition=function(){return this.position},i.getFocalPoint=function(){return this.focalPoint},i.getDollyingStep=function(){return this.dollyingStep},i.getNear=function(){return this.near},i.getFar=function(){return this.far},i.getZoom=function(){return this.zoom},i.getOrthoMatrix=function(){return this.orthoMatrix},i.getView=function(){return this.view},i.setEnableUpdate=function(t){this.enableUpdate=t},i.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},i.setProjectionMode=function(t){return this.projectionMode=t,this},i.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},i.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},i.getViewTransform=function(){return fe(le(),this.matrix)},i.getWorldTransform=function(){return this.matrix},i.jitterProjectionMatrix=function(t,e){var n,i,r=(n=le(),i=[t,e,0],n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=i[0],n[13]=i[1],n[14]=i[2],n[15]=1,n);this.jitteredProjectionMatrix=de(le(),r,this.projectionMatrix)},i.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},i.setMatrix=function(t){return this.matrix=t,this._update(),this},i.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},i.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},i.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},i.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},i.setViewOffset=function(e,n,i,r,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},i.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},i.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},i.setPerspective=function(e,n,i,r){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=i,this.near=e,this.far=n,this.aspect=r;var a=this.near*Math.tan(.5*Rc*this.fov)/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return Qn(this.projectionMatrix,c,c+u,a,a-s,e,this.far),ye(this.projectionMatrix,this.projectionMatrix,xe(1,-1,1)),fe(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},i.setOrthographic=function(e,n,i,r,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=i,this.bottom=r,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,p=l-u,f=l+u,d=h+c,v=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(p+=y*this.view.offsetX)+y*this.view.width,v=(d-=g*this.view.offsetY)-g*this.view.height}return Se(this.projectionMatrix,p,f,v,d,o,a),ye(this.projectionMatrix,this.projectionMatrix,xe(1,-1,1)),fe(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},i.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var i=Yn(t,e,n);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},i.setFocalPoint=function(e,n,i){void 0===n&&(n=this.focalPoint[1]),void 0===i&&(i=this.focalPoint[2]);var r,o,a,s,u,c,l,h,p,f,d,v,y,g=xe(0,1,0);if(this.focalPoint=Yn(e,n,i),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var m=Ae(we(),this.focalPoint,this.position);e=m[0],n=m[1],i=m[2];var T=Pe(m),b=Math.asin(n/T)*Lc,E=90+Math.atan2(i,e)*Lc,S=le();r=S,o=S,a=E*Rc,s=Math.sin(a),u=Math.cos(a),c=o[0],l=o[1],h=o[2],p=o[3],f=o[8],d=o[9],v=o[10],y=o[11],o!==r&&(r[4]=o[4],r[5]=o[5],r[6]=o[6],r[7]=o[7],r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15]),r[0]=c*u-f*s,r[1]=l*u-d*s,r[2]=h*u-v*s,r[3]=p*u-y*s,r[8]=c*s+f*u,r[9]=l*s+d*u,r[10]=h*s+v*u,r[11]=p*s+y*u,function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*i,t[5]=a*r+l*i,t[6]=s*r+h*i,t[7]=u*r+p*i,t[8]=c*r-o*i,t[9]=l*r-a*i,t[10]=h*r-s*i,t[11]=p*r-u*i}(S,S,b*Rc),g=Fe(we(),[0,1,0],S)}return fe(this.matrix,function(t,e,n,i){var r,o,a,s,u,c,l,h,p,f,d=e[0],v=e[1],y=e[2],g=i[0],m=i[1],T=i[2],b=n[0],E=n[1],S=n[2];return Math.abs(d-b)<se&&Math.abs(v-E)<se&&Math.abs(y-S)<se?pe(t):(l=d-b,h=v-E,p=y-S,r=m*(p*=f=1/Math.hypot(l,h,p))-T*(h*=f),o=T*(l*=f)-g*p,a=g*h-m*l,(f=Math.hypot(r,o,a))?(r*=f=1/f,o*=f,a*=f):(r=0,o=0,a=0),s=h*a-p*o,u=p*r-l*a,c=l*o-h*r,(f=Math.hypot(s,u,c))?(s*=f=1/f,u*=f,c*=f):(s=0,u=0,c=0),t[0]=r,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=p,t[11]=0,t[12]=-(r*d+o*v+a*y),t[13]=-(s*d+u*v+c*y),t[14]=-(l*d+h*v+p*y),t[15]=1,t)}(le(),this.position,this.focalPoint,g)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},i.getDistance=function(){return this.distance},i.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,Dc>this.distance&&(this.distance=Dc),this.dollyingStep=this.distance/100;var e=we(),n=this.forward,i=this.focalPoint;return e[0]=(t=this.distance)*n[0]+i[0],e[1]=t*n[1]+i[1],e[2]=t*n[2]+i[2],this._setPosition(e),this.triggerUpdate(),this},i.setMaxDistance=function(t){return this.maxDistance=t,this},i.setMinDistance=function(t){return this.minDistance=t,this},i.setAzimuth=function(e){return this.azimuth=qn(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.getAzimuth=function(){return this.azimuth},i.setElevation=function(e){return this.elevation=qn(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.getElevation=function(){return this.elevation},i.setRoll=function(e){return this.roll=qn(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.getRoll=function(){return this.roll},i.rotate=function(e,n,i){if(this.relElevation=qn(n),this.relAzimuth=qn(e),this.relRoll=qn(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var r=Xe(Ye(),[1,0,0],(this.rotateWorld?1:-1)*this.relElevation*Rc),o=Xe(Ye(),[0,1,0],(this.rotateWorld?1:-1)*this.relAzimuth*Rc),a=Xe(Ye(),[0,0,1],this.relRoll*Rc),s=Ke(Ye(),o,r);s=Ke(Ye(),s,a);var u=Ee(le(),s);ve(this.matrix,this.matrix,[0,0,-this.distance]),de(this.matrix,this.matrix,u),ve(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},i.pan=function(t,e){var n=Yn(t,e,0),i=ke(this.position);return _e(i,i,Oe(we(),this.right,n[0])),_e(i,i,Oe(we(),this.up,n[1])),this._setPosition(i),this.triggerUpdate(),this},i.dolly=function(e){var n,i=this.forward,r=ke(this.position);return n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance,r[0]+=n*i[0],r[1]+=n*i[1],r[2]+=n*i[2],this._setPosition(r),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&_e(this.focalPoint,r,this.distanceVector),this.triggerUpdate(),this},i.createLandmark=function(t,e){void 0===e&&(e={});var i=e.position,r=void 0===i?this.position:i,o=e.focalPoint,a=void 0===o?this.focalPoint:o,s=e.roll,u=e.zoom,c=new n;c.setType(this.type,void 0),c.setPosition(r[0],r[1]||this.position[1],r[2]||this.position[2]),c.setFocalPoint(a[0],a[1]||this.focalPoint[1],a[2]||this.focalPoint[2]),c.setRoll(s||this.roll),c.setZoom(u||this.zoom);var l,h,p={name:t,matrix:(l=c.matrix,h=new ue(16),h[0]=l[0],h[1]=l[1],h[2]=l[2],h[3]=l[3],h[4]=l[4],h[5]=l[5],h[6]=l[6],h[7]=l[7],h[8]=l[8],h[9]=l[9],h[10]=l[10],h[11]=l[11],h[12]=l[12],h[13]=l[13],h[14]=l[14],h[15]=l[15],h),right:ke(c.right),up:ke(c.up),forward:ke(c.forward),position:ke(c.position),focalPoint:ke(c.focalPoint),distanceVector:ke(c.distanceVector),distance:c.distance,dollyingStep:c.dollyingStep,azimuth:c.azimuth,elevation:c.elevation,roll:c.roll,relAzimuth:c.relAzimuth,relElevation:c.relElevation,relRoll:c.relRoll,zoom:c.zoom};return this.landmarks.push(p),p},i.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var i=Iu(t)?this.landmarks.find((function(e){return e.name===t})):t;if(i){var r=_n(e)?{duration:e}:e,o=r.easing,a=void 0===o?"linear":o,s=r.duration,u=void 0===s?100:s,c=r.easingFunction,l=void 0===c?void 0:c,h=r.onfinish,p=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(i),void(p&&p());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var f,d=i.position,v=i.focalPoint,y=i.zoom,g=i.roll,m=l||ou(a),T=function(){n.setFocalPoint(v),n.setPosition(d),n.setRoll(g),n.setZoom(y),n.computeMatrix(),n.triggerUpdate(),p&&p()};this.canvas.requestAnimationFrame((function t(e){void 0===f&&(f=e);var i=e-f;if(u<i)T();else{var r,o,a=m(i/u),s=we(),c=we();Ue(s,n.focalPoint,v,a),Ue(c,n.position,d,a),o=n.roll*(1-a)+g*a,r=n.zoom*(1-a)+y*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(r),He(s,v)+He(c,d)>.01?(n.computeMatrix(),n.triggerUpdate(),u>i&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):T()}}))}},i._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},i.computeMatrix=function(){var e=Xe(Ye(),[0,0,1],this.roll*Rc);pe(this.matrix);var n=Xe(Ye(),[1,0,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation*Rc),i=Xe(Ye(),[0,1,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth*Rc),r=Ke(Ye(),i,n);r=Ke(Ye(),r,e);var o=Ee(le(),r);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(ve(this.matrix,this.matrix,this.focalPoint),de(this.matrix,this.matrix,o),ve(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(ve(this.matrix,this.matrix,this.position),de(this.matrix,this.matrix,o))},i._setPosition=function(t,e,n){this.position=Yn(t,e,n);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()},i._getAxes=function(){Ne(this.right,Yn(qe(We(),[1,0,0,0],this.matrix))),Ne(this.up,Yn(qe(We(),[0,1,0,0],this.matrix))),Ne(this.forward,Yn(qe(We(),[0,0,1,0],this.matrix))),Re(this.right,this.right),Re(this.up,this.up),Re(this.forward,this.forward)},i._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],r=Pe(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Math.asin(n/r)*Lc,this.azimuth=Math.atan2(-e,-i)*Lc):(this.elevation=-Math.asin(n/r)*Lc,this.azimuth=-Math.atan2(-e,-i)*Lc)},i._getPosition=function(){Ne(this.position,Yn(qe(We(),[0,0,0,1],this.matrix))),this._getDistance()},i._getFocalPoint=function(){var t,e;!function(t,e,n){var i=e[0],r=e[1],o=e[2];t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=ce(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),_e(this.focalPoint,this.position,this.distanceVector),this._getDistance()},i._getDistance=function(){this.distanceVector=Ae(we(),this.focalPoint,this.position),this.distance=Pe(this.distanceVector),this.dollyingStep=this.distance/100},i._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=Xe(Ye(),[0,0,1],-this.roll*Math.PI/180);be(this.orthoMatrix,n,xe((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),xe(this.zoom,this.zoom,1),e)}},i.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=de(le(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.emit(Ic.UPDATED)}},i.syncFromLandmark=function(t){this.matrix=he(this.matrix,t.matrix),this.right=Ne(this.right,t.right),this.up=Ne(this.up,t.up),this.forward=Ne(this.forward,t.forward),this.position=Ne(this.position,t.position),this.focalPoint=Ne(this.focalPoint,t.focalPoint),this.distanceVector=Ne(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},n}(ne.EventEmitter),Fc=function(){function t(t){this.plugins=[],this.config=void 0,this.config=qt({enableDirtyCheck:!0,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}();let Bc=1;const Vc="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Gc=Date.now();let jc={},Hc=Date.now();const zc=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-Hc,i=n>16?0:16-n,r=Bc++;return jc[r]=t,Object.keys(jc).length>1||setTimeout((()=>{Hc=e;const t=jc;jc={},Object.keys(t).forEach((e=>t[e](Vc.performance&&"function"==typeof Vc.performance.now?Vc.performance.now():Date.now()-Gc)))}),i),r},Wc=t=>{delete jc[t]},qc=t=>"string"!=typeof t?zc:""===t?Vc.requestAnimationFrame:Vc[t+"RequestAnimationFrame"],Yc=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!qc(t))),Xc=qc(Yc),Kc="string"!=typeof(Zc=Yc)?Wc:""===Zc?Vc.cancelAnimationFrame:Vc[Zc+"CancelAnimationFrame"]||Vc[Zc+"CancelRequestAnimationFrame"];var Zc,Jc,Qc;Vc.requestAnimationFrame=Xc,Vc.cancelAnimationFrame=Kc,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:Xc,cancelAnimationFrame:Kc});var $c,tl,el=(Jc=function(){function e(){this.canvasConfig=void 0,this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this;e.hooks.dirtycheck.tap(Qc.tag,(function(e){if(e){var i=n.canvasConfig.renderer.getConfig().enableDirtyCheck,r=e.renderable,o=n.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED);return r.dirty||o||!i&&n.renderingContext.dirty?e:null}return e}))},e}(),Jc.tag="DirtyCheck",Qc=Jc);ie([ht(ae),oe("design:type",Object)],el.prototype,"canvasConfig",void 0),ie([ht(Sc),oe("design:type",Object)],el.prototype,"renderingContext",void 0),el=Qc=ie([lt({contrib:wc})],el);var nl,il,rl=r.defineToken("CullingStrategyContribution"),ol=($c=function(){function t(){this.strategyProvider=void 0}return t.prototype.apply=function(t){var e=this.strategyProvider.getContributions();t.hooks.cull.tap(tl.tag,(function(t){if(t){var n=t.cullable;return n.visible=0===e.length||e.every((function(e){return e.isVisible(t)})),!n.isCulled()&&t.isVisible()?t:null}return t})),t.hooks.afterRender.tap(tl.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t}(),$c.tag="Culling",tl=$c);ie([Bt(rl),oe("design:type",Object)],ol.prototype,"strategyProvider",void 0),ol=tl=ie([lt({contrib:wc})],ol);var al=(nl=function(){function e(){this.renderingContext=void 0,this.styleValueRegistry=void 0}return e.prototype.apply=function(e){var n=this,i=function(t){t.target.renderable.dirty=!0,e.dirtify()},r=function(){e.dirtify()},o=function(t){var i=t.target;n.styleValueRegistry.recalc(i),mc(i),e.dirtify()},a=function(t){mc(t.target),e.dirtify()};e.hooks.init.tapPromise(il.tag,Ht(Gt().mark((function e(){return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,i),n.renderingContext.root.addEventListener(t.ElementEvent.BOUNDS_CHANGED,r);case 4:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(il.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,i),n.renderingContext.root.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,r)}))},e}(),nl.tag="Prepare",il=nl);ie([ht(Sc),oe("design:type",Object)],al.prototype,"renderingContext",void 0),ie([ht(xi),oe("design:type",Object)],al.prototype,"styleValueRegistry",void 0),al=il=ie([lt({contrib:wc})],al);var sl,ul,cl=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],ll=function(){function e(){this.camera=void 0}var n=e.prototype;return n.isVisible=function(e){var n,i,r=e.cullable;if(!r.enable)return!0;var o=e.getRenderBounds();if(hn.isEmpty(o))return!1;var a=this.camera.getFrustum(),s=null===(n=e.parentNode)||void 0===n||null===(i=n.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||t.Mask.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==t.Mask.OUTSIDE,r.visible},n.computeVisibilityWithPlaneMask=function(e,n,i,r){if(i===t.Mask.OUTSIDE||i===t.Mask.INSIDE)return i;for(var o=t.Mask.INSIDE,a=cl.indexOf(e.nodeName)>-1,s=0,u=r.length;u>s;++s){var c=1<<s;if(0!=(i&c)&&(!a||4!==s&&5!==s)){var l=r[s],h=l.normal,p=l.distance;if(0>Le(h,n.getPositiveFarPoint(r[s]))+p)return t.Mask.OUTSIDE;0>Le(h,n.getNegativeFarPoint(r[s]))+p&&(o|=c)}}return o},e}();ie([ht(Oc),oe("design:type",Uc)],ll.prototype,"camera",void 0),ll=ie([lt({contrib:rl})],ll);var hl=(sl=function(){function t(){var t=this;this.canvasConfig=void 0,this.contextService=void 0,this.renderingService=void 0,this.renderingContext=void 0,this.eventService=void 0,this.autoPreventDefault=!0,this.rootPointerEvent=new Js(null),this.rootWheelEvent=new Qs(null),this.onPointerMove=function(e){var n,i,r=null===(n=t.renderingContext.root)||void 0===n||null===(i=n.ownerDocument)||void 0===i?void 0:i.defaultView;if(!r.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=te(t.normalizeToPointerEvent(e,r));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,r);t.eventService.mapEvent(s)}t.setCursor(t.eventService.cursor)}}}var e=t.prototype;return e.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView;this.eventService.setPickHandler(function(){var t=Ht(Gt().mark((function t(n){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.renderingService.hooks.pick.promise({position:n,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.hooks.pointerWheel.tap(ul.tag,(function(t){var n=e.normalizeWheelEvent(t);e.eventService.mapEvent(n)})),t.hooks.pointerDown.tap(ul.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var i=e.normalizeToPointerEvent(t,n);if(e.autoPreventDefault&&i[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r,o=te(i);!(r=o()).done;){var a=e.bootstrapEvent(e.rootPointerEvent,r.value,n);e.eventService.mapEvent(a)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerUp.tap(ul.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var i,r=e.contextService.getDomElement(),o=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":"",a=te(e.normalizeToPointerEvent(t,n));!(i=a()).done;){var s=e.bootstrapEvent(e.rootPointerEvent,i.value,n);s.type+=o,e.eventService.mapEvent(s)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerMove.tap(ul.tag,this.onPointerMove),t.hooks.pointerOver.tap(ul.tag,this.onPointerMove),t.hooks.pointerOut.tap(ul.tag,this.onPointerMove)},e.bootstrapEvent=function(t,e,n){t.pointerType=e.pointerType;var i=t;i.view=n,i.originalEvent=null,i.nativeEvent=e,i.pointerId=e.pointerId,i.width=e.width,i.height=e.height,i.isPrimary=e.isPrimary,i.pressure=e.pressure,i.tangentialPressure=e.tangentialPressure,i.tiltX=e.tiltX,i.tiltY=e.tiltY,i.twist=e.twist,this.transferMouseData(i,e);var r=this.eventService.client2Viewport(new Sn(e.clientX,e.clientY)),o=r.y;i.viewport.x=r.x,i.viewport.y=o;var a=this.eventService.viewport2Canvas(i.viewport),s=a.y;return i.canvas.x=a.x,i.canvas.y=s,i.global.copyFrom(i.canvas),i.offset.copyFrom(i.canvas),i.isTrusted=e.isTrusted,"pointerleave"===i.type&&(i.type="pointerout"),i.type.startsWith("mouse")&&(i.type=i.type.replace("mouse","pointer")),i.type.startsWith("touch")&&(i.type=ki[i.type]||i.type),i},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.eventService.client2Viewport(new Sn(t.clientX,t.clientY)),i=n.y;e.viewport.x=n.x,e.viewport.y=i;var r=this.eventService.viewport2Canvas(e.viewport),o=r.y;return e.canvas.x=r.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.contextService.applyCursorStyle(t||this.canvasConfig.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var i=0;t.changedTouches.length>i;i++){var r=t.changedTouches[i];Nn(r.button)&&(r.button=t.touches.length?1:0),Nn(r.buttons)&&(r.buttons=t.touches.length?1:0),Nn(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),Nn(r.width)&&(r.width=r.radiusX||1),Nn(r.height)&&(r.height=r.radiusY||1),Nn(r.tiltX)&&(r.tiltX=0),Nn(r.tiltY)&&(r.tiltY=0),Nn(r.pointerType)&&(r.pointerType="touch"),Nn(r.pointerId)&&(r.pointerId=r.identifier||0),Nn(r.pressure)&&(r.pressure=r.force||.5),Nn(r.twist)&&(r.twist=0),Nn(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=t.type,n.push(r)}else if(e.isMouseEvent(t)){var o=t;Nn(o.isPrimary)&&(o.isPrimary=!0),Nn(o.width)&&(o.width=1),Nn(o.height)&&(o.height=1),Nn(o.tiltX)&&(o.tiltX=0),Nn(o.tiltY)&&(o.tiltY=0),Nn(o.pointerType)&&(o.pointerType="mouse"),Nn(o.pointerId)&&(o.pointerId=1),Nn(o.pressure)&&(o.pressure=.5),Nn(o.twist)&&(o.twist=0),Nn(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}(),sl.tag="Event",ul=sl);ie([ht(ae),oe("design:type",Object)],hl.prototype,"canvasConfig",void 0),ie([ht(Ec),oe("design:type",Object)],hl.prototype,"contextService",void 0),ie([ht(t.RenderingService),oe("design:type",t.RenderingService)],hl.prototype,"renderingService",void 0),ie([ht(Sc),oe("design:type",Object)],hl.prototype,"renderingContext",void 0),ie([ht(t.EventService),oe("design:type",t.EventService)],hl.prototype,"eventService",void 0),hl=ul=ie([lt({contrib:wc})],hl);var pl,fl=Ot((function(e){Rt.register(e,wc,{cache:!1}),Rt.register(e,rl,{cache:!1}),e(t.RenderingService),e(t.EventService),e(hl),e(al),e(el),e(ol),e(ll)}));(pl=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",pl.BEFORE_RENDER="beforerender",pl.AFTER_RENDER="afterrender",pl.BEFORE_DESTROY="beforedestroy",pl.AFTER_DESTROY="afterdestroy",pl.RESIZE="resize";var dl=function(e){function n(t){var n;(n=e.call(this)||this).container=Ut.createChild(),n.document=void 0,n.customElements=void 0,n.requestAnimationFrame=void 0,n.cancelAnimationFrame=void 0,n.devicePixelRatio=void 0,n.supportsPointerEvents=void 0,n.supportsTouchEvents=void 0,n.isTouchEvent=void 0,n.isMouseEvent=void 0,n.Element=ks,n.frameId=void 0,n.eventService=void 0,n.renderingService=void 0,n.inited=!1,n.readyPromise=void 0,n.resolveReadyPromise=void 0,n.document=new Ks,n.document.defaultView=Qt(n),n.customElements=new _u;var i=t.container,r=t.canvas,o=t.offscreenCanvas,a=t.width,s=t.height,u=t.devicePixelRatio,c=t.renderer,l=t.background,h=t.requestAnimationFrame,p=t.cancelAnimationFrame,f=t.createImage,d=t.supportsPointerEvents,v=t.supportsTouchEvents,y=t.isTouchEvent,g=t.isMouseEvent;Ln(i,Qt(n));var m=a,T=s,b=u;return r&&(b=1>(b=u||Dn&&window.devicePixelRatio||1)?1:Math.ceil(b),m=a||r.width/b,T=s||r.height/b),n.devicePixelRatio=b,n.requestAnimationFrame=null!=h?h:Xc.bind(globalThis),n.cancelAnimationFrame=null!=p?p:Kc.bind(globalThis),n.supportsTouchEvents=null!=v?v:"ontouchstart"in globalThis,n.supportsPointerEvents=null!=d?d:!!globalThis.PointerEvent,n.isTouchEvent=null!=y?y:function(t){return n.supportsTouchEvents&&t instanceof globalThis.TouchEvent},n.isMouseEvent=null!=g?g:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},n.initRenderingContext({container:i,canvas:r,width:m,height:T,renderer:c,offscreenCanvas:o,devicePixelRatio:b,cursor:"default",background:l,createImage:f}),n.initDefaultCamera(m,T),n.initRenderer(c),n}Yt(n,e);var i=n.prototype;return i.initRenderingContext=function(e){var n=this;this.container.register({token:ae,useValue:e}),this.container.register({token:Sc,useValue:{root:this.document.documentElement,renderReasons:new Set,force:!1,dirty:!1}}),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_INSERTED,(function(t){n.mountChildren(t.detail.child)})),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_REMOVED,(function(t){n.unmountChildren(t.detail.child)}))},i.initDefaultCamera=function(e,n){var i=(new Uc).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3);i.canvas=this;var r=this.container.get(Sc);i.on(Ic.UPDATED,(function(){r.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.container.register({token:Oc,useValue:i})},i.getConfig=function(){return this.container.get(ae)},i.getContainer=function(){return this.container},i.getRoot=function(){return this.document.documentElement},i.getCamera=function(){return this.container.get(Oc)},i.getContextService=function(){return this.container.get(Ec)},i.getEventService=function(){return this.eventService},i.getRenderingService=function(){return this.renderingService},i.getRenderingContext=function(){return this.container.get(Sc)},i.getStats=function(){return this.getRenderingService().getStats()},i.destroy=function(e){(void 0===e&&(e=!0),this.emit(t.CanvasEvent.BEFORE_DESTROY,(function(){})),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),this.emit(t.CanvasEvent.AFTER_DESTROY,{})},i.changeSize=function(t,e){this.resize(t,e)},i.resize=function(e,n){var i=this.container.get(ae);i.width=e,i.height=n,this.getContextService().resize(e,n);var r=this.container.get(Oc),o=r.getProjectionMode();r.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?r.setOrthographic(e/-2,e/2,n/2,n/-2,r.getNear(),r.getFar()):r.setAspect(e/n),this.emit(t.CanvasEvent.RESIZE,{width:e,height:n})},i.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},i.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},i.removeChild=function(t,e){return void 0===e&&(e=!0),this.document.documentElement.removeChild(t,e)},i.removeChildren=function(t){void 0===t&&(t=!0),this.document.documentElement.removeChildren(t)},i.render=function(){(this.emit(t.CanvasEvent.BEFORE_RENDER,{}),this.container.isBound(t.RenderingService))&&this.container.get(t.RenderingService).render(this.getConfig());this.emit(t.CanvasEvent.AFTER_RENDER,{})},i.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},i.initRenderer=function(e){var n=this;if(!e)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.loadCommonContainerModule(),this.loadRendererContainerModule(e);var i=this.container.get(Ec);this.renderingService=this.container.get(t.RenderingService),this.eventService=this.container.get(t.EventService),i.init(),this.renderingService.init().then((function(){n.emit(t.CanvasEvent.READY,{}),n.readyPromise&&n.resolveReadyPromise(),n.inited=!0})),e.getConfig().enableAutoRendering&&this.run(),this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot())},i.loadCommonContainerModule=function(){this.container.unload(fl),this.container.load(fl,!0)},i.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.init(e.container)}))},i.setRenderer=function(t){var e=this,n=this.getConfig();if(n.renderer!==t){var i=n.renderer;n.renderer=t,this.destroy(!1),null==i||i.getPlugins().reverse().forEach((function(t){t.destroy(e.container)})),this.initRenderer(t)}},i.setCursor=function(t){this.getContextService().applyCursorStyle(t)},i.unmountChildren=function(e){var n=this,i=[];e.forEach((function(t){t.isConnected&&i.push(t)})),i.reverse().forEach((function(e){e instanceof xs&&e.disconnectedCallback&&e.disconnectedCallback(),e.emit(t.ElementEvent.UNMOUNTED,{}),e!==n.document.documentElement&&(e.ownerDocument=null),e.isConnected=!1}))},i.mountChildren=function(e){var n=this;e.forEach((function(e){e.isConnected||(e.ownerDocument=n.document,e.isConnected=!0,e.emit(t.ElementEvent.MOUNTED,{}),e instanceof xs&&e.connectedCallback&&e.connectedCallback())}))},i.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},i.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},i.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},i.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},i.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},i.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},Wt(n,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),n}(Mi);Ut.load(Mc);var vl=Ut.get(t.LayoutEngine);t.AABB=hn,t.AbstractLayoutDefinition=Fa,t.AbstractRenderer=Fc,t.Animation=zi,t.AnimationEffectTiming=lu,t.AnimationEvent=ji,t.AnimationTimeline=Ji,t.AsyncParallelHook=Ku,t.AsyncSeriesWaterfallHook=$u,t.BUILT_IN_PROPERTIES=Mu,t.BoundingSphere=fn,t.CSS=Ya,t.CSSColorValue=ir,t.CSSGradientValue=Cr,t.CSSKeywordValue=rr,t.CSSMathInvert=yr,t.CSSMathMax=Sr,t.CSSMathMin=Er,t.CSSMathNegate=gr,t.CSSMathProduct=kr,t.CSSMathSum=wr,t.CSSMathValue=vr,t.CSSMathVariadic=br,t.CSSNumericValue=ur,t.CSSNumericValueType=sr,t.CSSPropertyClipPath=bs,t.CSSPropertyColor=us,t.CSSPropertyFilter=cs,t.CSSPropertyLengthOrPercentage=os,t.CSSPropertyLengthOrPercentage12=ls,t.CSSPropertyLengthOrPercentage14=hs,t.CSSPropertyLocalPosition=as,t.CSSPropertyOffsetDistance=ds,t.CSSPropertyOffsetPath=fs,t.CSSPropertyOpacity=ss,t.CSSPropertyPath=ms,t.CSSPropertyPoints=Ts,t.CSSPropertyShadowBlur=ps,t.CSSPropertyText=Es,t.CSSPropertyTextTransform=Ss,t.CSSPropertyTransform=ys,t.CSSPropertyTransformOrigin=gs,t.CSSPropertyZIndex=vs,t.CSSRGB=Nr,t.CSSStyleValue=nr,t.CSSUnitValue=dr,t.Camera=Uc,t.CameraEvent=Ic,t.Canvas=dl,t.CanvasConfig=ae,t.Circle=Cs,t.ContextNode=La,t.ContextService=Ec,t.Cullable=Ui,t.CustomElement=xs,t.CustomElementRegistry=_u,t.CustomEvent=Ai,t.DCHECK=kn,t.DCHECK_EQ=Pn,t.DCHECK_NE=xn,t.DELEGATION_SPLITTER=":",t.DefaultCamera=Oc,t.Deferred=Ei,t.DisplayObject=ks,t.Document=Ks,t.EasingFunctions=mi,t.Element=Gi,t.Ellipse=As,t.EventTarget=Mi,t.FederatedEvent=_i,t.FederatedMouseEvent=Zs,t.FederatedPointerEvent=Js,t.FederatedWheelEvent=Qs,t.FragmentResultFactory=Ia,t.FragmentResultOptions=Ra,t.Frustum=vn,t.Geometry=Ii,t.GeometryAABBUpdater=Ci,t.GeometryUpdaterFactory=Ni,t.Group=Os,t.HTML=Xs,t.Image=Rs,t.KeyframeEffect=Cu,t.LayoutChildrenFactory=Da,t.LayoutChildrenOptions=Ua,t.LayoutContextFactory=Aa,t.LayoutContextOptions=Ma,t.LayoutEdgesFactory=Ga,t.LayoutEdgesOptions=ja,t.LayoutFragmentFactory=Wa,t.LayoutFragmentOptions=qa,t.LayoutObject=_a,t.Line=Ds,t.MOUSE_POINTER_ID=1,t.ManaSyringe=Vt,t.MutationEvent=Bi,t.MutationObserver=vu,t.MutationRecord=hu,t.Node=Oi,t.ObjectTyped=Si,t.Odeg=xr,t.Opx=Pr,t.PROPERTY_HANDLERS=Au,t.Path=Fs,t.Plane=dn,t.Point=Sn,t.Polygon=Vs,t.Polyline=js,t.Ray=En,t.Rect=zs,t.Rectangle=wn,t.Registration=du,t.Renderable=Ri,t.RenderingContext=Sc,t.RenderingPluginContribution=wc,t.SceneGraphSelector=vc,t.SceneGraphSelectorFactory=dc,t.SceneGraphService=Tc,t.Sortable=Fi,t.StyleValueRegistry=xi,t.SyncHook=oc,t.SyncWaterfallHook=hc,t.TOUCH_TO_POINTER=ki,t.Text=qs,t.Transform=Di,t.baseTypeToString=ar,t.camelCase=Ou,t.clamp=Wn,t.clampedMergeNumbers=Po,t.cleanExistedCanvas=Ln,t.clonePath=va,t.compareAnimations=Wi,t.convertAngleUnit=mo,t.convertEffectInput=Ru,t.convertPercentUnit=Eo,t.convertToDash=ti,t.convertToPath=function(e,n){void 0===n&&(n=!0);var i=[];switch(e.nodeName){case t.Shape.LINE:var r=e.parsedStyle;i=function(t,e,n,i){return[["M",t,e],["L",n,i]]}(r.x1.value,r.y1.value,r.x2.value,r.y2.value);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;i=ga(a.value,a.value,o.cx.value,o.cy.value);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;i=ga(s.rx.value,s.ry.value,s.cx.value,s.cy.value);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:i=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,p=u.y,f=u.radius,d=f&&f.some((function(t){return 0!==t.value}));i=function(t,e,n,i,r){if(r){var o=r[0],a=r[1],s=r[2],u=r[3];return[["M",n,o+i],o?["A",o,o,0,0,1,o+n,i]:null,["L",t-a+n,i],a?["A",a,a,0,0,1,t+n,a+i]:null,["L",t+n,e-s+i],s?["A",s,s,0,0,1,t-s+n,e+i]:null,["L",u+n,e+i],u?["A",u,u,0,0,1,n,e-u+i]:null,["Z"]].filter((function(t){return t}))}return[["M",n,i],["L",n+t,i],["L",n+t,i+e],["L",n,i+e],["Z"]]}(c.value,l.value,h.value,p.value,d&&f.map((function(t){return t.value})));break;case t.Shape.PATH:var v=e.parsedStyle.path,y=v.zCommandIndexes;i=[].concat(v.curve),y.forEach((function(t,e){i.splice(t+e,1,["Z"])}))}if(i.length)return function(t,e,n){var i;void 0===n&&(n=!0),n&&(i=e.getLocalTransform());var r=e.parsedStyle,o=r.defX,a=void 0===o?0:o,s=r.defY,u=void 0===s?0:s;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var o=xe(e[1]-a,e[2]-u,0);n&&Fe(o,o,i),r=""+e[0]+o[0]+","+o[1]}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var s=xe(e[1]-a,e[2]-u,0),c=xe(e[3]-a,e[4]-u,0),l=xe(e[5]-a,e[6]-u,0);n&&(Fe(s,s,i),Fe(c,c,i),Fe(l,l,i)),r=""+e[0]+s[0]+","+s[1]+","+c[0]+","+c[1]+","+l[0]+","+l[1]}else if("A"===e[0]){var h=xe(e[6]-a,e[7]-u,0);n&&Fe(h,h,i),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+h[0]+","+h[1]}return t+r}),"")}(i,e,n)},t.createVec3=Yn,t.decompose=$n,t.deg2rad=function(t){return t*(Math.PI/180)},t.deg2turn=function(t){return t/360},t.dirtifyToRoot=mc,t.equalSet=function(t,e){if(t.size!==e.size)return!1;for(var n,i=te(t);!(n=i()).done;){if(!e.has(n.value))return!1}return!0},t.equalizeSegments=la,t.formatAttribute=Vu,t.fromRotationTranslationScale=Jn,t.getAngle=qn,t.getDrawDirection=ha,t.getEasingFunction=Ti,t.getEuler=Zn,t.getPathArea=fa,t.getRotatedCurve=ya,t.getRotationInRadians=function(t){return Math.atan2(t[1],t[4])},t.getScaling=function(t,e){var n=e[3],i=e[4];return t[0]=Math.hypot(e[0],e[1]),t[1]=Math.hypot(n,i),t},t.getTranslation=function(t,e){return t[0]=e[6],t[1]=e[7],t},t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBoolean=Mn,t.isBrowser=Dn,t.isComparison=function(e){return e===t.CSSMathOperator.kMin||e===t.CSSMathOperator.kMax||e===t.CSSMathOperator.kClamp},t.isFunction=An,t.isNil=Cn,t.isNumber=_n,t.isObject=On,t.isString=Iu,t.isUndefined=Nn,t.layoutEngine=vl,t.makePerspective=Qn,t.makeQuerablePromise=bi,t.makeTiming=ku,t.mergeColors=lo,t.mergeDimensionList=bo,t.mergeDimensions=go,t.mergeNumberLists=function(t,e){if(t.length==e.length)return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t}]},t.mergeNumbers=ko,t.mergePaths=Ta,t.mergeTransforms=es,t.normalizeKeyframes=Eu,t.normalizeTimingInput=Pu,t.numberToString=So,t.numericTimingToObject=xu,t.parseAngle=yo,t.parseColor=co,t.parseDimension=ho,t.parseDimensionArray=To,t.parseFilter=Na,t.parseLength=po,t.parseLengthOrPercentage=vo,t.parseNumber=wo,t.parseNumberList=function(t){return Iu(t)?t.split(" ").map(wo):t.map(wo)},t.parseParam=Pa,t.parsePath=ma,t.parsePoints=ba,t.parseTransform=Qa,t.parseTransformOrigin=ns,t.parserPercentage=fo,t.rad2deg=Xn,t.reverseCurve=da,t.setDOMSize=function(t,e,n){Dn&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.sortByZIndex=gc,t.toFontString=fc,t.turn2deg=Kn,t.typeCheck=mr,t.unitTypeToBaseType=or,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
17
|
+
Gt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return k()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),i}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function p(){}function f(){}var d={};s(d,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(P([])));v&&v!==e&&n.call(v,i)&&(d=v);var g=f.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;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()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=f,s(g,"constructor",f),s(f,"constructor",p),p.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(T.prototype),s(T.prototype,o,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new T(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),s(g,a,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=P,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},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),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function jt(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Ht(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){jt(o,r,i,a,s,"next",t)}function s(t){jt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function zt(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Wt(t,e,n){return e&&zt(t.prototype,e),n&&zt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function qt(){return qt=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},qt.apply(this,arguments)}function Yt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Xt(t,e)}function Xt(t,e){return Xt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Xt(t,e)}function Kt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Zt(t,e,n){return Zt=Kt()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&Xt(i,n.prototype),i},Zt.apply(null,arguments)}function Jt(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;o.length>r;r++)0>e.indexOf(n=o[r])&&(i[n]=t[n]);return i}function Qt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);e>n;n++)r[n]=t[n];return r}function te(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $t(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$t(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}}}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 ee,ne=r((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=new Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=new Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(p=1,u=new Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));(ee=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",ee.COLOR="<color>",ee.PAINT="<paint>",ee.NUMBER="<number>",ee.ANGLE="<angle>",ee.OPACITY_VALUE="<opacity-value>",ee.SHADOW_BLUR="<shadow-blur>",ee.LENGTH="<length>",ee.PERCENTAGE="<percentage>",ee.LENGTH_PERCENTAGE="<length> | <percentage>",ee.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",ee.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",ee.LIST_OF_POINTS="<list-of-points>",ee.PATH="<path>",ee.FILTER="<filter>",ee.Z_INDEX="<z-index>",ee.OFFSET_PATH="<offset-path>",ee.OFFSET_DISTANCE="<offset-distance>",ee.CLIP_PATH="<clip-path>",ee.TRANSFORM="<transform>",ee.TRANSFORM_ORIGIN="<transform-origin>",ee.TEXT="<text>",ee.TEXT_TRANSFORM="<text-transform>";var re,ie,oe,ae,se,ue=i.defineToken("StyleValueRegistry");(re=t.UnitType||(t.UnitType={}))[re.kUnknown=0]="kUnknown",re[re.kNumber=1]="kNumber",re[re.kPercentage=2]="kPercentage",re[re.kEms=3]="kEms",re[re.kExs=4]="kExs",re[re.kPixels=5]="kPixels",re[re.kCentimeters=6]="kCentimeters",re[re.kMillimeters=7]="kMillimeters",re[re.kInches=8]="kInches",re[re.kPoints=9]="kPoints",re[re.kPicas=10]="kPicas",re[re.kQuarterMillimeters=11]="kQuarterMillimeters",re[re.kViewportWidth=12]="kViewportWidth",re[re.kViewportHeight=13]="kViewportHeight",re[re.kViewportInlineSize=14]="kViewportInlineSize",re[re.kViewportBlockSize=15]="kViewportBlockSize",re[re.kViewportMin=16]="kViewportMin",re[re.kViewportMax=17]="kViewportMax",re[re.kSmallViewportWidth=18]="kSmallViewportWidth",re[re.kSmallViewportHeight=19]="kSmallViewportHeight",re[re.kSmallViewportInlineSize=20]="kSmallViewportInlineSize",re[re.kSmallViewportBlockSize=21]="kSmallViewportBlockSize",re[re.kSmallViewportMin=22]="kSmallViewportMin",re[re.kSmallViewportMax=23]="kSmallViewportMax",re[re.kLargeViewportWidth=24]="kLargeViewportWidth",re[re.kLargeViewportHeight=25]="kLargeViewportHeight",re[re.kLargeViewportInlineSize=26]="kLargeViewportInlineSize",re[re.kLargeViewportBlockSize=27]="kLargeViewportBlockSize",re[re.kLargeViewportMin=28]="kLargeViewportMin",re[re.kLargeViewportMax=29]="kLargeViewportMax",re[re.kDynamicViewportWidth=30]="kDynamicViewportWidth",re[re.kDynamicViewportHeight=31]="kDynamicViewportHeight",re[re.kDynamicViewportInlineSize=32]="kDynamicViewportInlineSize",re[re.kDynamicViewportBlockSize=33]="kDynamicViewportBlockSize",re[re.kDynamicViewportMin=34]="kDynamicViewportMin",re[re.kDynamicViewportMax=35]="kDynamicViewportMax",re[re.kContainerWidth=36]="kContainerWidth",re[re.kContainerHeight=37]="kContainerHeight",re[re.kContainerInlineSize=38]="kContainerInlineSize",re[re.kContainerBlockSize=39]="kContainerBlockSize",re[re.kContainerMin=40]="kContainerMin",re[re.kContainerMax=41]="kContainerMax",re[re.kRems=42]="kRems",re[re.kChs=43]="kChs",re[re.kUserUnits=44]="kUserUnits",re[re.kDegrees=45]="kDegrees",re[re.kRadians=46]="kRadians",re[re.kGradians=47]="kGradians",re[re.kTurns=48]="kTurns",re[re.kMilliseconds=49]="kMilliseconds",re[re.kSeconds=50]="kSeconds",re[re.kHertz=51]="kHertz",re[re.kKilohertz=52]="kKilohertz",re[re.kDotsPerPixel=53]="kDotsPerPixel",re[re.kDotsPerInch=54]="kDotsPerInch",re[re.kDotsPerCentimeter=55]="kDotsPerCentimeter",re[re.kFraction=56]="kFraction",re[re.kInteger=57]="kInteger",re[re.kQuirkyEms=58]="kQuirkyEms",(ie=t.UnitCategory||(t.UnitCategory={}))[ie.kUNumber=0]="kUNumber",ie[ie.kUPercent=1]="kUPercent",ie[ie.kULength=2]="kULength",ie[ie.kUAngle=3]="kUAngle",ie[ie.kUTime=4]="kUTime",ie[ie.kUFrequency=5]="kUFrequency",ie[ie.kUResolution=6]="kUResolution",ie[ie.kUOther=7]="kUOther",(oe=t.ValueRange||(t.ValueRange={}))[oe.kAll=0]="kAll",oe[oe.kNonNegative=1]="kNonNegative",oe[oe.kInteger=2]="kInteger",oe[oe.kNonNegativeInteger=3]="kNonNegativeInteger",oe[oe.kPositiveInteger=4]="kPositiveInteger",(ae=t.Nested||(t.Nested={}))[ae.kYes=0]="kYes",ae[ae.kNo=1]="kNo",(se=t.ParenLess||(t.ParenLess={}))[se.kYes=0]="kYes",se[se.kNo=1]="kNo";var ce,le=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];(ce=t.CSSStyleValueType||(t.CSSStyleValueType={}))[ce.kUnknownType=0]="kUnknownType",ce[ce.kUnparsedType=1]="kUnparsedType",ce[ce.kKeywordType=2]="kKeywordType",ce[ce.kUnitType=3]="kUnitType",ce[ce.kSumType=4]="kSumType",ce[ce.kProductType=5]="kProductType",ce[ce.kNegateType=6]="kNegateType",ce[ce.kInvertType=7]="kInvertType",ce[ce.kMinType=8]="kMinType",ce[ce.kMaxType=9]="kMaxType",ce[ce.kClampType=10]="kClampType",ce[ce.kTransformType=11]="kTransformType",ce[ce.kPositionType=12]="kPositionType",ce[ce.kURLImageType=13]="kURLImageType",ce[ce.kColorType=14]="kColorType",ce[ce.kUnsupportedColorType=15]="kUnsupportedColorType";var he,pe,fe=function(){function e(){}e.parse=function(t,e){return[][0]},e.parseAll=function(t,e){return[]},e.unitFromName=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:this.stringToUnitType(e):t.UnitType.kUnknown},e.unitTypeToUnitCategory=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return t.UnitCategory.kUNumber;case t.UnitType.kPercentage:return t.UnitCategory.kUPercent;case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:return t.UnitCategory.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.UnitCategory.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.UnitCategory.kUAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.UnitCategory.kUFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.UnitCategory.kUResolution;default:return t.UnitCategory.kUOther}},e.unitTypeToString=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:case t.UnitType.kUserUnits:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:case t.UnitType.kQuirkyEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},e.stringToUnitType=function(t){return le.find((function(e){return e.name===t})).unit_type},e.canonicalUnitTypeForCategory=function(e){switch(e){case t.UnitCategory.kUNumber:return t.UnitType.kNumber;case t.UnitCategory.kULength:return t.UnitType.kPixels;case t.UnitCategory.kUPercent:return t.UnitType.kUnknown;case t.UnitCategory.kUTime:return t.UnitType.kSeconds;case t.UnitCategory.kUAngle:return t.UnitType.kDegrees;case t.UnitCategory.kUFrequency:return t.UnitType.kHertz;case t.UnitCategory.kUResolution:return t.UnitType.kDotsPerPixel;default:return t.UnitType.kUnknown}},e.conversionToCanonicalUnitsScaleFactor=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kSeconds:case t.UnitType.kHertz:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kCentimeters:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kDotsPerInch:case t.UnitType.kPoints:case t.UnitType.kPicas:break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360;break;case t.UnitType.kKilohertz:n=1e3}return n},e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isViewportPercentageLength=function(e){return e>=t.UnitType.kViewportWidth&&t.UnitType.kDynamicViewportMax>=e},e.isContainerPercentageLength=function(e){return e>=t.UnitType.kContainerWidth&&t.UnitType.kContainerMax>=e},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kUserUnits>=e||e==t.UnitType.kQuirkyEms},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kExs||e===t.UnitType.kRems||e===t.UnitType.kChs||this.isViewportPercentageLength(e)||this.isContainerPercentageLength(e)},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds},e.isFrequency=function(e){return e==t.UnitType.kHertz||e==t.UnitType.kKilohertz},e.isResolution=function(e){return e>=t.UnitType.kDotsPerPixel&&t.UnitType.kDotsPerCentimeter>=e},e.isFlex=function(e){return e===t.UnitType.kFraction};var n=e.prototype;return n.toString=function(){return this.buildCSSText(t.Nested.kNo,t.ParenLess.kNo,"")},n.isNumericValue=function(){return this.getType()>=t.CSSStyleValueType.kUnitType&&this.getType()<=t.CSSStyleValueType.kClampType},e}(),de=function(e){function n(t){var n;return(n=e.call(this)||this).colorSpace=void 0,n.colorSpace=t,n}Yt(n,e);var r=n.prototype;return r.getType=function(){return t.CSSStyleValueType.kColorType},r.to=function(t){return this},n}(fe),ye=function(e){function n(t){var n;return(n=e.call(this)||this).value=void 0,n.value=t,n}Yt(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value)},r.getType=function(){return t.CSSStyleValueType.kKeywordType},r.buildCSSText=function(t,e,n){return n+this.value},n}(fe);function ve(t){if(!t)throw new Error}function ge(t,e){if(t!==e)throw new Error}function me(t,e){if(t===e)throw new Error}function Te(t){return void 0===t}function be(t){return null==t}function Ee(t){return"number"==typeof t}function Se(t){return"function"==typeof t}function we(t){return"boolean"==typeof t}function Pe(t){return"[object Object]"===Object.prototype.toString.call(t)}function ke(e){switch(me(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kExs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:case t.UnitType.kRems:case t.UnitType.kChs:return t.BaseType.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.BaseType.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.BaseType.kAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.BaseType.kFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.BaseType.kResolution;case t.UnitType.kFraction:return t.BaseType.kFlex;case t.UnitType.kPercentage:return t.BaseType.kPercent;default:return t.BaseType.kLength}}function xe(e){switch(e){case t.BaseType.kLength:return"length";case t.BaseType.kAngle:return"angle";case t.BaseType.kTime:return"time";case t.BaseType.kFrequency:return"frequency";case t.BaseType.kResolution:return"resolution";case t.BaseType.kFlex:return"flex";case t.BaseType.kPercent:return"percent"}return""}(he=t.CSSMathOperator||(t.CSSMathOperator={})).kAdd="+",he.kSubtract="-",he.kMultiply="*",he.kDivide="/",he.kMin="min",he.kMax="max",he.kClamp="clamp",he.kInvalid="",(pe=t.BaseType||(t.BaseType={}))[pe.kLength=0]="kLength",pe[pe.kAngle=1]="kAngle",pe[pe.kTime=2]="kTime",pe[pe.kFrequency=3]="kFrequency",pe[pe.kResolution=4]="kResolution",pe[pe.kFlex=5]="kFlex",pe[pe.kPercent=6]="kPercent",pe[pe.kNumBaseTypes=7]="kNumBaseTypes";var Ce=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=t.BaseType.kPercent,this.hasPercentHint=!1,this.exponents=new Array(t.BaseType.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(ke(e),n)}var n=e.prototype;return n.applyPercentHint=function(e){me(e,t.BaseType.kPercent),this.setExponent(e,this.exponent(e)+this.exponent(t.BaseType.kPercent)),this.setExponent(t.BaseType.kPercent,0),this.percentHint=e,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return me(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},n.exponent=function(t){return this.exponents[t]},n.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},e.negateExponents=function(t){return t.exponents.forEach((function(t){return-1*t})),t},n.matchesBaseType=function(e){return me(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesBaseTypePercentage=function(e){return me(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},e.add=function(e,n,r){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint),ge(e.percentHint,n.percentHint);for(var i=0;t.BaseType.kNumBaseTypes>i;++i){var o=i;if(e.exponents[i]!==n.exponents[i]&&(o!==t.BaseType.kPercent&&(e.applyPercentHint(o),n.applyPercentHint(o)),e.exponents[i]!==n.exponents[i]))return e}return e},e.multiply=function(e,n,r){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint);for(var i=0;t.BaseType.kNumBaseTypes>i;++i){var o=i;e.setExponent(o,e.exponent(o)+n.exponent(o))}return e},e}(),Ne=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}Yt(n,e),n.fromNumberish=function(e){return"number"==typeof e?new Re(e,t.UnitType.kNumber):e},n.fromPercentish=function(e){return"number"==typeof e?new Re(100*e,t.UnitType.kPercentage):e};var r=n.prototype;return r.getType=function(){return t.CSSStyleValueType.kUnknownType},r.equals=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=_e(n);return i.every((function(e){return t.equals(e)}))},r.add=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=_e(n);Ae(t.CSSStyleValueType.kSumType,i,this);var o=Oe(i,t.CSSMathOperator.kAdd);return o||He.create(i)},r.sub=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=_e(n);i=i.map((function(t){return t.negate()})),Ae(t.CSSStyleValueType.kSumType,i,this);var o=Oe(i,t.CSSMathOperator.kAdd);return o||He.create(i)},r.mul=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=_e(n);Ae(t.CSSStyleValueType.kProductType,i,this);var o=Ie(i);return o||ze.create(i)},r.div=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=_e(n);i=i.map((function(t){return t.invert()})),Ae(t.CSSStyleValueType.kProductType,i,this);var o=Ie(i);return o||ze.create(i)},r.min=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=_e(n);Ae(t.CSSStyleValueType.kMinType,i,this);var o=Oe(i,t.CSSMathOperator.kMin);return o||Ge.create(i)},r.max=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=_e(n);Ae(t.CSSStyleValueType.kMaxType,i,this);var o=Oe(i,t.CSSMathOperator.kMax);return o||je.create(i)},r.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=Me(e[0]);return r?(n="string"==typeof t?Re.unitFromName(t):t,r.convertTo(n)):null},r.toSum=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=0,o=e;o.length>i;i++){var a=o[i];if(!n.isValidUnit(n.unitFromName(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=te(s);!(u=l()).done;){var h=u.value,p=Me(h);if(!p)return null;c.push(p)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var f=He.create(c);return ve(!!f),f}for(var d=[],y=function(){var t=n.unitFromName(g[v]);ve(n.isValidUnit(t));var e=c.reduce((function(e,n,r){if(n){var i=n.convertTo(t);i&&(e+=i.value,c[r]=null)}return e}),0);d.push(new Re(e,t))},v=0,g=e;g.length>v;v++)y();if(c.some((function(t){return!!t})))throw new Error("There were leftover terms that were not converted");return He.create(d)},r.type=function(){var e={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},n=this.type_.exponent(t.BaseType.kLength);return n&&(e.length=n),(n=this.type_.exponent(t.BaseType.kAngle))&&(e.angle=n),(n=this.type_.exponent(t.BaseType.kTime))&&(e.time=n),(n=this.type_.exponent(t.BaseType.kFrequency))&&(e.frequency=n),(n=this.type_.exponent(t.BaseType.kResolution))&&(e.resolution=n),(n=this.type_.exponent(t.BaseType.kFlex))&&(e.flex=n),(n=this.type_.exponent(t.BaseType.kPercent))&&(e.percent=n),this.type_.hasPercentHint&&(e.percentHint=xe(this.type_.percentHint)),e},n.isValidUnit=function(e){return e!==t.UnitType.kUserUnits&&!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e)||this.isFrequency(e)||this.isResolution(e)||this.isFlex(e))},r.negate=function(){return Ue.create(this)},r.invert=function(){return De.create(this)},n}(fe);function _e(t){return t.map(Ne.fromNumberish)}function Ae(t,e,n){ve(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function Me(t){return 0===Object.keys(t.units).length?new Re(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Re(t.value,Number(Object.keys(t.units)[0])):null}function Oe(e,n){ve(!!e.length);var r=e[0]instanceof Re?e[0]:null;if(!r)return null;for(var i=r.value,o=1;e.length>o;o++){var a=e[o]instanceof Re?e[o]:null;if(!a||a.unit!==r.unit)return null;n===t.CSSMathOperator.kAdd?i+=a.value:n===t.CSSMathOperator.kMax?i=Math.max(i,a.value):n===t.CSSMathOperator.kMin&&(i=Math.min(i,a.value))}return new Re(i,r.unit)}function Ie(e){ve(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var o=e[i]instanceof Re?e[i]:null;if(!o)return null;if(o.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=o.unit}r*=o.value}return new Re(r,n)}var Re=function(e){function n(r,i){var o,a;return void 0===i&&(i=t.UnitType.kNumber),a="string"==typeof i?n.unitFromName(i):i,ve(n.isValidUnit(a)),(o=e.call(this,new Ce(a))||this).unit=void 0,o.value=void 0,o.unit=a,o.value=r,o}Yt(n,e),n.toCanonicalUnit=function(t){return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(t))},n.toCanonicalUnitIfPossible=function(e){var n=this.toCanonicalUnit(e);return n===t.UnitType.kUnknown?e:n},n.formatInfinityOrNaN=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(ve(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},n.formatNumber=function(t,e){return void 0===e&&(e=""),t+e};var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=n.toCanonicalUnit(this.unit);if(r!==n.toCanonicalUnit(e)||r===t.UnitType.kUnknown)return null;var i=fe.conversionToCanonicalUnitsScaleFactor(this.unit)/fe.conversionToCanonicalUnitsScaleFactor(e);return new n(this.value*i,e)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return t.CSSStyleValueType.kUnitType},r.sumValue=function(){var e=[],r={};return this.unit!==t.UnitType.kNumber&&(r[n.toCanonicalUnitIfPossible(this.unit)]=1),e.push({value:this.value*fe.conversionToCanonicalUnitsScaleFactor(this.unit),units:r}),e},r.negate=function(){return new n(-this.value,this.unit)},r.invert=function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new n(1/this.value,this.unit):De.create(this)},r.buildCSSText=function(e,r,i){var o;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:o=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kQuirkyEms:case t.UnitType.kExs:case t.UnitType.kRems:case t.UnitType.kChs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kHertz:case t.UnitType.kKilohertz:case t.UnitType.kTurns:case t.UnitType.kFraction:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:var a=this.value,s=n.unitTypeToString(this.unit);if(-999999>a||a>999999){var u=n.unitTypeToString(this.unit);o=!Number.isFinite(a)||Number.isNaN(a)?n.formatInfinityOrNaN(a,u):n.formatNumber(a,u)}else o=""+a+s}return i+=o},n}(Ne),Le=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.isUnitValue=function(){return!1},e}(Ne),De=function(e){function n(t,n){var r;return(r=e.call(this,n)||this).value=void 0,r.operator="invert",r.value=t,r}Yt(n,e),n.create=function(t){return new n(t,Ce.negateExponents(t.type_))};var r=n.prototype;return r.clone=function(){return new n(this.value,this.type_)},r.getType=function(){return t.CSSStyleValueType.kInvertType},r.equals=function(e){return e.getType()===t.CSSStyleValueType.kInvertType&&this.value.equals(e.value)},r.sumValue=function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)},r.buildCSSText=function(e,n,r){return n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc("),r=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+="1 / "),n===t.ParenLess.kNo&&(r+=")"),r},n}(Le),Ue=function(e){function n(t,n){var r;return(r=e.call(this,n)||this).value=void 0,r.operator="negate",r.value=t,r}Yt(n,e),n.create=function(t){return new n(t,t.type_)};var r=n.prototype;return r.clone=function(){return new n(this.value,this.type_)},r.getType=function(){return t.CSSStyleValueType.kNegateType},r.equals=function(e){return e.getType()===t.CSSStyleValueType.kNegateType&&this.value.equals(e.value)},r.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},r.buildCSSText=function(e,n,r){return n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc("),r=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+="-"),n===t.ParenLess.kNo&&(r+=")"),r},n}(Le);function Fe(t,e,n){for(var r=t[0].type_,i=1;t.length>i;i++)r=e(r,t[i].type_,false);return r}var Be,Ve=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).values=void 0,r.values=e,r}Yt(e,t);var n=e.prototype;return n.numericValues=function(){return this.values},n.equals=function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))},e}(Le),Ge=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="min",t}Yt(n,e),n.create=function(t){return new n(t,Fe(t,Ce.add))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kMinType},r.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=te(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},r.buildCSSText=function(e,n,r){r+="min(";for(var i,o=!0,a=te(this.numericValues());!(i=a()).done;){o||(r+=", "),o=!1,r=i.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,r)}return r+=")"},n}(Ve),je=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="max",t}Yt(n,e),n.create=function(t){return new n(t,Fe(t,Ce.add))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kMaxType},r.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=te(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},r.buildCSSText=function(e,n,r){r+="max(";for(var i,o=!0,a=te(this.numericValues());!(i=a()).done;){o||(r+=", "),o=!1,r=i.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,r)}return r+=")"},n}(Ve),He=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="sum",t}Yt(n,e),n.create=function(t){return new n(t,Fe(t,Ce.add))},n.numericTypeFromUnitMap=function(t){var e=new Ce;return Object.keys(t).forEach((function(n){var r=t[n];e=Ce.multiply(e,new Ce(Number(n),r),false),ve(!0)})),e},n.canCreateNumericTypeFromSumValue=function(t){var e=this;ve(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return Ce.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kSumType},r.sumValue=function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(qt({},e)):t[n].value+=e.value}))})),n.canCreateNumericTypeFromSumValue(t)?t:null},r.buildCSSText=function(e,n,r){n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc(");var i=this.numericValues();r=i[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r);for(var o=1;i.length>o;o++){var a=i[o];r=a.getType()===t.CSSStyleValueType.kNegateType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" - "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" + ")}return n===t.ParenLess.kNo&&(r+=")"),r},n}(Ve),ze=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="product",t}Yt(n,e),n.create=function(t){return new n(t,Fe(t,Ce.multiply))},n.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){me(e[n].value,0);var r=n in t?t[n].value:0;r+e[n].value===0?delete t[n]:t[n]=r+e[n].value})),t};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kProductType},r.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(e){var r=e.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(e){i.push({value:t.value*e.value,units:n.multiplyUnitMaps(t.units,e.units)})}))})),t=i})),t},r.buildCSSText=function(e,n,r){n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc(");var i=this.numericValues();r=i[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r);for(var o=1;i.length>o;o++){var a=i[o];r=a.getType()===t.CSSStyleValueType.kInvertType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" / "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" * ")}return n===t.ParenLess.kNo&&(r+=")"),r},n}(Ve),We=new Re(0,"px"),qe=new Re(0,"deg"),Ye=function(t){function e(e,n,r,i,o){var a;return void 0===i&&(i=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}Yt(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(de);(Be=t.GradientPatternType||(t.GradientPatternType={}))[Be.Constant=0]="Constant",Be[Be.LinearGradient=1]="LinearGradient",Be[Be.RadialGradient=2]="RadialGradient",Be[Be.Pattern=3]="Pattern";var Xe=function(e){function n(t,n){var r;return(r=e.call(this)||this).type=void 0,r.value=void 0,r.type=t,r.value=n,r}Yt(n,e);var r=n.prototype;return r.clone=function(){return new n(this.type,this.value)},r.buildCSSText=function(e,n,r){var i="";return this.type===t.GradientPatternType.LinearGradient?i="linear-gradient("+this.value.steps.map((function(t){return t.join(",")})).join(",")+")":this.type===t.GradientPatternType.RadialGradient?i="radial-gradient("+this.value.steps.map((function(t){return t.join(",")})).join(",")+")":this.type===t.GradientPatternType.Pattern&&(i="url("+this.value.src+")"),r+i},r.getType=function(){return t.CSSStyleValueType.kColorType},n}(fe);function Ke(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ze(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Je(){}var Qe=.7,$e=1/Qe,tn="\\s*([+-]?\\d+)\\s*",en="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",nn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rn=/^#([0-9a-f]{3,8})$/,on=new RegExp("^rgb\\("+[tn,tn,tn]+"\\)$"),an=new RegExp("^rgb\\("+[nn,nn,nn]+"\\)$"),sn=new RegExp("^rgba\\("+[tn,tn,tn,en]+"\\)$"),un=new RegExp("^rgba\\("+[nn,nn,nn,en]+"\\)$"),cn=new RegExp("^hsl\\("+[en,nn,nn]+"\\)$"),ln=new RegExp("^hsla\\("+[en,nn,nn,en]+"\\)$"),hn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function pn(){return this.rgb().formatHex()}function fn(){return this.rgb().formatRgb()}function dn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=rn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?yn(e):3===n?new mn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?vn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?vn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=on.exec(t))?new mn(e[1],e[2],e[3],1):(e=an.exec(t))?new mn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=sn.exec(t))?vn(e[1],e[2],e[3],e[4]):(e=un.exec(t))?vn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=cn.exec(t))?Sn(e[1],e[2]/100,e[3]/100,1):(e=ln.exec(t))?Sn(e[1],e[2]/100,e[3]/100,e[4]):hn.hasOwnProperty(t)?yn(hn[t]):"transparent"===t?new mn(NaN,NaN,NaN,0):null}function yn(t){return new mn(t>>16&255,t>>8&255,255&t,1)}function vn(t,e,n,r){return r>0||(t=e=n=NaN),new mn(t,e,n,r)}function gn(t){return t instanceof Je||(t=dn(t)),t?new mn((t=t.rgb()).r,t.g,t.b,t.opacity):new mn}function mn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Tn(){return"#"+En(this.r)+En(this.g)+En(this.b)}function bn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function En(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Sn(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Pn(t,e,n,r)}function wn(t){if(t instanceof Pn)return new Pn(t.h,t.s,t.l,t.opacity);if(t instanceof Je||(t=dn(t)),!t)return new Pn;if(t instanceof Pn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Pn(a,s,u,t.opacity)}function Pn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function kn(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Ke(Je,dn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:pn,formatHex:pn,formatHsl:function(){return wn(this).formatHsl()},formatRgb:fn,toString:fn}),Ke(mn,(function(t,e,n,r){return 1===arguments.length?gn(t):new mn(t,e,n,null==r?1:r)}),Ze(Je,{brighter:function(t){return t=null==t?$e:Math.pow($e,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Qe:Math.pow(Qe,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Tn,formatHex:Tn,formatRgb:bn,toString:bn})),Ke(Pn,(function(t,e,n,r){return 1===arguments.length?wn(t):new Pn(t,e,n,null==r?1:r)}),Ze(Je,{brighter:function(t){return t=null==t?$e:Math.pow($e,t),new Pn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Qe:Math.pow(Qe,t),new Pn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(.5>n?n:1-n)*e,i=2*n-r;return new mn(kn(240>t?t+120:t-240,i,r),kn(t,i,r),kn(120>t?t+240:t-120,i,r),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var xn={},Cn=0;function Nn(t,e){if(t){var n="string"==typeof t?t:t.id||Cn++;xn[n]&&xn[n].destroy(),xn[n]=e}}var _n="undefined"!=typeof window&&void 0!==window.document,An=.1,Mn="function"==typeof Float32Array,On=function(t,e){return 1-3*e+3*t},In=function(t,e){return 3*e-6*t},Rn=function(t){return 3*t},Ln=function(t,e,n){return((On(e,n)*t+In(e,n))*t+Rn(e))*t},Dn=function(t,e,n){return 3*On(e,n)*t*t+2*In(e,n)*t+Rn(e)},Un=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Mn?new Float32Array(11):new Array(11),o=0;11>o;++o)i[o]=Ln(o*An,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=An;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*An,s=Dn(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Ln(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+An,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=Dn(e,n,r);if(0===o)return e;e-=(Ln(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:Ln(a(t),e,r)}},Fn=1e-6,Bn="undefined"!=typeof Float32Array?Float32Array:Array;function Vn(){var t=new Bn(9);return Bn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Gn(){var t=new Bn(16);return Bn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function jn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Hn(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function zn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=n*s-r*a,T=n*u-i*a,b=n*c-o*a,E=r*u-i*s,S=r*c-o*s,w=i*c-o*u,P=l*y-h*d,k=l*v-p*d,x=l*g-f*d,C=h*v-p*y,N=h*g-f*y,_=p*g-f*v,A=m*_-T*N+b*C+E*x-S*k+w*P;return A?(t[0]=(s*_-u*N+c*C)*(A=1/A),t[1]=(i*N-r*_-o*C)*A,t[2]=(y*w-v*S+g*E)*A,t[3]=(p*S-h*w-f*E)*A,t[4]=(u*x-a*_-c*k)*A,t[5]=(n*_-i*x+o*k)*A,t[6]=(v*b-d*w-g*T)*A,t[7]=(l*w-p*b+f*T)*A,t[8]=(a*N-s*x+c*P)*A,t[9]=(r*x-n*N-o*P)*A,t[10]=(d*S-y*b+g*m)*A,t[11]=(h*b-l*S-f*m)*A,t[12]=(s*k-a*C-u*P)*A,t[13]=(n*C-r*k+i*P)*A,t[14]=(y*T-d*E-v*m)*A,t[15]=(l*E-h*T+p*m)*A,t):null}function Wn(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],T=n[0],b=n[1],E=n[2],S=n[3];return t[0]=T*r+b*s+E*h+S*y,t[1]=T*i+b*u+E*p+S*v,t[2]=T*o+b*c+E*f+S*g,t[3]=T*a+b*l+E*d+S*m,t[4]=(T=n[4])*r+(b=n[5])*s+(E=n[6])*h+(S=n[7])*y,t[5]=T*i+b*u+E*p+S*v,t[6]=T*o+b*c+E*f+S*g,t[7]=T*a+b*l+E*d+S*m,t[8]=(T=n[8])*r+(b=n[9])*s+(E=n[10])*h+(S=n[11])*y,t[9]=T*i+b*u+E*p+S*v,t[10]=T*o+b*c+E*f+S*g,t[11]=T*a+b*l+E*d+S*m,t[12]=(T=n[12])*r+(b=n[13])*s+(E=n[14])*h+(S=n[15])*y,t[13]=T*i+b*u+E*p+S*v,t[14]=T*o+b*c+E*f+S*g,t[15]=T*a+b*l+E*d+S*m,t}function qn(t,e,n){var r,i,o,a,s,u,c,l,h,p,f,d,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*g+e[12],t[13]=i*y+u*v+p*g+e[13],t[14]=o*y+c*v+f*g+e[14],t[15]=a*y+l*v+d*g+e[15]),t}function Yn(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Xn(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Kn(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function Zn(t,e){var n=new Bn(3);Kn(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,c=e[4]*r,l=e[5]*i,h=e[6]*o,p=e[8]*r,f=e[9]*i,d=e[10]*o,y=a+l+d,v=0;return y>0?(v=2*Math.sqrt(y+1),t[3]=.25*v,t[0]=(h-f)/v,t[1]=(p-u)/v,t[2]=(s-c)/v):a>l&&a>d?(v=2*Math.sqrt(1+a-l-d),t[3]=(h-f)/v,t[0]=.25*v,t[1]=(s+c)/v,t[2]=(p+u)/v):l>d?(v=2*Math.sqrt(1+l-a-d),t[3]=(p-u)/v,t[0]=(s+c)/v,t[1]=.25*v,t[2]=(h+f)/v):(v=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/v,t[0]=(p+u)/v,t[1]=(h+f)/v,t[2]=.25*v),t}function Jn(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,y=a*l,v=a*h,g=s*h,m=u*c,T=u*l,b=u*h,E=r[0],S=r[1],w=r[2],P=i[0],k=i[1],x=i[2],C=(1-(y+g))*E,N=(f+b)*E,_=(d-T)*E,A=(f-b)*S,M=(1-(p+g))*S,O=(v+m)*S,I=(d+T)*w,R=(v-m)*w,L=(1-(p+y))*w;return t[0]=C,t[1]=N,t[2]=_,t[3]=0,t[4]=A,t[5]=M,t[6]=O,t[7]=0,t[8]=I,t[9]=R,t[10]=L,t[11]=0,t[12]=n[0]+P-(C*P+A*k+I*x),t[13]=n[1]+k-(N*P+M*k+R*x),t[14]=n[2]+x-(_*P+O*k+L*x),t[15]=1,t}function Qn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=p-v,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var $n=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t};function tr(){var t=new Bn(3);return Bn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function er(t){var e=new Bn(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function nr(t){return Math.hypot(t[0],t[1],t[2])}function rr(t,e,n){var r=new Bn(3);return r[0]=t,r[1]=e,r[2]=n,r}function ir(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function or(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ar(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function sr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ur(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function cr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function lr(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function hr(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function pr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function dr(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function yr(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function vr(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=Fn*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=Fn*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=Fn*Math.max(1,Math.abs(i),Math.abs(s))}var gr,mr=sr,Tr=ur,br=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},Er=nr;gr=tr();function Sr(){var t=new Bn(4);return Bn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function wr(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=Sr()}();function Pr(){var t=new Bn(4);return Bn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function kr(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function xr(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function Cr(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],p=e[3],f=n[0],d=n[1],y=n[2],v=n[3];return 0>(o=c*f+l*d+h*y+p*v)&&(o=-o,f=-f,d=-d,y=-y,v=-v),1-o>Fn?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*c+u*f,t[1]=s*l+u*d,t[2]=s*h+u*y,t[3]=s*p+u*v,t}function Nr(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function _r(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var Ar,Mr,Or,Ir,Rr,Lr,Dr=function(t,e,n,r){var i=new Bn(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},Ur=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Fr=xr,Br=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};Ar=tr(),Mr=rr(1,0,0),Or=rr(0,1,0),Ir=Pr(),Rr=Pr(),Lr=Vn();!function(){var t,e=(t=new Bn(2),Bn!=Float32Array&&(t[0]=0,t[1]=0),t)}();function Vr(t,e,n){return n?Math.min(t,e)===t?e:Math.max(t,n)===t?n:t:Math.max(t,e)===e?t:e}function Gr(t){return void 0===t?0:t>360||-360>t?t%360:t}function jr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ee(t)?rr(t,e,n):Array.isArray(t)&&3===t.length?er(t):rr(t[0],t[1]||e,t[2]||n)}function Hr(t){return t*(180/Math.PI)}function zr(t){return 360*t}function Wr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=Kn(tr(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function qr(t,e,n,r,i){var o,a,s,u,c,l,h,p,f,d,y=Math.cos(t),v=Math.sin(t);return o=r*y,a=i*v,s=0,u=-r*v,c=i*y,l=0,h=e,p=n,f=1,(d=new Bn(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=p,d[8]=f,d}function Yr(t,e,n,r,i,o,a){var s=2*o/(r-i),u=(n+e)/(n-e),c=(r+i)/(r-i),l=-(a+o)/(a-o),h=-2*a*o/(a-o);return t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function Xr(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=Hr(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Kr=function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substr(1):t},Zr=function(t){return Math.pow(t,2)},Jr=function(t){return Math.pow(t,3)},Qr=function(t){return Math.pow(t,4)},$r=function(t){return Math.pow(t,5)},ti=function(t){return Math.pow(t,6)},ei=function(t){return 1-Math.cos(t*Math.PI/2)},ni=function(t){return 1-Math.sqrt(1-t*t)},ri=function(t){return t*t*(3*t-2)},ii=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},oi=function(t,e){void 0===e&&(e=[]);var n=e[0],r=e[1],i=void 0===r?.5:r,o=Vr(Number(void 0===n?1:n),1,10),a=Vr(Number(i),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-a/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/a)},ai=function(t,e,n){void 0===e&&(e=[]);var r=e[0],i=void 0===r?1:r,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;i=Vr(i,.1,1e3),a=Vr(a,.1,1e3),u=Vr(u,.1,1e3),l=Vr(l,.1,1e3);var h=Math.sqrt(a/i),p=u/(2*Math.sqrt(a*i)),f=1>p?h*Math.sqrt(1-p*p):0,d=1>p?(p*h-l)/f:-l+h,y=n?n*t/1e3:t;return y=1>p?Math.exp(-y*p*h)*(1*Math.cos(f*y)+d*Math.sin(f*y)):(1+d*y)*Math.exp(-y*h),0===t||1===t?t:1-y},si=function(t,e){void 0===e&&(e=[]);var n=e[0],r=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(Vr(t,0,1)*r)/r},ui=function(t,e){void 0===e&&(e=[]);return Un(e[0],e[1],e[2],e[3])(t)},ci=Un(.42,0,1,1),li=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},hi=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},pi=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},fi={steps:si,"step-start":function(t){return si(t,[1,"start"])},"step-end":function(t){return si(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":ui,ease:function(t){return ui(t,[.25,.1,.25,1])},in:ci,out:li(ci),"in-out":hi(ci),"out-in":pi(ci),"in-quad":Zr,"out-quad":li(Zr),"in-out-quad":hi(Zr),"out-in-quad":pi(Zr),"in-cubic":Jr,"out-cubic":li(Jr),"in-out-cubic":hi(Jr),"out-in-cubic":pi(Jr),"in-quart":Qr,"out-quart":li(Qr),"in-out-quart":hi(Qr),"out-in-quart":pi(Qr),"in-quint":$r,"out-quint":li($r),"in-out-quint":hi($r),"out-in-quint":pi($r),"in-expo":ti,"out-expo":li(ti),"in-out-expo":hi(ti),"out-in-expo":pi(ti),"in-sine":ei,"out-sine":li(ei),"in-out-sine":hi(ei),"out-in-sine":pi(ei),"in-circ":ni,"out-circ":li(ni),"in-out-circ":hi(ni),"out-in-circ":pi(ni),"in-back":ri,"out-back":li(ri),"in-out-back":hi(ri),"out-in-back":pi(ri),"in-bounce":ii,"out-bounce":li(ii),"in-out-bounce":hi(ii),"out-in-bounce":pi(ii),"in-elastic":oi,"out-elastic":li(oi),"in-out-elastic":hi(oi),"out-in-elastic":pi(oi),spring:ai,"spring-in":ai,"spring-out":li(ai),"spring-in-out":hi(ai),"spring-out-in":pi(ai)},di=function(t){return fi[function(t){return Kr(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||fi.linear},yi=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,r=!1,i=!1,o=t.then((function(t){return i=!0,n=!1,e=t,t}),(function(t){throw r=!0,n=!1,t}));return o.isFulfilled=function(){return i},o.isPending=function(){return n},o.isRejected=function(){return r},o.getFullFilledValue=function(){return e},o},vi=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},gi={keys:Object.keys,values:Object.values,entries:Object.entries};function mi(t,e){if(_n)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function Ti(t){var e=mi(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}function bi(t){var e=mi(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}var Ei={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Si=function(t){return t};function wi(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Pi="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",ki=new RegExp("cubic-bezier\\("+Pi+","+Pi+","+Pi+","+Pi+"\\)"),xi=/steps\(\s*(\d+)\s*\)/,Ci=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Ni(t){var e=ki.exec(t);if(e)return Un.apply(void 0,e.slice(1).map(Number));var n=xi.exec(t);if(n)return wi(Number(n[1]),0);var r=Ci.exec(t);return r?wi(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):di(t)}function _i(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Ai(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e<Math.min(n.delay+t+n.endDelay,r)?3:2}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}function Mi(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}function Oi(t){return!be(t)&&"string"==typeof t}function Ii(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(Ri(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Ni(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Di(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.style[n.property]=n.interpolation(i)}));else for(var n in r)Ri(n)&&(t.style[n]=null)}}function Ri(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Li=function(t,e,n){return function(r){return n(Ui(t,e,r))}};function Di(t,e,n,r){var i=e,o=n,a=Ut.get(ue),s=a.getMetadata(t);if(s&&s.syntax&&s.interpolable){var u=a.getPropertySyntax(s.syntax);if(u){u.parser&&(i=u.parser(e,r),o=u.parser(n,r));var c=u.mixer(i,o,r);if(c){var l=Li.apply(void 0,c);return function(t){return 0===t?e:1===t?n:l(t)}}}}return Li(!1,!0,(function(t){return t?n:e}))}function Ui(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(var r=[],i=0;t.length>i;i++)r.push(Ui(t[i],e[i],n));return r}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var Fi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign",values:{middle:"center"}},src:{alias:"img"}};function Bi(t,e){var n,r=Mi(t),i=Fi[r];return[r=(null==i?void 0:i.alias)||r,(null==i||null===(n=i.values)||void 0===n?void 0:n[e])||e]}function Vi(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Gi(t,e){return.001>Math.abs(t-e)}function ji(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}var Hi={box:function(t,e,n,r){return ji([t,n],[e,r])},length:function(t,e,n,r){return Vi(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return 0>a?Vi(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?Vi(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function zi(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Wi(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function qi(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(Gi(s,0))Gi(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;Gi(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function Yi(t,e,n,r,i,o,a,s,u){var c=zi(t,n,i,a,u),l=zi(e,r,o,s,u),h=Hi.pointAt(t,e,n,r,u),p=Hi.pointAt(n,r,i,o,u),f=Hi.pointAt(i,o,a,s,u),d=Hi.pointAt(h.x,h.y,p.x,p.y,u),y=Hi.pointAt(p.x,p.y,f.x,f.y,u);return[[t,e,h.x,h.y,d.x,d.y,c,l],[c,l,y.x,y.y,f.x,f.y,a,s]]}function Xi(t,e,n,r,i,o,a,s,u){if(0===u)return function(t,e){for(var n=0,r=t.length,i=0;r>i;i++)n+=Vi(t[i],e[i],t[(i+1)%r],e[(i+1)%r]);return n/2}([t,n,i,a],[e,r,o,s]);var c=Yi(t,e,n,r,i,o,a,s,.5),l=[].concat(c[0],[u-1]),h=[].concat(c[1],[u-1]);return Xi.apply(void 0,l)+Xi.apply(void 0,h)}var Ki={extrema:qi,box:function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=qi(t,n,i,a),h=qi(e,r,o,s),p=0;l.length>p;p++)u.push(zi(t,n,i,a,l[p]));for(var f=0;h.length>f;f++)c.push(zi(e,r,o,s,h[f]));return ji(u,c)},length:function(t,e,n,r,i,o,a,s){return Xi(t,e,n,r,i,o,a,s,3)},nearestPoint:function(t,e,n,r,i,o,a,s,u,c,l){return function(t,e,n,r,i,o){var a=-1,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,p=0;c>=p;p++){var f=p*l,d=[i.apply(void 0,t.concat([f])),i.apply(void 0,e.concat([f]))],y=Vi(u[0],u[1],d[0],d[1]);s>y&&(a=f,s=y)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var g=0;32>g&&h>=1e-4;g++){var m=a-h,T=a+h,b=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],E=Vi(u[0],u[1],b[0],b[1]);if(m>=0&&s>E)a=m,s=E;else{var S=[i.apply(void 0,t.concat([T])),i.apply(void 0,e.concat([T]))],w=Vi(u[0],u[1],S[0],S[1]);1>=T&&s>w?(a=T,s=w):h*=.5}}return{x:i.apply(void 0,t.concat([a])),y:i.apply(void 0,e.concat([a]))}}([t,n,i,a],[e,r,o,s],u,c,zi,l)},pointDistance:function(t,e,n,r,i,o,a,s,u,c,l){var h=this.nearestPoint(t,e,n,r,i,o,a,s,u,c,l);return Vi(h.x,h.y,u,c)},interpolationAt:zi,pointAt:function(t,e,n,r,i,o,a,s,u){return{x:zi(t,n,i,a,u),y:zi(e,r,o,s,u)}},divide:function(t,e,n,r,i,o,a,s,u){return Yi(t,e,n,r,i,o,a,s,u)},tangentAngle:function(t,e,n,r,i,o,a,s,u){var c=Wi(t,n,i,a,u),l=Wi(e,r,o,s,u);return(Math.atan2(l,c)+2*Math.PI)%(2*Math.PI)}};var Zi,Ji=function(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=Vi(r[0],r[1],i[0],i[1])}return e}(t)};(Zi=t.Shape||(t.Shape={})).GROUP="g",Zi.CIRCLE="circle",Zi.ELLIPSE="ellipse",Zi.IMAGE="image",Zi.RECT="rect",Zi.LINE="line",Zi.POLYLINE="polyline",Zi.POLYGON="polygon",Zi.TEXT="text",Zi.PATH="path",Zi.HTML="html",Zi.MESH="mesh";var Qi=i.defineToken("CanvasConfig");function $i(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function to(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Ki.length.apply(Ki,r):0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=$i(n,r,e),s=$i(r,i,e),u=$i(i,o,e),c=$i(a,s,e),l=$i(s,u,e),h=$i(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function eo(t,e,n){var r=to(t),i=to(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:eo(y[0],y[1],h)}function no(t){return io(t)>=0}function ro(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}function io(t){var e=0,n=0,r=0,i=0,o=0;return t.map((function(t){switch(t[0]){case"M":case"Z":return e=r="M"===t[0]?t[1]:r,n=i="M"===t[0]?t[2]:i,0;default:o=ro.apply(0,[e,n].concat(t.slice(1)));var a=t.slice(-2);return e=a[0],n=a[1],o}})).reduce((function(t,e){return t+e}),0)}function oo(t){var e=t.slice(1).map((function(e,n,r){return n?r[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))}function ao(t){return t.map((function(t){return Array.isArray(t)?ao(t):Number.isNaN(+t)?t:+t}))}function so(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function uo(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var co=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},lo=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},ho=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},po=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=co,this.call=co,this._callAsync=lo,this.callAsync=lo,this._promise=ho,this.promise=ho,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=te(this.interceptors);!(e=n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var o=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=o){r++;break}}this.taps[r]=t},t}(),fo=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=new Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+=e.getInterceptor(i)+".error("+t+");\n")}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+=e.getInterceptor(i)+".result("+t+");\n")}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=i()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=te(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),r&&(a+=r("_result"+t)),i&&(a+=i()),o||(a+="}\n");break;case"async":var h="";h+=r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",r&&(h+=r("_result"+t)),i&&(h+=i()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",r&&(a+=r("_result"+t)),i&&(a+=i()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||a,l="",h=o,p=0,f=function(t){var i=t;h!==o&&("sync"!==e.options.taps[i].type||p++>20)&&(p=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var a=h,f=function(t){return t?"":o()},d=e.callTap(i,{onError:function(t){return n(i,t,a,f)},onResult:r&&function(t){return r(i,t,a,f)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)f(d);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),o="";i||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",i||(o+="if(_loopAsync) _looper();\n"),o+=r(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),o+="} while(_loop);\n",i||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var a=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,a,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,a,c),n+="}\n"},onDone:!r&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,r=e.after,i=this._args;return n&&(i=[n].concat(i)),r&&(i=i.concat(r)),0===i.length?"":i.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),yo=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})},e}(fo),vo=new yo,go=function(t){return vo.setup(this,t),vo.create(t)},mo=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=go,r._call=void 0,r.call=void 0,r}return Yt(e,t),e}(po),To=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})},e}(fo),bo=new To,Eo=function(t){return bo.setup(this,t),bo.create(t)},So=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Eo,r._call=void 0,r.call=void 0,r}return Yt(e,t),e}(po),wo=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(fo),Po=new wo,ko=function(){throw new Error("tapAsync is not supported on a SyncHook")},xo=function(){throw new Error("tapPromise is not supported on a SyncHook")},Co=function(t){return Po.setup(this,t),Po.create(t)},No=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=ko,r.tapPromise=xo,r.compile=Co,r}return Yt(e,t),e}(po),_o=function(t){function e(){return t.apply(this,arguments)||this}return Yt(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(fo),Ao=new _o,Mo=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},Oo=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},Io=function(t){return Ao.setup(this,t),Ao.create(t)},Ro=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Mo,r.tapPromise=Oo,r.compile=Io,r}return Yt(e,t),e}(No),Lo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function Do(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Ee(e)?e+"px":e.toString(),s=Oi(n)?n.split(","):[n.value],u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&0>Lo.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}var Uo=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Fo=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Bo=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Vo=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function Go(e){if(be(e)&&(e=""),"transparent"===e)return new Ye(0,0,0,0);"currentColor"===e&&(e="black");var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=function(t){var e=Uo.exec(t);if(e){var n,r,i,o=parseFloat(e[1])%360*(Math.PI/180),a=(null===(n=e[2].match(Vo))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[],s=1,u=1,c=0,l=0;o>=0&&o<.5*Math.PI?(r={x:c,y:l},i={x:s,y:u}):.5*Math.PI<=o&&o<Math.PI?(r={x:s,y:l},i={x:c,y:u}):Math.PI<=o&&o<1.5*Math.PI?(r={x:s,y:u},i={x:c,y:l}):(r={x:c,y:u},i={x:s,y:l});var h=Math.tan(o),p=h*h;return{x0:r.x,y0:r.y,x1:(i.x-r.x+h*(i.y-r.y))/(p+1)+r.x,y1:h*(i.x-r.x+h*(i.y-r.y))/(p+1)+r.y,steps:a,hash:t}}return null}(e);if(r)return new Xe(t.GradientPatternType.LinearGradient,r)}else if("r"===n){var i=function(t){var e=Fo.exec(t);if(e){var n,r=parseFloat(e[1]),i=parseFloat(e[2]),o=parseFloat(e[3]),a=(null===(n=e[4].match(Vo))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];if(0===o){var s=e[4].match(Vo);return s[s.length-1].split(":")[1]}return{x0:r,y0:i,r0:0,x1:.5,y1:.5,r1:o,steps:a,hash:t}}return null}(e);if(i){if(!Oi(i))return new Xe(t.GradientPatternType.RadialGradient,i);e=i}}else if("p"===n){var o=function(t){var e=Bo.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{src:r,repetition:n,hash:t}}return null}(e);if(o)return new Xe(t.GradientPatternType.Pattern,o)}var a=dn(e),s=[0,0,0,0];return null!==a&&(s[0]=a.r||0,s[1]=a.g||0,s[2]=a.b||0,s[3]=a.opacity),Zt(Ye,s)}function jo(t,e){if(t instanceof Ye&&e instanceof Ye)return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(Vr(e[n],0,255));return e[3]=Vr(e[3],0,1),"rgba("+e.join(",")+")"}]}var Ho,zo=function(){function t(t,e){this.center=void 0,this.halfExtents=void 0,this.min=tr(),this.max=tr(),this.update(t,e)}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){this.center=ir(tr(),t||tr()),this.halfExtents=ir(tr(),e||rr(0,0,0)),this.min=mr(this.min,this.center,this.halfExtents),this.max=ar(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){ar(this.center,e,t),cr(this.center,this.center,.5),mr(this.halfExtents,e,t),cr(this.halfExtents,this.halfExtents,.5),ir(this.min,t),ir(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,p=i-u,f=i+u,d=o-c,y=o+c,v=e.center,g=v[0],m=v[1],T=v[2],b=e.halfExtents,E=b[0],S=b[1],w=b[2],P=g-E,k=g+E,x=m-S,C=m+S,N=T-w,_=T+w;l>P&&(l=P),k>h&&(h=k),p>x&&(p=x),C>f&&(f=C),d>N&&(d=N),_>y&&(y=_),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},e.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(c),T=Math.abs(l),b=Math.abs(h),E=Math.abs(p),S=Math.abs(f),w=Math.abs(d);or(n,e[12]+a*i[0]+s*i[1]+u*i[2],e[13]+c*i[0]+l*i[1]+h*i[2],e[14]+p*i[0]+f*i[1]+d*i[2]),or(r,y*o[0]+v*o[1]+g*o[2],m*o[0]+T*o[1]+b*o[2],E*o[0]+S*o[1]+w*o[2]),this.min=mr(this.min,n,r),this.max=ar(this.max,n,r)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=tr(),r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}(tr(),this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?ir(tr(),this.min):272===t.pnVertexFlag?rr(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?rr(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?rr(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?rr(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?rr(this.max[0],this.min[1],this.max[2]):rr(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?ir(tr(),this.max):272===t.pnVertexFlag?rr(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?rr(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?rr(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?rr(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?rr(this.min[0],this.max[1],this.min[2]):rr(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),Wo=tr(),qo=function(){function t(t,e){this.center=void 0,this.radius=void 0,this.center=t||tr(),this.radius=e||.5}var e=t.prototype;return e.containsPoint=function(t){return mr(Wo,t,this.center),nr(Wo)<this.radius*this.radius},e.intersects=function(t){mr(Wo,t.center,this.center);var e=t.radius+this.radius;return nr(Wo)<=e*e},t}(),Yo=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||rr(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return pr(t,this.normal)-this.distance},e.normalize=function(){var t=1/Er(this.normal);cr(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&dr(n,t,e,i),o},t}();(Ho=t.Mask||(t.Mask={}))[Ho.OUTSIDE=4294967295]="OUTSIDE",Ho[Ho.INSIDE=0]="INSIDE",Ho[Ho.INDETERMINATE=2147483647]="INDETERMINATE";var Xo=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Yo)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];or(this.planes[0].normal,i-e,u-o,p-c),this.planes[0].distance=v-f,or(this.planes[1].normal,i+e,u+o,p+c),this.planes[1].distance=v+f,or(this.planes[2].normal,i+n,u+a,p+l),this.planes[2].distance=v+d,or(this.planes[3].normal,i-n,u-a,p-l),this.planes[3].distance=v-d,or(this.planes[4].normal,i-r,u-s,p-h),this.planes[4].distance=v-y,or(this.planes[5].normal,i+r,u+s,p+h),this.planes[5].distance=v+y,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Ko=tr(),Zo=tr(),Jo=tr(),Qo=tr(),$o=tr(),ta=function(){function t(t,e){this.origin=void 0,this.direction=void 0,this.origin=t||tr(),this.direction=e||rr(0,0,-1)}var e=t.prototype;return e.intersectsAABB=function(t,e){return e?this.intersectAABBWithIntersection(t,e):this.intersectsAABBWithoutIntersection(t)},e.intersectsSphere=function(t,e){var n=mr(Ko,this.origin,t.center);hr(Zo,ir(Zo,this.direction));var r=pr(n,Zo),i=pr(n,n)-t.radius*t.radius;if(i>0&&r>0)return null;var o=r*r-i;if(0>o)return!1;var a=Math.abs(-r-Math.sqrt(o));return e&&(ir(e,this.direction),lr(e,this.origin,e,a)),!0},e.intersectsPlane=function(t,e){var n=(t.distance-pr(t.normal,this.origin))/pr(t.normal,this.direction),r=n>=0;return r&&e&&lr(e,this.origin,this.direction,n),r},e.intersectsAABBWithoutIntersection=function(t){var e=Ko,n=Zo,r=Jo,i=Qo,o=$o,a=this.direction;return mr(e,this.origin,t.center),or(i,Math.abs(e[0]),Math.abs(e[1]),Math.abs(e[2])),Tr(r,e,a),!(i[0]>t.halfExtents[0]&&r[0]>=0||i[1]>t.halfExtents[1]&&r[1]>=0||i[2]>t.halfExtents[2]&&r[2]>=0)&&(or(o,Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2])),fr(n,a,e),or(n,Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])),!(n[0]>t.halfExtents[1]*o[2]+t.halfExtents[2]*o[1]||n[1]>t.halfExtents[0]*o[2]+t.halfExtents[2]*o[0]||n[2]>t.halfExtents[0]*o[1]+t.halfExtents[1]*o[0]))},e.intersectAABBWithIntersection=function(t,e){var n=ir(tr(),t.getMin());mr(n,n,this.origin);var r=ir(tr(),t.getMax());mr(r,r,this.origin);var i=this.direction;0===i[0]?(n[0]=0>n[0]?-Number.MAX_VALUE:Number.MAX_VALUE,r[0]=0>r[0]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[0]/=i[0],r[0]/=i[0]),0===i[1]?(n[1]=0>n[1]?-Number.MAX_VALUE:Number.MAX_VALUE,r[1]=0>r[1]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[1]/=i[1],r[1]/=i[1]),0===i[2]?(n[2]=0>n[2]?-Number.MAX_VALUE:Number.MAX_VALUE,r[2]=0>r[2]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[2]/=i[2],r[2]/=i[2]);var o=or(Jo,Math.min(n[0],r[0]),Math.min(n[1],r[1]),Math.min(n[2],r[2])),a=or(Qo,Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.max(n[2],r[2])),s=Math.min(Math.min(a[0],a[1]),a[2]),u=Math.max(Math.max(o[0],o[1]),o[2]),c=s>=u&&u>=0;return c&&(ir(e,this.direction),lr(e,this.origin,e,u)),c},t}(),ea=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),na=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}();function ra(t,e){if(be(e))return new Re(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return new Re(Number(e),"px");if("deg".search(t)>=0)return new Re(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return new Re(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}function ia(t){return ra(new RegExp("px","g"),t)}function oa(t){return ra(new RegExp("px|%|em|rem","g"),t)}function aa(t){return ra(new RegExp("deg|rad|grad|turn","g"),t)}function sa(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0;return(Re.isLength(t.unit)||Re.isLength(e.unit))&&(a=ha(t,i,n),s=ha(e,i,n),o="px"),(Re.isAngle(t.unit)||Re.isAngle(e.unit))&&(a=ua(t),s=ua(e),o="deg"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function ua(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Hr(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=zr(Number(e.value))),n}function ca(t){return Oi(t)?t.split(" ").map((function(t){return oa(t)})):t.map((function(t){return oa(t.toString())}))}function la(t,e,n){if(t.length===e.length){var r=t[0].unit;return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t.map((function(t){return new Re(t,r)})).join(" ")}]}}function ha(e,n,r){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.getGeometryBounds(),o=0;return zo.isEmpty(i)||(o=2*i.halfExtents[n]),Number(e.value)/100*o}return 0}function pa(t){return t.toString()}function fa(t){return"number"==typeof t?new Re(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?new Re(Number(t)):new Re(0)}function da(t,e){return[t.value,e.value,pa]}function ya(t,e){return function(n,r){return[n.value,r.value,function(n){return pa(Vr(n,t,e))}]}}var va=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,ga=/[^\s,]+/gi;var ma=new RegExp("([a-z])[\\s,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\s]*,?[\\s]*)+)","ig"),Ta=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\\s]*,?[\\s]*","ig");var ba=/[a-z]/;function Ea(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Sa(t){var e=function(t){if("string"==typeof t){if(t){var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return t.replace(ma,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(Ta,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}return null}if(Array.isArray(t))return t}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;e.length>r;r++){if(ba.test(p=e[r][0])||["V","H","T","S"].indexOf(p)>=0){n=!0;break}}if(!n)return e;var i=[],o=0,a=0,s=0,u=0,c=0,l=e[0];"M"!==l[0]&&"m"!==l[0]||(s=o=+l[1],u=a=+l[2],c++,i[0]=["M",o,a]);r=c;for(var h=e.length;h>r;r++){var p,f=e[r],d=i[r-1],y=[],v=(p=f[0]).toUpperCase();if(p!==v)switch(y[0]=v,v){case"A":y[1]=f[1],y[2]=f[2],y[3]=f[3],y[4]=f[4],y[5]=f[5],y[6]=+f[6]+o,y[7]=+f[7]+a;break;case"V":y[1]=+f[1]+a;break;case"H":y[1]=+f[1]+o;break;case"M":u=+f[2]+a,y[1]=s=+f[1]+o,y[2]=u;break;default:for(var g=1,m=f.length;m>g;g++)y[g]=+f[g]+(g%2?o:a)}else y=e[r];switch(v){case"Z":o=+s,a=+u;break;case"H":y=["L",o=y[1],a];break;case"V":y=["L",o,a=y[1]];break;case"T":o=y[1],a=y[2];var T=Ea([d[1],d[2]],[d[3],d[4]]);y=["Q",T[0],T[1],o,a];break;case"S":o=y[y.length-2],a=y[y.length-1];var b=d.length,E=Ea([d[b-4],d[b-3]],[d[b-2],d[b-1]]);y=["C",E[0],E[1],y[1],y[2],o,a];break;case"M":s=y[y.length-2],u=y[y.length-1];break;default:o=y[y.length-2],a=y[y.length-1]}i.push(y)}return i}var wa=2*Math.PI,Pa=function(t,e,n,r,i,o,a){var s=t.x,u=t.y;return{x:r*(s*=e)-i*(u*=n)+o,y:i*s+r*u+a}},ka=function(t,e){var n=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:r-i*n,y:i+r*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},xa=function(t,e,n,r){var i=t*n+e*r;return i>1&&(i=1),-1>i&&(i=-1),(0>t*r-e*n?-1:1)*Math.acos(i)},Ca=function(t){var e=t.px,n=t.py,r=t.cx,i=t.cy,o=t.rx,a=t.ry,s=t.xAxisRotation,u=void 0===s?0:s,c=t.largeArcFlag,l=void 0===c?0:c,h=t.sweepFlag,p=void 0===h?0:h,f=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];var d=Math.sin(u*wa/360),y=Math.cos(u*wa/360),v=y*(e-r)/2+d*(n-i)/2,g=-d*(e-r)/2+y*(n-i)/2;if(0===v&&0===g)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(v,2)/Math.pow(o,2)+Math.pow(g,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var T=function(t,e,n,r,i,o,a,s,u,c,l,h){var p=Math.pow(i,2),f=Math.pow(o,2),d=Math.pow(l,2),y=Math.pow(h,2),v=p*f-p*y-f*d;0>v&&(v=0),v/=p*y+f*d;var g=(v=Math.sqrt(v)*(a===s?-1:1))*i/o*h,m=v*-o/i*l,T=c*g-u*m+(t+n)/2,b=u*g+c*m+(e+r)/2,E=(l-g)/i,S=(h-m)/o,w=(-l-g)/i,P=(-h-m)/o,k=xa(1,0,E,S),x=xa(E,S,w,P);return 0===s&&x>0&&(x-=wa),1===s&&0>x&&(x+=wa),[T,b,k,x]}(e,n,r,i,o,a,l,p,d,y,v,g),b=T[0],E=T[1],S=T[2],w=T[3],P=Math.abs(w)/(wa/4);1e-7>Math.abs(1-P)&&(P=1);var k=Math.max(Math.ceil(P),1);w/=k;for(var x=0;k>x;x++)f.push(ka(S,w)),S+=w;return f.map((function(t){var e=Pa(t[0],o,a,y,d,b,E),n=e.x,r=e.y,i=Pa(t[1],o,a,y,d,b,E),s=i.x,u=i.y,c=Pa(t[2],o,a,y,d,b,E);return{x1:n,y1:r,x2:s,y2:u,x:c.x,y:c.y}}))};function Na(t,e,n,r,i,o,a,s,u){return Ca({px:t,py:e,cx:s,cy:u,rx:n,ry:r,xAxisRotation:i,largeArcFlag:o,sweepFlag:a}).reduce((function(t,e){return t.push(e.x1,e.y1,e.x2,e.y2,e.x,e.y),t}),[])}function _a(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}function Aa(t,e,n,r){return[t,e,n,r,n,r]}function Ma(t,e){0>"TQ".indexOf(t[0])&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],i=n[1];switch(t[0]){case"M":return e.x=r,e.y=i,t;case"A":return["C"].concat(Na.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=i,["C"].concat(_a.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Aa(e.x1,e.y1,t[1],t[2]));case"H":return["C"].concat(Aa(e.x1,e.y1,t[1],e.y1));case"V":return["C"].concat(Aa(e.x1,e.y1,e.x1,t[1]));case"Z":return["C"].concat(Aa(e.x1,e.y1,e.x,e.y))}return t}function Oa(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ia=Math.PI/180;function Ra(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function La(t,e){return Ra(t)*Ra(e)?(t[0]*e[0]+t[1]*e[1])/(Ra(t)*Ra(e)):1}function Da(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(La(t,e))}function Ua(t,e){return t[0]===e[0]&&t[1]===e[1]}function Fa(t,e){var n,r=e[1],i=e[2],o=(n=2*Math.PI,(Ia*e[3]%n+n)%n),a=e[4],s=e[5],u=t[0],c=t[1],l=e[6],h=e[7],p=Math.cos(o)*(u-l)/2+Math.sin(o)*(c-h)/2,f=-1*Math.sin(o)*(u-l)/2+Math.cos(o)*(c-h)/2,d=p*p/(r*r)+f*f/(i*i);d>1&&(r*=Math.sqrt(d),i*=Math.sqrt(d));var y=r*r*(f*f)+i*i*(p*p),v=y?Math.sqrt((r*r*(i*i)-y)/y):1;a===s&&(v*=-1),isNaN(v)&&(v=0);var g=i?v*r*f/i:0,m=r?v*-i*p/r:0,T=(u+l)/2+Math.cos(o)*g-Math.sin(o)*m,b=(c+h)/2+Math.sin(o)*g+Math.cos(o)*m,E=[(p-g)/r,(f-m)/i],S=[(-1*p-g)/r,(-1*f-m)/i],w=Da([1,0],E),P=Da(E,S);return La(E,S)>-1||(P=Math.PI),1>La(E,S)||(P=0),0===s&&P>0&&(P-=2*Math.PI),1===s&&0>P&&(P+=2*Math.PI),{cx:T,cy:b,rx:Ua(t,[l,h])?0:r,ry:Ua(t,[l,h])?0:i,startAngle:w,endAngle:w+P,xRotation:o,arcFlag:a,sweepFlag:s}}function Ba(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Va(t){t=function(t){var e=t||[];return Array.isArray(e)?e:"string"==typeof e?((e=e.match(va)).forEach((function(t,n){if((t=t.match(ga))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}t.forEach((function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0}(t);for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=Fa(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&Ua(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c){l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===c){var d=Ba((v=e[s-1]).currentPoint,f);"Q"===v.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-y[0],g[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===c){var v,g=Ba((v=e[s-1]).currentPoint,f);y=[u[1],u[2]];"C"===v.command?(l.command="C",l.startTangent=[f[0]-g[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[f[0]-y[0],f[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var m=.001,T=l.arcParams||{},b=T.cx,E=void 0===b?0:b,S=T.cy,w=void 0===S?0:S,P=T.rx,k=void 0===P?0:P,x=T.ry,C=void 0===x?0:x,N=T.sweepFlag,_=T.startAngle,A=void 0===_?0:_,M=T.endAngle,O=void 0===M?0:M;0===(void 0===N?0:N)&&(m*=-1);var I=k*Math.cos(A-m)+E,R=C*Math.sin(A-m)+w;l.startTangent=[I-i[0],R-i[1]];var L=k*Math.cos(A+O+m)+E,D=C*Math.sin(A+O-m)+w;l.endTangent=[f[0]-L,f[1]-D]}e.push(l)}return e}function Ga(t,e){var n=Sa(t),r=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(n),i=n.slice(),o=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}r.length>0&&n.push(r);return{polygons:e,polylines:n}}(i),a=o.polygons,s=o.polylines,u=function(t,e){void 0===e&&(e=!1);for(var n,r,i=Sa(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",u=i.length,c=[],l=0;u>l;l+=1)i[l]&&(s=i[l][0]),a[l]=s,i[l]=Ma(i[l],o),Oa(i,a,l),u=i.length,"Z"===s&&c.push(l),o.x1=+(n=i[l])[(r=n.length)-2],o.y1=+n[r-1],o.x2=+n[r-4]||o.x1,o.y2=+n[r-3]||o.y1;return e?[i,c]:i}(i,!0),c=u[0],l=u[1],h=Va(i),p=function(t){var e,n,r,i,o=0,a=0,s=[];if(!t)return{curveSegments:[],totalLength:o};if(t.forEach((function(e,n){i=e.length,(r=t[n+1])&&(o+=Ki.length(e[i-2],e[i-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)})),0===o)return{curveSegments:[],totalLength:o};return t.forEach((function(u,c){i=u.length,(r=t[c+1])&&((e=[])[0]=a/o,n=Ki.length(u[i-2],u[i-1],r[1],r[2],r[3],r[4],r[5],r[6]),e[1]=(a+=n||0)/o,s.push(e))})),{curveSegments:s,totalLength:o}}(c),f=p.totalLength,d=p.curveSegments,y=function(t){var e=0,n=0,r=[],i=[];t.forEach((function(t){var o=t.slice(-2),a=o[0],s=o[1];if("M"===t[0])e=a,n=s,r.push(a),i.push(s);else if("C"===t[0]){var u=Ki.box.apply(Ki,[e,n].concat(t.slice(1)));r=r.concat(u.x,u.x+u.width),i=i.concat(u.y,u.y+u.height),e=a,n=s}}));var o=Math.min.apply(0,r),a=Math.min.apply(0,i),s=Math.max.apply(0,r),u=Math.max.apply(0,i);return new na(o,a,s-o,u-a)}(c);return e&&(e.parsedStyle.defX=y.x,e.parsedStyle.defY=y.y),{absolutePath:n,hasArc:r,segments:h,polygons:a,polylines:s,curve:c,totalLength:f,curveSegments:d,zCommandIndexes:l,rect:y}}function ja(t,e,n){var r=t.curve,i=e.curve,o=[r,i];r.length!==i.length&&(o=eo(r,i));var a=no(o[0])!==no(o[1])?oo(o[0]):ao(o[0]);return[a,so(o[1],a),function(t){return t}]}function Ha(t,e){var n;n=Oi(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=Ji(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Hi.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}var za,Wa,qa,Ya,Xa=function(t){return ra(/deg|rad|grad|turn|px|%/g,t)},Ka=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Za(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Ka.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Xa(t)||Go(t)}))}),n.lastIndex===t.length)return r}return[]}function Ja(t,e,n,r){var i,o=arguments.length,a=3>o?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(3>o?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function Qa(t,e){return function(n,r){e(n,r,t)}}function $a(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}(za=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",za.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(Wa||(Wa={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(qa||(qa={})),(Ya=t.PropertyName||(t.PropertyName={})).LAYOUT="display",Ya.LEFT="left",Ya.TOP="top",Ya.BOTTOM="bottom",Ya.RIGHT="right",Ya.WIDTH="width",Ya.HEIGHT="height",Ya.MIN_WIDTH="minWidth",Ya.MAX_WIDTH="maxWidth",Ya.MIN_HEIGHT="minHeight",Ya.MAX_HEIGHT="maxHeight",Ya.BOX_SIZING="boxSizing",Ya.PADDING="padding",Ya.PADDING_TOP="paddingTop",Ya.PADDING_BOTTOM="paddingBottom",Ya.PADDING_START="paddingLeft",Ya.PADDING_END="paddingRight",Ya.MARGIN="margin",Ya.MARGIN_TOP="marginTop",Ya.MARGIN_BOTTOM="marginBottom",Ya.MARGIN_START="marginLeft",Ya.MARGIN_END="marginRight",Ya.BORDER="border",Ya.BORDER_TOP="borderTop",Ya.BORDER_BOTTOM="borderBottom",Ya.BORDER_START="borderLeft",Ya.BORDER_END="borderRight",Ya.FLEX_DIRECTION="flexDirection",Ya.FLEX_WRAP="flexWrap",Ya.FLEX_FLOW="flexFlow",Ya.ALIGN_ITEMS="alignItems",Ya.ALIGN_CONTENT="alignContent",Ya.JUSTIFY_CONTENT="justifyContent",Ya.FLEX="flex",Ya.ALIGN_SELF="alignSelf",Ya.FLEX_SHRINK="flexShrink",Ya.FLEX_BASIS="flexBasis",Ya.FLEX_GROW="flexGrow",Ya.OFFSET_WIDTH="offsetWidth",Ya.OFFSET_HEIGHT="offsetHeight",Ya.ORDER="order";var ts=1,es=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=ts++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(n){var r=t.style.get(n);r&&e.set(n,r)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,r,i;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(r=null===(i=this.style.get(t.PropertyName.HEIGHT))||void 0===i?void 0:i.value)&&void 0!==r?r:0}},n.computeLayout=function(){var t=Ht(Gt().mark((function t(){var e;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,$c.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},Wt(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),ns=i.defineToken("LayoutContextFactory"),rs=i.defineToken("LayoutContextOptions"),is=0;t.LayoutContext=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+is++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),t.LayoutContext=Ja([lt(),Qa(0,ht(rs)),$a("design:paramtypes",[Object])],t.LayoutContext);var os=i.defineToken("FragmentResultFactory"),as=i.defineToken("FragmentResultOptions"),ss=i.defineToken("contextNode");t.FragmentResult=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e},t.FragmentResult=Ja([ct(),Qa(0,ht(t.LayoutContext)),Qa(1,ht(ss)),Qa(2,ht(as)),$a("design:paramtypes",[t.LayoutContext,es,Object])],t.FragmentResult);var us=i.defineToken("LayoutChildrenFactory"),cs=i.defineToken("LayoutChildrenOptions");t.LayoutChildren=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new vi;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw new Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new vi;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),t.LayoutChildren=Ja([ct(),Qa(0,ht(t.LayoutContext)),Qa(1,ht(cs)),$a("design:paramtypes",[t.LayoutContext,Object])],t.LayoutChildren);var ls=function(){};ls.inputProperties=void 0,ls.childrenInputProperties=void 0,ls.layoutOptions=void 0;var hs,ps,fs=i.defineToken("LayoutEdgesFactory"),ds=i.defineToken("LayoutEdgesOptions"),ys=[0,0,0,0];t.LayoutEdges=function(e){var n,r,i,o,a,s,u,c,l,h,p,f,d,y,v,g;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var m=e.node.getAllStyle(),T=null!==(n=null===(r=m.get(t.PropertyName.PADDING_TOP))||void 0===r?void 0:r.value)&&void 0!==n?n:0,b=null!==(i=null===(o=m.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==i?i:0,E=null!==(a=null===(s=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,S=null!==(u=null===(c=m.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,w=null!==(l=null===(h=m.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,P=null!==(p=null===(f=m.get(t.PropertyName.PADDING_END))||void 0===f?void 0:f.value)&&void 0!==p?p:0,k=null!==(d=null===(y=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===y?void 0:y.value)&&void 0!==d?d:0,x=null!==(v=null===(g=m.get(t.PropertyName.PADDING_START))||void 0===g?void 0:g.value)&&void 0!==v?v:0;this.blockStart=T+ys[0]+w,this.inlineStart=b+ys[1]+P,this.blockEnd=E+ys[2]+k,this.inlineEnd=S+ys[3]+x,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEdges=Ja([ct(),Qa(0,ht(ds)),$a("design:paramtypes",[Object])],t.LayoutEdges),t.LayoutRegistry=((hs=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw new Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(t,e){if(""===t)throw new TypeError("layout name cant't be empty");if(ps.reservedLayout.includes(t))throw new Error("layout name '"+t+"' is a system reserved layout name, please use another name");if(this.hasLayout(t))throw new Error("layout '"+t+"' already exist.");this.registry.set(t,e)},e.deleteLayout=function(t){this.registry.delete(t)},Wt(t,[{key:"size",get:function(){return this.registry.size}}]),t}()).reservedLayout=[],ps=hs),t.LayoutRegistry=ps=Ja([lt()],t.LayoutRegistry);var vs=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))};t.LayoutEngine=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=Ht(Gt().mark((function t(e,n){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=Ht(Gt().mark((function t(e){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw new Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=Ht(Gt().mark((function t(e,n){var r;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(r,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=Ht(Gt().mark((function e(n,r,i){var o,a,s,u,c,l,h,p,f,d,y;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],i.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:r}),p=r.getStyle.apply(r,c),f=a.intrinsicSizes(l,h,p),(d=this.runWorkQueue(f,s.workQueue)).next(),e.next=13,vs();case 13:y=d.next().value,s.clearWorkQueue(),r.setIntrisicSizes(y);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=Ht(Gt().mark((function t(e,n,r){var i;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(i,e,n,r);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=Ht(Gt().mark((function e(n,r,i,o){var a,s,u,c,l,h,p,f,d,y,v,g,m;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],i.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),p=this.layoutEdgesFactory({node:r}),f=r.getStyle.apply(r,l),d=s.layout(h,p,o,f),(y=this.runWorkQueue(d,u.workQueue)).next(),e.next=13,vs();case 13:v=y.next().value,u.clearWorkQueue(),g=v instanceof t.FragmentResult?v:u.fragmentResultFactory(v),m=u.layoutFragmentFactory({inlineSize:g.inlineSize,blockSize:g.blockSize,data:g.data}),r.setComputedLayout(m),i.forEach((function(t,e){t.setComputedLayout(g.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),n.runWorkQueue=Gt().mark((function e(n,r){var i,o=this;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=yi(n),r.length>0&&i.isPending()&&r.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,r=e.deferred,i=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);r.resolve(i.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(i.isFulfilled()){e.next=6;break}throw new Error("promise not fullfilled!");case 6:return e.abrupt("return",i.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,r,i,o,a,s,u,c,l,h,p,f,d=e.getAllStyle();return{minContentInlineSize:(null===(n=d.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(r=e.intrisicSizes)||void 0===r?void 0:r.minContentInlineSize)||(null===(i=d.get(t.PropertyName.WIDTH))||void 0===i?void 0:i.value)||0,maxContentInlineSize:(null===(o=d.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=d.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=d.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=d.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=d.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(p=e.intrisicSizes)||void 0===p?void 0:p.maxContentBlockSize)||(null===(f=d.get(t.PropertyName.HEIGHT))||void 0===f?void 0:f.value)||0}},n.getNodeFragment=function(e,n){var r,i,o,a,s,u;return{inlineSize:(null===(r=e.getComputedLayout())||void 0===r?void 0:r.inlineSize)||(null===(i=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===i?void 0:i.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),t.LayoutEngine=Ja([lt(),Qa(0,ht(t.LayoutRegistry)),Qa(1,ht(ns)),Qa(2,ht(fs)),$a("design:paramtypes",[t.LayoutRegistry,Function,Function])],t.LayoutEngine);var gs=i.defineToken("LayoutFragmentFactory"),ms=i.defineToken("LayoutFragmentOptions");t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutFragment=Ja([ct(),Qa(0,ht(t.LayoutContext)),Qa(1,ht(ms)),$a("design:paramtypes",[t.LayoutContext,Object])],t.LayoutFragment);var Ts={number:function(t){return new Re(t)},percent:function(t){return new Re(t,"%")},px:function(t){return new Re(t,"px")},em:function(t){return new Re(t,"em")},rem:function(t){return new Re(t,"rem")},deg:function(t){return new Re(t,"deg")},grad:function(t){return new Re(t,"grad")},rad:function(t){return new Re(t,"rad")},turn:function(t){return new Re(t,"turn")},s:function(t){return new Re(t,"s")},ms:function(t){return new Re(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;Ut.get(ue).registerMetadata({name:e,inherited:n,interpolable:r,defaultValue:i,syntax:o})},registerLayout:function(e,n){Ut.get(t.LayoutRegistry).registerLayout(e,n)}},bs=null;function Es(t){return function(e){var n=0;return t.map((function(t){return t===bs?e[n++]:t}))}}function Ss(t){return t}var ws={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],scale:["Nn",Es([bs,bs,Ts.number(1)]),Ss],scalex:["N",Es([bs,Ts.number(1),Ts.number(1)]),Es([bs,Ts.number(1)])],scaley:["N",Es([Ts.number(1),bs,Ts.number(1)]),Es([Ts.number(1),bs])],scalez:["N",Es([Ts.number(1),Ts.number(1),bs])],scale3d:["NNN",Ss],translate:["Tt",Es([bs,bs,We]),Ss],translatex:["T",Es([bs,We,We]),Es([bs,We])],translatey:["T",Es([We,bs,We]),Es([We,bs])],translatez:["L",Es([We,We,bs])],translate3d:["TTL",Ss]};function Ps(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=ws[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],p=u[l],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?qe:aa(t)},N:fa,T:oa,L:ia}[p.toUpperCase()](h):{a:qe,n:c[0],t:We}[p]))return[];c.push(f)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function ks(t){return t.replace(/[xy]/,"")}function xs(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Cs(e,n,r){var i=!1;if(!e.length||!n.length){e.length||(i=!0,e=n,n=[]);for(var o=function(t){var r=e[t],i=r.t,o=r.d,a="scale"===i.substr(0,5)?1:0;n.push({t:i,d:o.map((function(t){return"number"==typeof t?new Re(a):new Re(a,t.unit)}))})},a=0;e.length>a;a++)o(a)}var s,u,c=[],l=[],h=[];if(e.length!==n.length);else for(var p=0;e.length>p;p++){var f=e[p].t,d=n[p].t,y=e[p].d,v=n[p].d,g=ws[f],m=ws[d],T=void 0;if(u=d,("perspective"!==(s=f)||"perspective"!==u)&&("matrix"!==s&&"matrix3d"!==s||"matrix"!==u&&"matrix3d"!==u)){if(f===d)T=f;else if(g[2]&&m[2]&&ks(f)===ks(d))T=ks(f),y=g[2](y),v=m[2](v);else{if(!g[1]||!m[1]||xs(f)!==xs(d))break;T=xs(f),y=g[1](y),v=m[1](v)}for(var b=[],E=[],S=[],w=0;y.length>w;w++){var P=(y[w].unit===t.UnitType.kNumber?da:sa)(y[w],v[w],r,!1,w);b[w]=P[0],E[w]=P[1],S.push(P[2])}c.push(b),l.push(E),h.push([T,S])}}if(i){var k=c;c=l,l=k}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return h[e][1][n](t)})).join(",");return"matrix"===h[e][0]&&16===n.split(",").length&&(h[e][0]="matrix3d"),h[e][0]+"("+n+")"})).join(" ")}]}function Ns(t){if(Oi(t)){var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[oa(_s(e[0])),oa(_s(e[1]))]}return[new Re(t[0]||0,"px"),new Re(t[1]||0,"px")]}function _s(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var As,Ms=i.defineToken("CSSPropertySyntaxFactory"),Os=i.defineToken("CSSProperty");t.CSSPropertyAngle=function(){function t(){this.parser=aa,this.mixer=sa}return t.prototype.calculator=function(t,e,n,r){return new Re(ua(n),"deg")},t}(),t.CSSPropertyAngle=Ja([lt({token:{token:Os,named:t.PropertySyntax.ANGLE}})],t.CSSPropertyAngle),(As=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",As.ATTR_MODIFIED="DOMAttrModified",As.INSERTED="DOMNodeInserted",As.CHILD_INSERTED="child-inserted",As.REMOVED="removed",As.CHILD_REMOVED="child-removed",As.MOUNTED="DOMNodeInsertedIntoDocument",As.UNMOUNTED="DOMNodeRemovedFromDocument",As.BOUNDS_CHANGED="bounds-changed",As.GEOMETRY_BOUNDS_CHANGED="geometry-bounds-changed",As.RENDER_ORDER_CHANGED="render-order-changed";var Is=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new ea,this.page=new ea,this.canvas=new ea,this.viewport=new ea,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},Wt(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),Rs=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(Qt(r),n),r}return Yt(e,t),e}(Is),Ls=function(){function t(){this.emitter=new ne.EventEmitter}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r=we(n)&&n||Pe(n)&&n.capture,i=Pe(n)&&n.once,o=Se(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=r?t+"capture":t,e=Se(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,i=we(n)&&n||Pe(n)&&n.capture,o=Se(e)?void 0:e;return t=i?t+"capture":t,e=Se(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new Rs(t,e))},e.dispatchEvent=function(t){if(!(t instanceof Is))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var e,n,r=this.ownerDocument||this.document;r&&(t.manager=(null===(e=r.defaultView)||void 0===e?void 0:e.getEventService())||null,t.defaultPrevented=!1,t.path=[],t.target=this,null===(n=t.manager)||void 0===n||n.dispatchEvent(t));return!t.defaultPrevented},t}(),Ds=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}Yt(n,e),n.isNode=function(t){return!!t.childNodes};var r=n.prototype;return r.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.hasChildNodes=function(){return this.childNodes.length>0},r.isDefaultNamespace=function(t){throw new Error("Method not implemented.")},r.lookupNamespaceURI=function(t){throw new Error("Method not implemented.")},r.lookupPrefix=function(t){throw new Error("Method not implemented.")},r.normalize=function(){throw new Error("Method not implemented.")},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,r=this,i=[e],o=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(e!==r)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,u=s===i?o:i;if(s[s.length-u.length]===u[0])return s===i?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},r.contain=function(t){return this.contains(t)},r.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},Wt(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=te(this.childNodes);!(n=r()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t,!0)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}}]),n}(Ls);Ds.DOCUMENT_POSITION_DISCONNECTED=1,Ds.DOCUMENT_POSITION_PRECEDING=2,Ds.DOCUMENT_POSITION_FOLLOWING=4,Ds.DOCUMENT_POSITION_CONTAINS=8,Ds.DOCUMENT_POSITION_CONTAINED_BY=16,Ds.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Us=function(){this.contentBounds=void 0,this.renderBounds=void 0};Us.tag="c-geometry";var Fs=function(){this.bounds=void 0,this.boundsDirty=!0,this.renderBounds=void 0,this.renderBoundsDirty=!0,this.dirtyRenderBounds=void 0,this.dirty=!1};Fs.tag="c-renderable";var Bs,Vs=function(){this.dirtyFlag=!1,this.localDirtyFlag=!1,this.frozen=!1,this.localPosition=rr(0,0,0),this.localRotation=Dr(0,0,0,1),this.localScale=rr(1,1,1),this.localTransform=Gn(),this.position=rr(0,0,0),this.rotation=Dr(0,0,0,1),this.scaling=rr(1,1,1),this.worldTransform=Gn(),this.origin=rr(0,0,0)};Vs.tag="c-transform",(Bs=t.Strategy||(t.Strategy={}))[Bs.Standard=0]="Standard";var Gs=function(){function e(){this.strategy=t.Strategy.Standard,this.visibilityPlaneMask=-1,this.visible=!0,this.enable=!0}return e.prototype.isCulled=function(){return this.enable&&!this.visible},e}();Gs.tag="c-cullable";var js=function(){this.dirty=!1,this.sorted=void 0,this.lastSortedIndex=void 0,this.renderOrder=0};js.tag="c-sortable";var Hs=function(t){function e(e,n,r,i,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return Yt(e,t),e}(Is);Hs.ADDITION=2,Hs.MODIFICATION=1,Hs.REMOVAL=3;var zs=0,Ws=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).sceneGraphService=Ut.get($u),t.entity=zs++,t.renderable=new Fs,t.cullable=new Gs,t.transformable=new Vs,t.sortable=new js,t.geometry=new Us,t.id=void 0,t.name=void 0,t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}Yt(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw new Error("Method not implemented.")},r.appendChild=function(e,n){return this.sceneGraphService.attach(e,this,n),this.dispatchEvent(new Rs(t.ElementEvent.CHILD_INSERTED,{child:e})),e.dispatchEvent(new Hs(t.ElementEvent.INSERTED,this,"","","",0,"","")),e},r.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},r.replaceChild=function(t,e,n){var r=this.childNodes.indexOf(e);return this.removeChild(e,n),this.appendChild(t,r),e},r.removeChild=function(e,n){return void 0===n&&(n=!0),e.dispatchEvent(new Hs(t.ElementEvent.REMOVED,this,"","","",0,"","")),n&&(e.dispatchEvent(new Rs(t.ElementEvent.DESTROY)),e.destroyed=!0),this.dispatchEvent(new Rs(t.ElementEvent.CHILD_REMOVED,{child:e})),this.sceneGraphService.detach(e),n&&e.emitter.removeAllListeners(),e},r.removeChildren=function(t){var e=this;void 0===t&&(t=!0),this.childNodes.slice().forEach((function(n){e.removeChild(n,t)}))},r.matches=function(t){return this.sceneGraphService.matches(t,this)},r.getElementById=function(t){return this.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return this.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return this.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return this.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return this.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return this.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(this.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},r.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.after=function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}},r.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,o)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))},r.prepend=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))},r.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},r.remove=function(t){return void 0===t&&(t=!0),this.parentNode?this.parentNode.removeChild(this,t):this},r.destroy=function(){this.dispatchEvent(new Rs(t.ElementEvent.DESTROY)),this.remove(!1),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return this.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return this.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return this.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return this.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return this.sceneGraphService.getBoundingClientRect(this)},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.getAttributeNames=function(){return Object.keys(this.attributes)},r.getAttribute=function(t){var e=Bi(t.toString(),""),n=this.attributes[e[0]];return be(n)?null:n},r.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.hasAttributes=function(){return!!this.getAttributeNames().length},r.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.setAttribute=function(t,e,n){this.attributes[t]=e},r.getAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.getAttributeNode=function(t){throw new Error("Method not implemented.")},r.getAttributeNodeNS=function(t,e){throw new Error("Method not implemented.")},r.hasAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.removeAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.removeAttributeNode=function(t){throw new Error("Method not implemented.")},r.setAttributeNS=function(t,e,n){throw new Error("Method not implemented.")},r.setAttributeNode=function(t){throw new Error("Method not implemented.")},r.setAttributeNodeNS=function(t){throw new Error("Method not implemented.")},r.toggleAttribute=function(t,e){throw new Error("Method not implemented.")},Wt(n,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}}]),n}(Ds),qs=function(t){function e(e,n,r,i){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return Yt(e,t),e}(Is),Ys=0,Xs=function(){function t(t,e){this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+Ys++,this._inEffect=!!this.effect.update(0),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this.totalDuration:0,this._startTime=this.totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this.totalDuration>=1/0)throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this.totalDuration}else this.currentTime=0},e.persist=function(){throw new Error("Method not implemented.")},e.addEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.removeEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.dispatchEvent=function(t){throw new Error("Method not implemented.")},e.commitStyles=function(){throw new Error("Method not implemented.")},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this.totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new qs(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new qs(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},Wt(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this.totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){var t;return Number(null===(t=this.effect)||void 0===t?void 0:t.getComputedTiming().endTime)}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}();function Ks(t,e){return Number(t.id)-Number(e.id)}var Zs=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(Ks),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t){var e=new Xs(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Ks),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();t.DisplayObjectPool=function(){function e(){this.pool={},this.htmlPool=[]}var n=e.prototype;return n.getByEntity=function(t){return this.pool[t]},n.add=function(e,n){this.pool[e]=n,n.nodeName===t.Shape.HTML&&this.htmlPool.push(n)},n.remove=function(e){var n=this.pool[e];if(delete this.pool[e],n.nodeName===t.Shape.HTML){var r=this.htmlPool.indexOf(n);this.htmlPool.splice(r,1)}},n.getHTMLs=function(){return this.htmlPool},e}(),t.DisplayObjectPool=Ja([lt()],t.DisplayObjectPool);var Js,Qs,$s={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:""},tu=function(e){function n(n){var r,i,o,a;return(a=e.call(this)||this).config=void 0,a.styleValueRegistry=Ut.get(ue),a.isCustomElement=!1,a.activeAnimations=[],a.config=n,a.config.interactive=null!==(r=a.config.capture)&&void 0!==r?r:a.config.interactive,a.id=a.config.id||"",a.name=a.config.name||"",(a.config.className||a.config.class)&&(a.className=a.config.className||a.config.class),a.nodeName=a.config.type||t.Shape.GROUP,a.config.style=qt({},$s,{zIndex:null!==(i=a.config.zIndex)&&void 0!==i?i:0,interactive:null===(o=a.config.interactive)||void 0===o||o},a.config.style,a.config.attrs),null!=a.config.visible&&(a.config.style.visibility=!1===a.config.visible?"hidden":"visible"),null!=a.config.interactive&&(a.config.style.pointerEvents=!1===a.config.interactive?"none":"auto"),a.style=new Proxy(qt({},a.attributes,{setProperty:function(t,e){a.setAttribute(t,e)},getPropertyValue:function(t){return a.getAttribute(t)},removeProperty:function(t){a.removeAttribute(t)},item:function(){return""}}),{get:function(t,e){return e in t?t[e]:a.getAttribute(e)},set:function(t,e,n){return a.setAttribute(e,n),!0}}),a.initAttributes(a.config.style),Ut.get(t.DisplayObjectPool).add(a.entity,Qt(a)),a}Yt(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),Ut.get(t.DisplayObjectPool).remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t){var e=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:qt({},this.attributes)});return e.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(n){var r=n.cloneNode(t);e.appendChild(r)})),e},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;this.styleValueRegistry.processProperties(this,t),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Bi(t,n),o=i[0],a=i[1];Te(n)||(r||a!=this.attributes[o])&&(this.internalSetAttribute(o,a),e.prototype.setAttribute.call(this,o,a))},r.internalSetAttribute=function(e,n,r){var i,o=this;void 0===r&&(r={});var a=this.renderable,s=this.attributes[e],u=this.parsedStyle[e];this.styleValueRegistry.processProperties(this,((i={})[e]=n,i),r),this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&this.attributes.clipPathTargets.forEach((function(e){Qu(e),e.dispatchEvent(new Hs(t.ElementEvent.ATTR_MODIFIED,e,o,o,"clipPath",Hs.MODIFICATION,o,o)),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback("clipPath",o,o)})),a.dirty=!0,this.dispatchEvent(new Hs(t.ElementEvent.ATTR_MODIFIED,this,s,n,e,Hs.MODIFICATION,u,this.parsedStyle[e])),this.isCustomElement&&this.isConnected&&this.attributeChangedCallback&&this.attributeChangedCallback(e,s,n)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new na(n,r,i[0]-n,i[1]-r)},r.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setOrigin(this,jr(t,e,n)),this},r.getOrigin=function(){return this.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setPosition(this,jr(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setLocalPosition(this,jr(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translate(this,jr(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translateLocal(this,jr(t,e,n)),this},r.getPosition=function(){return this.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return this.sceneGraphService.getLocalPosition(this)},r.scale=function(t,e,n){return this.scaleLocal(t,e,n)},r.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=jr(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=jr(t,e=e||t,n=n||t)),this.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return this.sceneGraphService.getLocalScale(this)},r.getScale=function(){return this.sceneGraphService.getScale(this)},r.getEulerAngles=function(){var t=Wr(tr(),this.sceneGraphService.getWorldTransform(this));return Hr(t[2])},r.getLocalEulerAngles=function(){var t=Wr(tr(),this.sceneGraphService.getLocalRotation(this));return Hr(t[2])},r.setEulerAngles=function(t){return this.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return this.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return be(e)&&be(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return be(e)&&be(n)?this.sceneGraphService.rotate(this,0,0,t):this.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return this.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return this.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.getRotation=function(){return this.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},r.getLocalTransform=function(){return this.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return this.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return this.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){this.sceneGraphService.resetLocalTransform(this)},r.getAnimations=function(){return this.activeAnimations},r.animate=function(t,e){var n,r,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&(i=null===(r=this.attributes.clipPathTargets[0].ownerDocument)||void 0===r?void 0:r.timeline);return delete this.parsedStyle.transform,i?i.play(new qu(this,t,e)):null},r.show=function(){this.style.visibility="visible"},r.hide=function(){this.style.visibility="hidden"},r.isVisible=function(){var t,e;return"visible"===(null===(t=this.parsedStyle)||void 0===t||null===(e=t.visibility)||void 0===e?void 0:e.value)},r.isInteractive=function(){var t,e;return"none"!==(null===(t=this.parsedStyle)||void 0===t||null===(e=t.pointerEvents)||void 0===e?void 0:e.value)},r.isCulled=function(){return!(!this.cullable||!this.cullable.isCulled())},r.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},r.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},r.getCount=function(){return this.childElementCount},r.getParent=function(){return this.parentElement},r.getChildren=function(){return this.children},r.getFirst=function(){return this.firstElementChild},r.getLast=function(){return this.lastElementChild},r.getChildByIndex=function(t){return this.children[t]||null},r.add=function(t,e){return this.appendChild(t,e)},r.setClip=function(t){this.style.clipPath=t},r.getClip=function(){return this.style.clipPath||null},r.set=function(t,e){this.config[t]=e},r.get=function(t){return this.config[t]},r.getConfig=function(){return this.config},r.attr=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?Pe(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},r.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.setZIndex=function(t){return this.style.zIndex=t,this},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=Xn(tr(),e),r=n[0],i=n[1],o=Kn(tr(),e),a=o[0],s=o[1],u=Zn(Pr(),e),c=Wr(tr(),u);return qr(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=Xr(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},r.setLocalMatrix=function(t){var e=Xr(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},Wt(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(Ws),eu=["style"],nu=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=Jt(r,eu);return(n=t.call(this,qt({style:qt({x:"",y:""},i)},o))||this).isCustomElement=!0,n}return Yt(e,t),e}(tu),ru=["style"],iu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,ru);return e.call(this,qt({type:t.Shape.CIRCLE,style:qt({cx:"",cy:"",r:"",anchor:"0.5 0.5",transformOrigin:"center"},i)},o))||this}return Yt(n,e),n}(tu),ou=["style"],au=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,ou);return e.call(this,qt({type:t.Shape.ELLIPSE,style:qt({cx:"",cy:"",rx:"",ry:"",anchor:"0.5 0.5",transformOrigin:"center"},i)},o))||this}return Yt(n,e),n}(tu),su=["style"],uu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,su);return e.call(this,qt({type:t.Shape.GROUP,style:qt({x:"",y:"",width:"",height:""},i)},o))||this}return Yt(n,e),n}(tu),cu=["style"],lu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,cu);return e.call(this,qt({type:t.Shape.IMAGE,style:qt({x:"",y:"",img:"",width:"",height:""},i)},o))||this}return Yt(n,e),n}(tu),hu=["style"],pu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,hu);return e.call(this,qt({type:t.Shape.LINE,style:qt({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},i)},o))||this}Yt(n,e);var r=n.prototype;return r.getPoint=function(t){var e=this.parsedStyle,n=Hi.pointAt(e.x1.value,e.y1.value,e.x2.value,e.y2.value,t);return new ea(n.x,n.y)},r.getTotalLength=function(){var t=this.parsedStyle;return Hi.length(t.x1.value,t.y1.value,t.x2.value,t.y2.value)},n}(tu),fu=["style"],du=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,fu);return e.call(this,qt({type:t.Shape.PATH,style:qt({path:"",miterLimit:4},i)},o))||this}Yt(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.path.totalLength},r.getPoint=function(t){var e=0,n=0,r=this.parsedStyle.path.curve;if(!this.parsedStyle.path.curveSegments.length)return r?new ea(r[0][1],r[0][2]):null;this.parsedStyle.path.curveSegments.forEach((function(r,i){r[0]>t||t>r[1]||(e=(t-r[0])/(r[1]-r[0]),n=i)}));var i=r[n];if(be(i)||be(n))return null;var o=i.length,a=r[n+1],s=Ki.pointAt(i[o-2],i[o-1],a[1],a[2],a[3],a[4],a[5],a[6],e);return new ea(s.x,s.y)},r.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},r.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(tu),yu=["style"],vu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,yu);return e.call(this,qt({type:t.Shape.POLYGON,style:qt({points:"",miterLimit:4},i)},o))||this}return Yt(n,e),n}(tu),gu=["style"],mu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,gu);return e.call(this,qt({type:t.Shape.POLYLINE,style:qt({points:"",miterLimit:4},i)},o))||this}Yt(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPoint=function(t){var e=this.parsedStyle.points,n=e.points,r=0,i=0;e.segments.forEach((function(e,n){e[0]>t||t>e[1]||(r=(t-e[0])/(e[1]-e[0]),i=n)}));var o=Hi.pointAt(n[i][0],n[i][1],n[i+1][0],n[i+1][1],r);return new ea(o.x,o.y)},r.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(tu),Tu=["style"],bu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Jt(r,Tu);return e.call(this,qt({type:t.Shape.RECT,style:qt({x:"",y:"",width:"",height:"",radius:""},i)},o))||this}return Yt(n,e),n}(tu),Eu=["style"],Su=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=Jt(i,Eu);return(r=e.call(this,qt({type:t.Shape.TEXT,style:qt({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:0,lineHeight:0,miterLimit:10,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},o)},a))||this).LENGTHADJUST_SPACING=1,r.LENGTHADJUST_SPACINGANDGLYPHS=2,r.LENGTHADJUST_UNKNOWN=0,r.lengthAdjust=void 0,r.textLength=void 0,r}Yt(n,e);var r=n.prototype;return r.getCharNumAtPosition=function(t){throw new Error("Method not implemented.")},r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getEndPositionOfChar=function(t){throw new Error("Method not implemented.")},r.getExtentOfChar=function(t){throw new Error("Method not implemented.")},r.getNumberOfChars=function(){throw new Error("Method not implemented.")},r.getRotationOfChar=function(t){throw new Error("Method not implemented.")},r.getStartPositionOfChar=function(t){throw new Error("Method not implemented.")},r.getSubStringLength=function(t,e){throw new Error("Method not implemented.")},r.selectSubString=function(t,e){throw new Error("Method not implemented.")},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},n}(tu),wu=["style"],Pu=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=Jt(i,wu);return(r=e.call(this,qt({type:t.Shape.HTML,style:qt({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,r}Yt(n,e);var r=n.prototype;return r.getDomElement=function(){return this.parsedStyle.$el},r.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new zo;return a.setMinMax(rr(i,o,0),rr(i+n.width,o+n.height,0)),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=zn(Gn(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!zo.isEmpty(e)){var n=new zo;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(tu),ku=function(t){function e(){var e;(e=t.call(this)||this).defaultView=null,e.documentElement=void 0,e.timeline=void 0,e.ownerDocument=null,e.nodeName="document",e.timeline=new Zs(Qt(e));var n={};return hc.forEach((function(t){var e=t.defaultValue;t.inherited&&e&&(n[t.name]=e)})),e.documentElement=new uu({id:"g-root",style:n}),e.documentElement.ownerDocument=Qt(e),e.documentElement.parentNode=Qt(e),e.childNodes=[e.documentElement],e}Yt(e,t);var n=e.prototype;return n.createElement=function(t,e){var n=this.defaultView.customElements.get(t);return n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Su:uu),new n(e)},n.createElementNS=function(t,e,n){return this.createElement(e,n)},n.cloneNode=function(t){throw new Error("Method not implemented.")},n.destroy=function(){try{this.documentElement.destroy()}catch(t){}this.timeline.destroy()},n.elementFromPoint=function(){var t=Ht(Gt().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,p;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(p=t.sent.picked)&&p[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.elementsFromPoint=function(){var t=Ht(Gt().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,p;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(p=t.sent.picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),t.abrupt("return",p);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.appendChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.insertBefore=function(t,e){throw new Error("Use document.documentElement instead.")},n.removeChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.replaceChild=function(t,e,n){throw new Error("Use document.documentElement instead.")},n.append=function(){throw new Error("Use document.documentElement instead.")},n.prepend=function(){throw new Error("Use document.documentElement instead.")},n.getElementById=function(t){return this.documentElement.getElementById(t)},n.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.querySelector=function(t){return this.documentElement.querySelector(t)},n.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.find=function(t){return this.documentElement.find(t)},n.findAll=function(t){return this.documentElement.findAll(t)},Wt(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),e}(Ds),xu=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new ea,e.movement=new ea,e.offset=new ea,e.global=new ea,e.screen=new ea,e}Yt(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw new Error("Method not implemented.")},Wt(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),e}(Is),Cu=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}Yt(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e}(xu),Nu=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return Yt(e,t),e}(xu),_u=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Si,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return Wt(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Ni(t),this._easing=t}}]),t}(),Au=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),Mu=0,Ou=new WeakMap,Iu=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:Qs&&function(t){return t===Qs||t===Js}(t)?Qs:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else Fu.push(this.observer),Uu||(Uu=!0,"undefined"!=typeof globalThis?globalThis.setTimeout(Bu):Bu());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=Ou.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,o=e.relatedNode.namespaceURI;(n=Lu("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===Hs.ADDITION?null:e.prevValue;Du(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return Qs||((Qs=Au.copy(Js)).oldValue=t,Qs)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=Lu("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,Du(r,(function(t){if(t.childList)return n}))}Js=Qs=void 0},e}(),Ru=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=Mu++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=Ou.get(t);r||Ou.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new Iu(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=Ou.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function Lu(t,e){return Js=new Au(t,e)}function Du(t,e){for(var n=t;n;n=n.parentNode){var r=Ou.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var Uu=!1,Fu=[];function Bu(){Uu=!1;var t=Fu;Fu=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=Ou.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&Bu()}function Vu(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(null!=a){if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}else r=!1}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=Number(n[a].computedOffset);if(null!=s&&null!=o){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(s-o)*u/(a-i);i=a,o=s}}}(),n}var Gu="backwards|forwards|both|none".split("|"),ju="reverse|alternate|alternate-reverse".split("|");function Hu(t,e){var n=new _u;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Gu.indexOf(t[e]))return;if("direction"===e&&-1===ju.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function zu(t,e){var n;return Hu(t=Wu(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function Wu(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var qu=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=zu(n,!1),this.timing.effect=this,this.timing.activeDuration=_i(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Vu(e,this.timing),this.interpolations=Ii(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=Ai(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=Vu(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}(),Yu=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,iu),this.define(t.Shape.ELLIPSE,au),this.define(t.Shape.RECT,bu),this.define(t.Shape.IMAGE,lu),this.define(t.Shape.LINE,pu),this.define(t.Shape.GROUP,uu),this.define(t.Shape.PATH,du),this.define(t.Shape.POLYGON,vu),this.define(t.Shape.POLYLINE,mu),this.define(t.Shape.TEXT,Su),this.define(t.Shape.HTML,Pu)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),Xu=i.defineToken("SceneGraphSelectorFactory"),Ku=i.defineToken("SceneGraphSelector",{multiple:!1}),Zu=/\[\s*(.*)=(.*)\s*\]/;function Ju(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Qu(e,n){void 0===n&&(n=!1);for(var r=e;r;){var i=r.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0),r=r.parentNode}e.dispatchEvent(new Rs(t.ElementEvent.BOUNDS_CHANGED,{affectChildren:n}))}t.DefaultSceneGraphSelector=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return e.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&r.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(Zu),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return be(n)?"":n.toString?n.toString():""},t}(),t.DefaultSceneGraphSelector=Ja([lt({token:Ku})],t.DefaultSceneGraphSelector);var $u=i.defineToken("SceneGraphService");t.DefaultSceneGraphService=function(){function e(){var t,e,n,r,i,o=this;this.sceneGraphSelectorFactory=void 0,this.rotate=(t=Pr(),function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=rr(n,r,i));var a=e.transformable;if(null!==e.parentNode&&e.parentNode.transformable){var s=Pr();_r(s,n[0],n[1],n[2]);var u=o.getRotation(e),c=o.getRotation(e.parentNode);Ur(t,c),Nr(t,t),xr(s,t,s),xr(a.localRotation,s,u),Br(a.localRotation,a.localRotation),o.dirtifyLocal(e,a)}else o.rotateLocal(e,n)}),this.rotateLocal=(e=Pr(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=rr(n,r,i));var a=t.transformable;_r(e,n[0],n[1],n[2]),Fr(a.localRotation,a.localRotation,e),o.dirtifyLocal(t,a)}),this.setEulerAngles=(n=Pr(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=rr(e,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){_r(a.localRotation,e[0],e[1],e[2]);var s=o.getRotation(t.parentNode);Ur(n,Nr(Pr(),s)),Fr(a.localRotation,a.localRotation,n),o.dirtifyLocal(t,a)}else o.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=rr(e,n,r));var i=t.transformable;vr(e,tr())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,p=i*h-o*l,f=o*c-r*h,d=r*l-i*c,y=2*n[3];l*=y,h*=y,f*=2,d*=2,t[0]=a+(c*=y)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,i.localRotation),ar(i.localPosition,i.localPosition,e),o.dirtifyLocal(t,i))},this.setPosition=(r=Gn(),function(t,e){var n=t.transformable;e=rr(e[0],e[1],e[2]||0),vr(o.getPosition(t),e)||(n.position=e,null!==t.parentNode&&t.parentNode.transformable?(jn(r,t.parentNode.transformable.worldTransform),zn(r,r),yr(n.localPosition,e,r)):ir(n.localPosition,e),o.dirtifyLocal(t,n))}),this.translate=(i=tr(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=rr(e,n,r)),vr(e,tr())||(ar(i,o.getPosition(t),e),o.setPosition(t,i))}),this.setRotation=function(){var t=Pr();return function(e,n,r,i,a){var s=e.transformable;if("number"==typeof n&&(n=Dr(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var u=o.getRotation(e.parentNode);Ur(t,u),Nr(t,t),xr(s.localRotation,t,n),Br(s.localRotation,s.localRotation),o.dirtifyLocal(e,s)}else o.setLocalRotation(e,n)}}}var n=e.prototype;return n.matches=function(t,e){return this.sceneGraphSelectorFactory().is(t,e)},n.querySelector=function(t,e){return this.sceneGraphSelectorFactory().selectOne(t,e)},n.querySelectorAll=function(t,e){return this.sceneGraphSelectorFactory().selectAll(t,e)},n.attach=function(t,e,n){t.parentNode&&this.detach(t),t.parentNode=e,be(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var r=e.sortable;r&&(r.dirty=!0);var i=t.transformable;i&&this.dirtifyWorld(t,i),i.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e=t.transformable,n=t.parentNode.sortable;n&&(n.dirty=!0);var r=t.parentNode.childNodes.indexOf(t);r>-1&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=rr(e,n,r));var i=t.transformable;if(!vr(e,i.origin)){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},n.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=rr(e,n,r));var i=t.transformable;_r(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.setLocalPosition=function(t,e){var n=t.transformable;e=rr(e[0],e[1],e[2]||0),vr(n.localPosition,e)||(ir(n.localPosition,e),this.dirtifyLocal(t,n))},n.scaleLocal=function(t,e){var n=t.transformable;ur(n.localScale,n.localScale,rr(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},n.setLocalScale=function(t,e){var n=t.transformable,r=rr(e[0],e[1],e[2]||n.localScale[2]);vr(r,n.localScale)||(ir(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=Dr(e,n,r,i));var o=t.transformable;Ur(o.localRotation,e),this.dirtifyLocal(t,o)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),Qu(t,!0)},n.getPosition=function(t){var e=t.transformable;return Xn(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return Zn(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return Kn(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(Jn(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=Xn(tr(),e),r=Zn(Pr(),e),i=Kn(tr(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0])},n.getTransformedGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=this.getGeometryBounds(t,e);if(zo.isEmpty(n))return null;var r=new zo;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry,r=e?n.renderBounds:n.contentBounds||null;return r&&new zo(r.center,r.halfExtents)||new zo},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=this.getTransformedGeometryBounds(t,e);t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(i?i.add(r):(i=new zo).update(r.center,r.halfExtents))}));var o=t.style.clipPath;if(o){var a,s=this.getTransformedGeometryBounds(o,!0);s&&(a=new zo).setFromTransformedAABB(s,this.getWorldTransform(t)),i?a&&(i=a.intersection(i)):i=a}return i&&(e?r.renderBounds=i:r.bounds=i),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,i||new zo},n.getLocalBounds=function(t){if(t.parentNode){var e=Gn();t.parentNode.transformable&&(e=zn(Gn(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!zo.isEmpty(n)){var r=new zo;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);zo.isEmpty(i)||(r=new zo).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=r.getMin(),s=a[0],u=a[1],c=r.getMax();return new na(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new na((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(e,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,e.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||r.dirtifyWorldInternal(t,e)}));var i=e.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0),e.dispatchEvent(new Hs(t.ElementEvent.ATTR_MODIFIED,e,null,null,"modelMatrix",Hs.MODIFICATION,null,null))}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},n.sync=function(t,e){if(e.localDirtyFlag&&(Jn(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?Wn(e.worldTransform,r.worldTransform,e.localTransform):jn(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),Ja([ht(Xu),$a("design:type",Function)],t.DefaultSceneGraphService.prototype,"sceneGraphSelectorFactory",void 0),t.DefaultSceneGraphService=Ja([lt({token:$u})],t.DefaultSceneGraphService);var tc,ec=i.defineToken("ContextService",{multiple:!1});(tc=t.RenderReason||(t.RenderReason={}))[tc.CAMERA_CHANGED=0]="CAMERA_CHANGED",tc[tc.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",tc[tc.NONE=2]="NONE";var nc=i.defineToken("RenderingContext"),rc=i.defineToken("RenderingPluginContribution");t.RenderingService=function(){function e(){this.renderingPluginProvider=void 0,this.renderingContext=void 0,this.sceneGraphService=void 0,this.styleValueRegistry=void 0,this.inited=!1,this.stats={total:0,rendered:0,renderedOnscreen:0},this.zIndexCounter=0,this.hooks={init:new mo,dirtycheck:new Ro(["object"]),cull:new Ro(["object"]),beginFrame:new No([]),beforeRender:new No(["objectToRender"]),render:new No(["objectToRender"]),afterRender:new No(["objectToRender"]),endFrame:new No([]),destroy:new No([]),pick:new So(["result"]),pointerDown:new No(["event"]),pointerUp:new No(["event"]),pointerMove:new No(["event"]),pointerOut:new No(["event"]),pointerOver:new No(["event"]),pointerWheel:new No(["event"]),pointerCancel:new No(["event"])}}var n=e.prototype;return n.init=function(){var t=Ht(Gt().mark((function t(){var e=this;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.renderingPluginProvider.getContributions({cache:!1}).forEach((function(t){t.apply(e)})),t.next=3,this.hooks.init.promise();case 3:this.inited=!0;case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.render=function(t){this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root,t),(this.renderingContext.dirty||t.renderer.getConfig().enableDirtyRectangleRendering&&1===this.stats.total)&&(this.renderingContext.dirty||this.hooks.beginFrame.call(),this.stats.renderedOnscreen=this.stats.rendered,this.hooks.endFrame.call(),this.renderingContext.dirty=!1),this.renderingContext.renderReasons.clear())},n.renderDisplayObject=function(e,n){var r=this,i=n.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.styleValueRegistry.recalc(e);var s=o?this.hooks.dirtycheck.call(e):e;if(s){var u=a?this.hooks.cull.call(s):s;u&&(this.stats.rendered++,this.renderingContext.dirty||(this.renderingContext.dirty=!0,this.hooks.beginFrame.call()),this.hooks.beforeRender.call(u),this.hooks.render.call(u),this.hooks.afterRender.call(u),e.renderable.dirty=!1)}e.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=e.sortable,l=!1;c.dirty&&(c.sorted=e.childNodes.slice().sort(Ju),l=!0,c.dirty=!1),(c.sorted||e.childNodes).forEach((function(t){r.renderDisplayObject(t,n)})),l&&e.forEach((function(e){e.emit(t.ElementEvent.RENDER_ORDER_CHANGED,{renderOrder:e.sortable.renderOrder})}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Ja([Bt(rc),$a("design:type",Object)],t.RenderingService.prototype,"renderingPluginProvider",void 0),Ja([ht(nc),$a("design:type",Object)],t.RenderingService.prototype,"renderingContext",void 0),Ja([ht($u),$a("design:type",Object)],t.RenderingService.prototype,"sceneGraphService",void 0),Ja([ht(ue),$a("design:type",Object)],t.RenderingService.prototype,"styleValueRegistry",void 0),t.RenderingService=Ja([lt()],t.RenderingService);t.EventService=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).renderingContext=void 0,e.contextService=void 0,e.canvasConfig=void 0,e.displayObjectPool=void 0,e.rootTarget=void 0,e.cursor="default",e.mappingTable={},e.mappingState={trackingData:{}},e.eventPool=new Map,e.pickHandler=void 0,e.onPointerDown=function(){var t=Ht(Gt().mark((function t(n){var r;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Cu){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:e.dispatchEvent(r=t.sent,"pointerdown"),"touch"===r.pointerType?e.dispatchEvent(r,"touchstart"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||e.dispatchEvent(r,2===r.button?"rightdown":"mousedown"),e.trackingData(n.pointerId).pressTargetsByButton[n.button]=r.composedPath(),e.freeEvent(r);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUp=function(){var t=Ht(Gt().mark((function t(n){var r,i,o,a,s,u,c,l;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Cu){t.next=2;break}return t.abrupt("return");case 2:return r=performance.now(),t.next=5,e.createPointerEvent(n);case 5:if(e.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?e.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.dispatchEvent(i,2===i.button?"rightup":"mouseup"),o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.pressTargetsByButton[n.button]),s=a,a&&!i.composedPath().includes(a)){for(u=a;u&&!i.composedPath().includes(u);)i.currentTarget=u,e.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?e.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Ds.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[n.button],s=u}s&&((c=e.clonePointerEvent(i,"click")).target=s,c.path=[],o.clicksByButton[n.button]||(o.clicksByButton[n.button]={clickCount:0,target:c.target,timeStamp:r}),(l=o.clicksByButton[n.button]).target===c.target&&200>r-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=r,c.detail=l.clickCount,e.dispatchEvent(c,"mouse"===c.pointerType||"touch"===c.pointerType?"click":"pointertap"),e.freeEvent(c)),e.freeEvent(i);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerMove=function(){var t=Ht(Gt().mark((function t(n){var r,i,o,a,s,u,c,l,h,p;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Cu){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:if(i="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.overTargets),!o.overTargets||a===r.target){t.next=23;break}return s="mousemove"===n.type?"mouseout":"pointerout",t.next=12,e.createPointerEvent(n,s,a||void 0);case 12:if(e.dispatchEvent(u=t.sent,"pointerout"),i&&e.dispatchEvent(u,"mouseout"),r.composedPath().includes(a)){t.next=22;break}return t.next=18,e.createPointerEvent(n,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!r.composedPath().includes(c.target);)c.currentTarget=c.target,e.notifyTarget(c),i&&e.notifyTarget(c,"mouseleave"),Ds.isNode(c.target)&&(c.target=c.target.parentNode);e.freeEvent(c);case 22:e.freeEvent(u);case 23:if(a===r.target){t.next=38;break}l=e.clonePointerEvent(r,"mousemove"===n.type?"mouseover":"pointerover"),e.dispatchEvent(l,"pointerover"),i&&e.dispatchEvent(l,"mouseover"),h=a&&Ds.isNode(a)&&a.parentNode;case 29:if(!h||h===(Ds.isNode(e.rootTarget)&&e.rootTarget.parentNode)){t.next=35;break}if(h!==r.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(Ds.isNode(e.rootTarget)&&e.rootTarget.parentNode)){for((p=e.clonePointerEvent(r,"pointerenter")).eventPhase=p.AT_TARGET;p.target&&p.target!==a&&p.target!==(Ds.isNode(e.rootTarget)&&e.rootTarget.parentNode);)p.currentTarget=p.target,e.notifyTarget(p),i&&e.notifyTarget(p,"mouseenter"),Ds.isNode(p.target)&&(p.target=p.target.parentNode);e.freeEvent(p)}e.freeEvent(l);case 38:e.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&e.dispatchEvent(r,"touchmove"),i&&(e.dispatchEvent(r,"mousemove"),e.cursor=e.getCursor(r.target)),o.overTargets=r.composedPath(),e.freeEvent(r);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOut=function(){var t=Ht(Gt().mark((function t(n){var r,i,o,a,s;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Cu){t.next=2;break}return t.abrupt("return");case 2:if(!(r=e.trackingData(n.pointerId)).overTargets){t.next=19;break}return i="mouse"===n.pointerType||"pen"===n.pointerType,o=e.findMountedTarget(r.overTargets),t.next=8,e.createPointerEvent(n,"pointerout",o||void 0);case 8:return e.dispatchEvent(a=t.sent),i&&e.dispatchEvent(a,"mouseout"),t.next=13,e.createPointerEvent(n,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(Ds.isNode(e.rootTarget)&&e.rootTarget.parentNode);)s.currentTarget=s.target,e.notifyTarget(s),i&&e.notifyTarget(s,"mouseleave"),Ds.isNode(s.target)&&(s.target=s.target.parentNode);r.overTargets=null,e.freeEvent(a),e.freeEvent(s);case 19:e.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOver=function(){var t=Ht(Gt().mark((function t(n){var r,i,o,a;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Cu){t.next=2;break}return t.abrupt("return");case 2:return r=e.trackingData(n.pointerId),t.next=5,e.createPointerEvent(n);case 5:for(o="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,e.dispatchEvent(i,"pointerover"),o&&e.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(e.cursor=e.getCursor(i.target)),(a=e.clonePointerEvent(i,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(Ds.isNode(e.rootTarget)&&e.rootTarget.parentNode);)a.currentTarget=a.target,e.notifyTarget(a),o&&e.notifyTarget(a,"mouseenter"),Ds.isNode(a.target)&&(a.target=a.target.parentNode);r.overTargets=i.composedPath(),e.freeEvent(i),e.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUpOutside=function(){var t=Ht(Gt().mark((function t(n){var r,i,o,a;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Cu){t.next=2;break}return t.abrupt("return");case 2:return r=e.trackingData(n.pointerId),i=e.findMountedTarget(r.pressTargetsByButton[n.button]),t.next=6,e.createPointerEvent(n);case 6:if(o=t.sent,i){for(a=i;a;)o.currentTarget=a,e.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||e.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),Ds.isNode(a)&&(a=a.parentNode);delete r.pressTargetsByButton[n.button]}e.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onWheel=function(){var t=Ht(Gt().mark((function t(n){var r;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Nu){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createWheelEvent(n);case 4:e.dispatchEvent(r=t.sent),e.freeEvent(r);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e}Yt(e,t);var n=e.prototype;return n.init=function(){this.rootTarget=this.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},n.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new ea(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},n.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new ea(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},n.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.canvasConfig,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=Wn(Gn(),u,s),l=rr(e/o*2-1,2*(1-n/a)-1,0);return yr(l,l,c),new ea(l[0],l[1])},n.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=Wn(Gn(),n,r),o=rr(t.x,t.y,0);yr(o,o,i);var a=this.canvasConfig;return new ea((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},n.setPickHandler=function(t){this.pickHandler=t},n.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},n.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},n.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emit(e||t.type,t)},n.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},n.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Ds.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},n.hitTest=function(){var t=Ht(Gt().mark((function t(e){var n,r,i,o,a;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.viewportY,o=(i=this.canvasConfig).width,a=i.height,!(0>(n=e.viewportX)||0>r||n>o||r>a)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.isNativeEventFromCanvas=function(t){var e,n=this.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},n.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=te(this.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},n.pickTarget=function(){var t=Ht(Gt().mark((function t(e){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.createPointerEvent=function(){var t=Ht(Gt().mark((function t(e,n,r){var i,o;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(Cu),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,o=this.getExistedHTML(i),null==r){t.next=11;break}t.t0=r,t.next=20;break;case 11:if(t.t1=o,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(i),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(i);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.createWheelEvent=function(){var t=Ht(Gt().mark((function t(e){var n,r;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Nu),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},n.clonePointerEvent=function(t,e){var n=this.allocateEvent(Cu);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},n.copyPointerData=function(t,e){t instanceof Cu&&e instanceof Cu&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},n.copyMouseData=function(t,e){t instanceof xu&&e instanceof xu&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},n.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},n.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},n.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},n.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},n.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},n.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},n.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Ds.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},n.getCursor=function(t){for(var e=t;e;){var n=Ws.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Ds.isNode(e)&&e.parentNode}},e}(ne.EventEmitter),Ja([ht(nc),$a("design:type",Object)],t.EventService.prototype,"renderingContext",void 0),Ja([ht(ec),$a("design:type",Object)],t.EventService.prototype,"contextService",void 0),Ja([ht(Qi),$a("design:type",Object)],t.EventService.prototype,"canvasConfig",void 0),Ja([ht(t.DisplayObjectPool),$a("design:type",t.DisplayObjectPool)],t.EventService.prototype,"displayObjectPool",void 0),Ja([Y.postConstruct(),$a("design:type",Function),$a("design:paramtypes",[]),$a("design:returntype",void 0)],t.EventService.prototype,"init",null),t.EventService=Ja([lt()],t.EventService),t.OffscreenCanvasCreator=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}(),t.OffscreenCanvasCreator=Ja([lt()],t.OffscreenCanvasCreator);var ic={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},oc=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ac=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),sc=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source);t.TextService=function(){function t(){var t=this;this.cache={},this.offscreenCanvas=void 0,this.shouldBreakByKinsokuShorui=function(e,n){return!t.isBreakingSpace(n)&&!(!e||!sc.exec(n)&&!ac.exec(e))},this.trimByKinsokuShorui=function(t){var e=[].concat(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}var e=t.prototype;return e.measureFont=function(t,e){if(this.cache[t])return this.cache[t];var n={ascent:0,descent:0,fontSize:0},r=this.offscreenCanvas.getOrCreateCanvas(e),i=this.offscreenCanvas.getOrCreateContext(e);i.font=t;var o=ic.MetricsString+ic.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(ic.BaselineSymbol).width),u=ic.HeightMultiplier*s;s=s*ic.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(var v=0;h>v;v+=4)if(255!==c[f+v]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.cache[t]=n,n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=void 0===o?0:o,s=e.lineWidth,u=e.textBaseline,c=e.textAlign,l=e.letterSpacing,h=void 0===l?0:l,p=e.leading,f=void 0===p?0:p,d=Do(e),y=this.measureFont(d,n);0===y.fontSize&&(y.fontSize=r.value,y.ascent=r.value);var v=this.offscreenCanvas.getOrCreateContext(n);v.font=d;for(var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=new Array(g.length),T=0,b=0;g.length>b;b++){var E=v.measureText(g[b]).width+(g[b].length-1)*h;m[b]=E,T=Math.max(T,E)}var S=T+s.value,w=a||y.fontSize+s.value,P=Math.max(w,y.fontSize+s.value)+(g.length-1)*(w+f),k=0;return"middle"===u.value?k=-P/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?k=-P:"top"!==u.value&&"hanging"!==u.value||(k=0),{font:d,width:S,height:P,lines:g,lineWidths:m,lineHeight:w+=f,maxLineWidth:T,fontProperties:y,lineMetrics:m.map((function(t,e){var n=0;return"center"===c.value?n-=t/2:"right"!==c.value&&"end"!==c.value||(n-=t),new na(n-s.value/2,k+e*w,t+s.value,w)}))}},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,u=this.offscreenCanvas.getOrCreateContext(n),c=o+s,l=[],h=0,p=0,f={},d=function(t){return r.getFromCache(t,s,f,u)};return Array.from(t).forEach((function(e,n){var i=t[n-1],o=t[n+1],a=d(e);if(r.isNewline(e))return h++,p=0,void(l[h]="");if(p>0&&p+a>c){if(h++,p=0,l[h]="",r.isBreakingSpace(e))return;r.canBreakInLastChar(e)||(l=r.trimToBreakable(l),p=r.sumTextWidthByCache(l[h]||"",f)),r.shouldBreakByKinsokuShorui(e,o)&&(l=r.trimByKinsokuShorui(l),p+=d(i||""))}p+=a,l[h]=(l[h]||"")+e})),l.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&ic.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&ic.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!oc.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!oc.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Ja([ht(t.OffscreenCanvasCreator),$a("design:type",t.OffscreenCanvasCreator)],t.TextService.prototype,"offscreenCanvas",void 0),t.TextService=Ja([lt()],t.TextService);var uc=i.defineToken("GeometryUpdaterFactory"),cc=i.defineToken("GeometryAABBUpdater");function lc(t){var e=t.parsedStyle.fontSize;return e&&!Re.isRelativeUnit(e.unit)?e.clone():new Re(0,"px")}t.CircleUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n.value,height:2*n.value}},t}(),t.CircleUpdater=Ja([lt({token:{token:cc,named:t.Shape.CIRCLE}})],t.CircleUpdater),t.EllipseUpdater=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx.value,height:2*t.ry.value}},t}(),t.EllipseUpdater=Ja([lt({token:{token:cc,named:t.Shape.ELLIPSE}})],t.EllipseUpdater),t.RectUpdater=function(){function e(){}return e.prototype.update=function(e,n){var r=e.img,i=e.width,o=e.height,a=0,s=0;return i instanceof Re&&i.unit===t.UnitType.kPixels&&(a=i.value),o instanceof Re&&o.unit===t.UnitType.kPixels&&(s=o.value),r&&!Oi(r)&&(a||(a=r.width),s||(s=r.height)),i instanceof Re&&(i.value=a),o instanceof Re&&(o.value=s),{width:a,height:s}},e}(),t.RectUpdater=Ja([lt({token:[{token:cc,named:t.Shape.RECT},{token:cc,named:t.Shape.IMAGE},{token:cc,named:t.Shape.GROUP}]})],t.RectUpdater),t.TextUpdater=function(){function t(){this.textService=void 0}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&t.lineWidth},e.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.textService.measureText(i,t,l);t.metrics=h;var p=h.lineHeight,f=h.fontProperties,d=rr(h.width/2,h.height/2,0),y=[0,1],v=0;"center"===o.value?(v=a.value/2,y=[.5,1]):"right"!==o.value&&"end"!==o.value||(v=a.value,y=[1,1]);var g=0;return"middle"===s.value?g=d[1]:"top"===s.value||"hanging"===s.value?g=2*d[1]:"alphabetic"===s.value?g=p-f.ascent:"bottom"!==s.value&&"ideographic"!==s.value||(g=0),u&&(v+=u.value),c&&(g+=c.value),t.anchor=[new Re(y[0]),new Re(y[1]),new Re(0)],{width:2*d[0],height:2*d[1],offsetX:v,offsetY:g}},t}(),Ja([ht(t.TextService),$a("design:type",t.TextService)],t.TextUpdater.prototype,"textService",void 0),t.TextUpdater=Ja([lt({token:{token:cc,named:t.Shape.TEXT}})],t.TextUpdater),t.LineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e.value,r.value),a=Math.max(e.value,r.value),s=Math.min(n.value,i.value);return{width:a-o,height:Math.max(n.value,i.value)-s}},t}(),t.LineUpdater=Ja([lt({token:{token:cc,named:t.Shape.LINE}})],t.LineUpdater),t.PolylineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),r=Math.max.apply(Math,e.map((function(t){return t[0]}))),i=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:r-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-i}},t}(),t.PolylineUpdater=Ja([lt({token:[{token:cc,named:t.Shape.POLYLINE},{token:cc,named:t.Shape.POLYGON}]})],t.PolylineUpdater),t.PathUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),t.PathUpdater=Ja([lt({token:{token:cc,named:t.Shape.PATH}})],t.PathUpdater),t.CSSPropertyClipPath=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){if(n instanceof ye&&(n=null),e&&e!==n&&e.style.clipPathTargets){var i=e.style.clipPathTargets.indexOf(r);e.style.clipPathTargets.splice(i,1)}return n&&(n.style.clipPathTargets||(n.style.clipPathTargets=[]),n.style.clipPathTargets.push(r)),Qu(r),n},t}(),t.CSSPropertyClipPath=Ja([lt({token:{token:Os,named:t.PropertySyntax.CLIP_PATH}})],t.CSSPropertyClipPath),t.CSSPropertyColor=function(){function t(){this.parser=Go,this.mixer=jo}return t.prototype.calculator=function(t,e,n,r){return n instanceof ye?new Ye(0,0,0,0,"none"===n.value):n},t}(),t.CSSPropertyColor=Ja([lt({token:[{token:Os,named:t.PropertySyntax.PAINT},{token:Os,named:t.PropertySyntax.COLOR}]})],t.CSSPropertyColor),t.CSSPropertyFilter=function(){this.parser=Za},t.CSSPropertyFilter=Ja([lt({token:{token:Os,named:t.PropertySyntax.FILTER}})],t.CSSPropertyFilter),t.CSSPropertyLengthOrPercentage=function(){function e(){this.parser=oa,this.mixer=sa}return e.prototype.calculator=function(e,n,r,i,o){if(!Re.isRelativeUnit(r.unit))return r.clone();if(r.unit===t.UnitType.kPercentage)return new Re(0,"px");if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=lc(i.parentNode);return a.value*=r.value,a}return new Re(0,"px")}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=lc(i.ownerDocument.documentElement);return u.value*=r.value,u}return new Re(0,"px")}},e}(),t.CSSPropertyLengthOrPercentage=Ja([lt({token:{token:Os,named:t.PropertySyntax.LENGTH_PERCENTAGE}})],t.CSSPropertyLengthOrPercentage),t.CSSPropertyLengthOrPercentage12=function(){function t(){this.mixer=la}return t.prototype.parser=function(t){var e=ca(Ee(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t}(),t.CSSPropertyLengthOrPercentage12=Ja([lt({token:{token:Os,named:t.PropertySyntax.LENGTH_PERCENTAGE_12}})],t.CSSPropertyLengthOrPercentage12),t.CSSPropertyLengthOrPercentage14=function(){function t(){this.mixer=la}return t.prototype.parser=function(t){var e=ca(Ee(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t}(),t.CSSPropertyLengthOrPercentage14=Ja([lt({token:{token:Os,named:t.PropertySyntax.LENGTH_PERCENTAGE_14}})],t.CSSPropertyLengthOrPercentage14),t.CSSPropertyLocalPosition=function(e){function n(){return e.apply(this,arguments)||this}return Yt(n,e),n.prototype.postProcessor=function(e){var n,r,i;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,a=o.cx,s=o.cy;be(a)||(n=a.value),be(s)||(r=s.value);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1.value,u.x2.value),r=Math.min(c.value,l.value),i=0;break;default:be(e.parsedStyle.x)||(n=e.parsedStyle.x.value),be(e.parsedStyle.y)||(r=e.parsedStyle.y.value)}e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0;var h=e.getLocalPosition(),p=h[0],f=h[1],d=h[2];e.setLocalPosition(be(n)?p:n,be(r)?f:r,be(i)?d:i)},n}(t.CSSPropertyLengthOrPercentage),t.CSSPropertyLocalPosition=Ja([lt({token:{token:Os,named:t.PropertySyntax.COORDINATE}})],t.CSSPropertyLocalPosition),t.CSSPropertyOffsetDistance=function(){function e(){this.parser=fa,this.mixer=ya(0,1)}return e.prototype.postProcessor=function(e){if(e.attributes.offsetPath){var n=e.attributes.offsetPath.nodeName;if(n===t.Shape.LINE||n===t.Shape.PATH||n===t.Shape.POLYLINE){var r=e.attributes.offsetPath.getPoint(e.parsedStyle.offsetDistance.value);r&&e.setLocalPosition(r.x,r.y)}}},e}(),t.CSSPropertyOffsetDistance=Ja([lt({token:{token:Os,named:t.PropertySyntax.OFFSET_DISTANCE}})],t.CSSPropertyOffsetDistance),t.CSSPropertyOffsetPath=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){if(e&&e!==n&&e.style.offsetPathTargets){var i=e.style.offsetPathTargets.indexOf(r);e.style.offsetPathTargets.splice(i,1)}return n&&(n.style.offsetPathTargets||(n.style.offsetPathTargets=[]),n.style.offsetPathTargets.push(r)),n},t}(),t.CSSPropertyOffsetPath=Ja([lt({token:{token:Os,named:t.PropertySyntax.OFFSET_PATH}})],t.CSSPropertyOffsetPath),t.CSSPropertyOpacity=function(){this.parser=fa,this.mixer=ya(0,1)},t.CSSPropertyOpacity=Ja([lt({token:{token:Os,named:t.PropertySyntax.OPACITY_VALUE}})],t.CSSPropertyOpacity),t.CSSPropertyPath=function(){function e(){this.parser=Ga,this.mixer=ja}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof ye&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,curveSegments:[],zCommandIndexes:[],rect:new na(0,0,0,0)}:n},n.postProcessor=function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,r=n.defX,i=n.defY;e.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}},e}(),t.CSSPropertyPath=Ja([lt({token:{token:Os,named:t.PropertySyntax.PATH}})],t.CSSPropertyPath),t.CSSPropertyPoints=function(){function e(){this.parser=Ha}return e.prototype.postProcessor=function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}},e}(),t.CSSPropertyPoints=Ja([lt({token:{token:Os,named:t.PropertySyntax.LIST_OF_POINTS}})],t.CSSPropertyPoints),t.CSSPropertyShadowBlur=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=ya(0,1/0),e}return Yt(e,t),e}(t.CSSPropertyLengthOrPercentage),t.CSSPropertyShadowBlur=Ja([lt({token:{token:Os,named:t.PropertySyntax.SHADOW_BLUR}})],t.CSSPropertyShadowBlur),t.CSSPropertyText=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof ye?"unset"===n.value?"":n.value:n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),t.CSSPropertyText=Ja([lt({token:{token:Os,named:t.PropertySyntax.TEXT}})],t.CSSPropertyText),t.CSSPropertyTextTransform=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n},t}(),t.CSSPropertyTextTransform=Ja([lt({token:{token:Os,named:t.PropertySyntax.TEXT_TRANSFORM}})],t.CSSPropertyTextTransform),t.CSSPropertyTransform=function(){function t(){this.parser=Ps,this.mixer=Cs}return t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.transform,r=e.defX,i=e.defY;n&&n.length&&(t.resetLocalTransform(),t.setLocalPosition(r,i),n.forEach((function(e){var n=e.t,r=e.d;if("scale"===n){var i=r.map((function(t){return t.value}))||[1,1];t.scaleLocal(i[0],i[1],1)}else if("scalex"===n){var o=r.map((function(t){return t.value}))||[1];t.scaleLocal(o[0],1,1)}else if("scaley"===n){var a=r.map((function(t){return t.value}))||[1];t.scaleLocal(1,a[0],1)}else if("scalez"===n){var s=r.map((function(t){return t.value}))||[1];t.scaleLocal(1,1,s[0])}else if("scale3d"===n){var u=r.map((function(t){return t.value}))||[1,1,1];t.scaleLocal(u[0],u[1],u[2])}else if("translate"===n){var c=r||[We,We];t.translateLocal(c[0].value,c[1].value,0)}else if("translatex"===n){t.translateLocal((r||[We])[0].value,0,0)}else if("translatey"===n){t.translateLocal(0,(r||[We])[0].value,0)}else if("translatez"===n){t.translateLocal(0,0,(r||[We])[0].value)}else if("translate3d"===n){var l=r||[We,We,We];t.translateLocal(l[0].value,l[1].value,l[2].value)}else if("rotate"===n){t.rotateLocal(0,0,(r||[qe])[0].value)}else if("rotatex"===n){t.rotateLocal((r||[qe])[0].value,0,0)}else if("rotatey"===n){t.rotateLocal(0,(r||[qe])[0].value,0)}else if("rotatez"===n){t.rotateLocal(0,0,(r||[qe])[0].value)}})))},t}(),t.CSSPropertyTransform=Ja([lt({token:{token:Os,named:t.PropertySyntax.TRANSFORM}})],t.CSSPropertyTransform),t.CSSPropertyTransformOrigin=function(){this.parser=Ns},t.CSSPropertyTransformOrigin=Ja([lt({token:{token:Os,named:t.PropertySyntax.TRANSFORM_ORIGIN}})],t.CSSPropertyTransformOrigin),t.CSSPropertyZIndex=function(){function t(){this.parser=fa}return t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}},t}(),t.CSSPropertyZIndex=Ja([lt({token:{token:Os,named:t.PropertySyntax.Z_INDEX}})],t.CSSPropertyZIndex);var hc=[{name:"display",keywords:["none"]},{name:"opacity",interpolable:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fillOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"strokeOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fill",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"stroke",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"shadowColor",interpolable:!0,syntax:t.PropertySyntax.COLOR},{name:"shadowOffsetX",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowOffsetY",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowBlur",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.SHADOW_BLUR},{name:"lineWidth",interpolable:!0,inherited:!0,defaultValue:"1",layoutDependent:!0,alias:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"increasedLineWidthForHitTesting",inherited:!0,defaultValue:"0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"lineJoin",inherited:!0,layoutDependent:!0,alias:["strokeLinejoin"],keywords:["miter","bevel","round"],defaultValue:"miter"},{name:"lineCap",inherited:!0,layoutDependent:!0,alias:["strokeLinecap"],keywords:["butt","round","square"],defaultValue:"butt"},{name:"lineDash",interpolable:!0,inherited:!0,keywords:["none"],alias:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"lineDashOffset",interpolable:!0,inherited:!0,defaultValue:"0",alias:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"offsetPath",syntax:t.PropertySyntax.OFFSET_PATH},{name:"offsetDistance",interpolable:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{name:"dx",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"dy",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"zIndex",independent:!0,interpolable:!0,defaultValue:"0",keywords:["auto"],syntax:t.PropertySyntax.Z_INDEX},{name:"visibility",keywords:["visible","hidden"],independent:!0,inherited:!0,defaultValue:"visible"},{name:"pointerEvents",inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],defaultValue:"auto"},{name:"filter",independent:!0,layoutDependent:!0,syntax:t.PropertySyntax.FILTER},{name:"clipPath",syntax:t.PropertySyntax.CLIP_PATH},{name:"transform",parsePriority:100,interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.TRANSFORM},{name:"transformOrigin",parsePriority:100,defaultValue:"left top",layoutDependent:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{name:"anchor",parsePriority:99,defaultValue:"0 0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"cx",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"cy",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"r",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"rx",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"ry",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"x",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"y",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"z",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"width",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"height",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"radius",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{name:"x1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"x2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"path",interpolable:!0,layoutDependent:!0,defaultValue:"",alias:["d"],syntax:t.PropertySyntax.PATH},{name:"points",layoutDependent:!0,syntax:t.PropertySyntax.LIST_OF_POINTS},{name:"text",layoutDependent:!0,defaultValue:"",syntax:t.PropertySyntax.TEXT,parsePriority:50},{name:"textTransform",layoutDependent:!0,inherited:!0,keywords:["capitalize","uppercase","lowercase","none"],defaultValue:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,parsePriority:51},{name:"font",layoutDependent:!0},{name:"fontSize",interpolable:!0,inherited:!0,defaultValue:"16px",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"fontFamily",layoutDependent:!0,inherited:!0,defaultValue:"sans-serif"},{name:"fontStyle",layoutDependent:!0,inherited:!0,keywords:["normal","italic","oblique"],defaultValue:"normal"},{name:"fontWeight",layoutDependent:!0,inherited:!0,keywords:["normal","bold","bolder","lighter"],defaultValue:"normal"},{name:"fontVariant",layoutDependent:!0,inherited:!0,keywords:["normal","small-caps"],defaultValue:"normal"},{name:"lineHeight",layoutDependent:!0},{name:"letterSpacing",layoutDependent:!0},{name:"wordWrap",layoutDependent:!0},{name:"wordWrapWidth",layoutDependent:!0},{name:"leading",layoutDependent:!0},{name:"textBaseline",layoutDependent:!0,inherited:!0,keywords:["top","hanging","middle","alphabetic","ideographic","bottom"],defaultValue:"alphabetic"},{name:"textAlign",layoutDependent:!0,inherited:!0,keywords:["start","center","end","left","right"],defaultValue:"start"},{name:"whiteSpace",layoutDependent:!0}];t.DefaultStyleValueRegistry=function(){function e(){this.dirty=!1,this.cache={},this.unresolvedProperties={},this.propertySyntaxFactory=void 0,this.cascadeProperties={}}var n=e.prototype;return n.init=function(){var t=this;hc.forEach((function(e){t.registerMetadata(e)}))},n.registerMetadata=function(t){var e=this;[t.name].concat(t.alias||[]).forEach((function(n){e.cache[n]=t}))},n.unregisterMetadata=function(t){delete this.cache[t]},n.getMetadata=function(t){return this.cache[t]},n.getPropertySyntax=function(t){return this.propertySyntaxFactory(t)},n.processProperties=function(t,e,n){var r=this;void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1});var i=n.skipUpdateAttribute,o=n.skipParse,a=!1;Object.keys(e).forEach((function(n){var o,s=Bi(n,e[n]),u=s[0];i||(t.attributes[u]=s[1]),!a&&(null===(o=r.getMetadata(u))||void 0===o?void 0:o.layoutDependent)&&(a=!0)}));var s=Object.keys(e).sort((function(t,e){var n,i;return((null===(n=r.getMetadata(t))||void 0===n?void 0:n.parsePriority)||0)-((null===(i=r.getMetadata(e))||void 0===i?void 0:i.parsePriority)||0)}));o||s.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)}));var u=!1;s.forEach((function(e){e in t.computedStyle&&(u=r.computeProperty(e,t.computedStyle[e],t))})),u?this.dirty=!0:(a&&this.updateGeometry(t),s.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t)})),s.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))})))},n.parseProperty=function(t,e,n){var r=this.getMetadata(t),i=e;if((""===e||be(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=new ye(e);else if(r){var o=r.keywords,a=r.syntax,s=a&&this.getPropertySyntax(a);if(o&&o.indexOf(e)>-1)i=new ye(e);else if(s){s&&s.parser&&(i=s.parser(e,n))}}return i},n.computeProperty=function(t,e,n){var r=this.getMetadata(t),i="g-root"===n.id,o=e instanceof fe?e.clone():e;if(r){var a=r.syntax,s=r.defaultValue;if(e instanceof ye){var u=e.value;if("unset"===u&&(u=r.inherited&&!i?"inherit":"initial"),"initial"===u)be(s)||(e=this.parseProperty(t,s,n));else if("inherit"===u){var c=this.tryToResolveProperty(n,t,{inherited:!0});return c?(n.parsedStyle[t]=c,!1):(this.addUnresolveProperty(n,t),!0)}}var l=a&&this.getPropertySyntax(a);if(l)if(l.calculator)o=l.calculator(t,n.parsedStyle[t],e,n,this);else o=e;else o=e}return n.parsedStyle[t]=o,!1},n.postProcessProperty=function(t,e){var n=this.getMetadata(t);if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}},n.isPropertyResolved=function(t,e){return!this.unresolvedProperties[t.entity]||0===this.unresolvedProperties[t.entity].length||this.unresolvedProperties[t.entity].includes(e)},n.addUnresolveProperty=function(t,e){this.unresolvedProperties[t.entity]||(this.unresolvedProperties[t.entity]=[]),-1===this.unresolvedProperties[t.entity].indexOf(e)&&this.unresolvedProperties[t.entity].push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&this.isPropertyResolved(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];return(!(r instanceof ye)||"unset"!==r.value&&"initial"!==r.value&&"inherit"!==r.value)&&(!(r instanceof Re&&Re.isRelativeUnit(r.unit))&&r)}return!1},n.recalc=function(t){var e=this.unresolvedProperties[t.entity];if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),delete this.unresolvedProperties[t.entity]}},n.updateGeometry=function(e){var n=Ut.get(uc)(e.nodeName);if(n){var r,i=e.geometry;i.contentBounds||(i.contentBounds=new zo),i.renderBounds||(i.renderBounds=new zo);var o=e.parsedStyle,a=n.update(o,e),s=a.depth,u=a.offsetX,c=void 0===u?0:u,l=a.offsetY,h=void 0===l?0:l,p=a.offsetZ,f=void 0===p?0:p,d=rr(a.width/2,a.height/2,(void 0===s?0:s)/2),y=o.lineWidth,v=o.increasedLineWidthForHitTesting,g=o.shadowColor,m=o.filter,T=void 0===m?[]:m,b=o.transformOrigin,E=o.anchor;e.nodeName===t.Shape.TEXT&&delete o.anchor;var S=rr((1-2*(E&&E[0].value||0))*d[0]+c,(1-2*(E&&E[1].value||0))*d[1]+h,(1-2*(E&&(null===(r=E[2])||void 0===r?void 0:r.value)||0))*d[2]+f);i.contentBounds.update(S,d);var w=(((null==y?void 0:y.value)||0)+((null==v?void 0:v.value)||0))/2;if(ar(d,d,rr(w,w,0)),i.renderBounds.update(S,d),g){var P=i.renderBounds,k=P.min,x=P.max,C=o.shadowBlur,N=o.shadowOffsetX,_=o.shadowOffsetY,A=C&&C.value||0,M=N&&N.value||0,O=_&&_.value||0,I=x[0]+A+M,R=k[1]-A+O,L=x[1]+A+O;k[0]=Math.min(k[0],k[0]-A+M),x[0]=Math.max(x[0],I),k[1]=Math.min(k[1],R),x[1]=Math.max(x[1],L),i.renderBounds.setMinMax(k,x)}T.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,ar(i.renderBounds.halfExtents,i.renderBounds.halfExtents,rr(r,r,0)))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),i.renderBounds.setMinMax(c,l)}})),E=o.anchor;var D=ha(b[0],0,e),U=ha(b[1],1,e);e.setOrigin(D-=(E&&E[0].value||0)*i.contentBounds.halfExtents[0]*2,U-=(E&&E[1].value||0)*i.contentBounds.halfExtents[1]*2),e.emit(t.ElementEvent.GEOMETRY_BOUNDS_CHANGED,{}),Qu(e)}},n.isPropertyInheritable=function(t){var e=this.getMetadata(t);return!!e&&e.inherited},e}(),Ja([ht(Ms),$a("design:type",Function)],t.DefaultStyleValueRegistry.prototype,"propertySyntaxFactory",void 0),Ja([Y.postConstruct(),$a("design:type",Function),$a("design:paramtypes",[]),$a("design:returntype",void 0)],t.DefaultStyleValueRegistry.prototype,"init",null),t.DefaultStyleValueRegistry=Ja([lt({token:ue})],t.DefaultStyleValueRegistry);var pc,fc,dc,yc=Ot((function(e){Y.decorate(ct(),ne.EventEmitter),e(t.DisplayObjectPool),e(t.DefaultSceneGraphSelector),e({token:Xu,useFactory:function(t){return function(){return t.container.get(Ku)}}}),e(t.DefaultSceneGraphService),e(t.OffscreenCanvasCreator),e(t.TextService),e(t.CircleUpdater),e(t.EllipseUpdater),e(t.RectUpdater),e(t.TextUpdater),e(t.LineUpdater),e(t.PolylineUpdater),e(t.PathUpdater),e({token:uc,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(cc,n)&&(e[n]=t.container.getNamed(cc,n)),e[n]}}}),e(t.CSSPropertyAngle),e(t.CSSPropertyClipPath),e(t.CSSPropertyColor),e(t.CSSPropertyFilter),e(t.CSSPropertyLengthOrPercentage),e(t.CSSPropertyLengthOrPercentage12),e(t.CSSPropertyLengthOrPercentage14),e(t.CSSPropertyLocalPosition),e(t.CSSPropertyOffsetDistance),e(t.CSSPropertyOffsetPath),e(t.CSSPropertyOpacity),e(t.CSSPropertyPath),e(t.CSSPropertyPoints),e(t.CSSPropertyShadowBlur),e(t.CSSPropertyText),e(t.CSSPropertyTextTransform),e(t.CSSPropertyTransform),e(t.CSSPropertyTransformOrigin),e(t.CSSPropertyZIndex),e({token:Ms,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Os,n)&&(e[n]=t.container.getNamed(Os,n)),e[n]}}}),e(t.DefaultStyleValueRegistry),e(t.LayoutRegistry),e(t.LayoutEngine),e(t.LayoutEdges),e({token:fs,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:ds,useValue:n}),r.get(t.LayoutEdges)}}}),e({token:ns,useFactory:function(e){return function(n){var r=e.container.createChild();r.register(t.LayoutContext),r.register(t.LayoutChildren),r.register({token:us,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:cs,useValue:n}),r.get(t.LayoutChildren)}}}),r.register(t.FragmentResult),r.register({token:os,useFactory:function(e){return function(n,r){var i=e.container.createChild();return i.register({token:as,useValue:n}),i.register({token:ss,useValue:r}),i.get(t.FragmentResult)}}}),r.register(t.LayoutFragment),r.register({token:gs,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:ms,useValue:n}),r.get(t.LayoutFragment)}}});var i=r.get(us),o=r.get(gs),a=r.get(os);return r.register({token:rs,useValue:qt({},n,{layoutChildrenFactory:i,layoutFragmentFactory:o,fragmentResultFactory:a})}),r.get(t.LayoutContext)}}})})),vc=i.defineToken("DefaultCamera");(pc=t.CameraType||(t.CameraType={}))[pc.ORBITING=0]="ORBITING",pc[pc.EXPLORING=1]="EXPLORING",pc[pc.TRACKING=2]="TRACKING",(fc=t.CameraTrackingMode||(t.CameraTrackingMode={}))[fc.DEFAULT=0]="DEFAULT",fc[fc.ROTATIONAL=1]="ROTATIONAL",fc[fc.TRANSLATIONAL=2]="TRANSLATIONAL",fc[fc.CINEMATIC=3]="CINEMATIC",(dc=t.CameraProjectionMode||(t.CameraProjectionMode={}))[dc.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",dc[dc.PERSPECTIVE=1]="PERSPECTIVE";var gc={UPDATED:"updated"},mc=Math.PI/180,Tc=180/Math.PI,bc=2e-4,Ec=function(e){function n(n,r){var i;return void 0===n&&(n=t.CameraType.EXPLORING),void 0===r&&(r=t.CameraTrackingMode.DEFAULT),(i=e.call(this)||this).canvas=void 0,i.matrix=Gn(),i.right=rr(1,0,0),i.up=rr(0,1,0),i.forward=rr(0,0,1),i.position=rr(0,0,1),i.focalPoint=rr(0,0,0),i.distanceVector=rr(0,0,-1),i.distance=1,i.azimuth=0,i.elevation=0,i.roll=0,i.relAzimuth=0,i.relElevation=0,i.relRoll=0,i.dollyingStep=0,i.maxDistance=1/0,i.minDistance=-1/0,i.zoom=1,i.rotateWorld=!1,i.fov=30,i.near=.1,i.far=1e3,i.aspect=1,i.left=void 0,i.rright=void 0,i.top=void 0,i.bottom=void 0,i.projectionMatrix=Gn(),i.projectionMatrixInverse=Gn(),i.jitteredProjectionMatrix=void 0,i.view=void 0,i.enableUpdate=!0,i.type=t.CameraType.EXPLORING,i.trackingMode=t.CameraTrackingMode.DEFAULT,i.projectionMode=t.CameraProjectionMode.PERSPECTIVE,i.frustum=new Xo,i.landmarks=[],i.landmarkAnimationID=void 0,i.orthoMatrix=Gn(),i.setType(n,r),i}Yt(n,e);var r=n.prototype;return r.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},r.getProjectionMode=function(){return this.projectionMode},r.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},r.getPerspectiveInverse=function(){return this.projectionMatrixInverse},r.getFrustum=function(){return this.frustum},r.getPosition=function(){return this.position},r.getFocalPoint=function(){return this.focalPoint},r.getDollyingStep=function(){return this.dollyingStep},r.getNear=function(){return this.near},r.getFar=function(){return this.far},r.getZoom=function(){return this.zoom},r.getOrthoMatrix=function(){return this.orthoMatrix},r.getView=function(){return this.view},r.setEnableUpdate=function(t){this.enableUpdate=t},r.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},r.setProjectionMode=function(t){return this.projectionMode=t,this},r.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},r.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},r.getViewTransform=function(){return zn(Gn(),this.matrix)},r.getWorldTransform=function(){return this.matrix},r.jitterProjectionMatrix=function(t,e){var n,r,i=(n=Gn(),r=[t,e,0],n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1,n);this.jitteredProjectionMatrix=Wn(Gn(),i,this.projectionMatrix)},r.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},r.setMatrix=function(t){return this.matrix=t,this._update(),this},r.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},r.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},r.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},r.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},r.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},r.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},r.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},r.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(.5*mc*this.fov)/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return Yr(this.projectionMatrix,c,c+u,a,a-s,e,this.far),Yn(this.projectionMatrix,this.projectionMatrix,rr(1,-1,1)),zn(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},r.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,p=l-u,f=l+u,d=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(p+=v*this.view.offsetX)+v*this.view.width,y=(d-=g*this.view.offsetY)-g*this.view.height}return $n(this.projectionMatrix,p,f,y,d,o,a),Yn(this.projectionMatrix,this.projectionMatrix,rr(1,-1,1)),zn(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},r.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=jr(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},r.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i,o,a,s,u,c,l,h,p,f,d,y,v,g=rr(0,1,0);if(this.focalPoint=jr(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var m=sr(tr(),this.focalPoint,this.position);e=m[0],n=m[1],r=m[2];var T=nr(m),b=Math.asin(n/T)*Tc,E=90+Math.atan2(r,e)*Tc,S=Gn();i=S,o=S,a=E*mc,s=Math.sin(a),u=Math.cos(a),c=o[0],l=o[1],h=o[2],p=o[3],f=o[8],d=o[9],y=o[10],v=o[11],o!==i&&(i[4]=o[4],i[5]=o[5],i[6]=o[6],i[7]=o[7],i[12]=o[12],i[13]=o[13],i[14]=o[14],i[15]=o[15]),i[0]=c*u-f*s,i[1]=l*u-d*s,i[2]=h*u-y*s,i[3]=p*u-v*s,i[8]=c*s+f*u,i[9]=l*s+d*u,i[10]=h*s+y*u,i[11]=p*s+v*u,function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r}(S,S,b*mc),g=yr(tr(),[0,1,0],S)}return zn(this.matrix,function(t,e,n,r){var i,o,a,s,u,c,l,h,p,f,d=e[0],y=e[1],v=e[2],g=r[0],m=r[1],T=r[2],b=n[0],E=n[1],S=n[2];return Math.abs(d-b)<Fn&&Math.abs(y-E)<Fn&&Math.abs(v-S)<Fn?Hn(t):(l=d-b,h=y-E,p=v-S,i=m*(p*=f=1/Math.hypot(l,h,p))-T*(h*=f),o=T*(l*=f)-g*p,a=g*h-m*l,(f=Math.hypot(i,o,a))?(i*=f=1/f,o*=f,a*=f):(i=0,o=0,a=0),s=h*a-p*o,u=p*i-l*a,c=l*o-h*i,(f=Math.hypot(s,u,c))?(s*=f=1/f,u*=f,c*=f):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=p,t[11]=0,t[12]=-(i*d+o*y+a*v),t[13]=-(s*d+u*y+c*v),t[14]=-(l*d+h*y+p*v),t[15]=1,t)}(Gn(),this.position,this.focalPoint,g)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},r.getDistance=function(){return this.distance},r.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,bc>this.distance&&(this.distance=bc),this.dollyingStep=this.distance/100;var e=tr(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},r.setMaxDistance=function(t){return this.maxDistance=t,this},r.setMinDistance=function(t){return this.minDistance=t,this},r.setAzimuth=function(e){return this.azimuth=Gr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getAzimuth=function(){return this.azimuth},r.setElevation=function(e){return this.elevation=Gr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getElevation=function(){return this.elevation},r.setRoll=function(e){return this.roll=Gr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getRoll=function(){return this.roll},r.rotate=function(e,n,r){if(this.relElevation=Gr(n),this.relAzimuth=Gr(e),this.relRoll=Gr(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=kr(Pr(),[1,0,0],(this.rotateWorld?1:-1)*this.relElevation*mc),o=kr(Pr(),[0,1,0],(this.rotateWorld?1:-1)*this.relAzimuth*mc),a=kr(Pr(),[0,0,1],this.relRoll*mc),s=xr(Pr(),o,i);s=xr(Pr(),s,a);var u=Qn(Gn(),s);qn(this.matrix,this.matrix,[0,0,-this.distance]),Wn(this.matrix,this.matrix,u),qn(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},r.pan=function(t,e){var n=jr(t,e,0),r=er(this.position);return ar(r,r,cr(tr(),this.right,n[0])),ar(r,r,cr(tr(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},r.dolly=function(e){var n,r=this.forward,i=er(this.position);return n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance,i[0]+=n*r[0],i[1]+=n*r[1],i[2]+=n*r[2],this._setPosition(i),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&ar(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},r.createLandmark=function(t,e){void 0===e&&(e={});var r=e.position,i=void 0===r?this.position:r,o=e.focalPoint,a=void 0===o?this.focalPoint:o,s=e.roll,u=e.zoom,c=new n;c.setType(this.type,void 0),c.setPosition(i[0],i[1]||this.position[1],i[2]||this.position[2]),c.setFocalPoint(a[0],a[1]||this.focalPoint[1],a[2]||this.focalPoint[2]),c.setRoll(s||this.roll),c.setZoom(u||this.zoom);var l,h,p={name:t,matrix:(l=c.matrix,h=new Bn(16),h[0]=l[0],h[1]=l[1],h[2]=l[2],h[3]=l[3],h[4]=l[4],h[5]=l[5],h[6]=l[6],h[7]=l[7],h[8]=l[8],h[9]=l[9],h[10]=l[10],h[11]=l[11],h[12]=l[12],h[13]=l[13],h[14]=l[14],h[15]=l[15],h),right:er(c.right),up:er(c.up),forward:er(c.forward),position:er(c.position),focalPoint:er(c.focalPoint),distanceVector:er(c.distanceVector),distance:c.distance,dollyingStep:c.dollyingStep,azimuth:c.azimuth,elevation:c.elevation,roll:c.roll,relAzimuth:c.relAzimuth,relElevation:c.relElevation,relRoll:c.relRoll,zoom:c.zoom};return this.landmarks.push(p),p},r.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=Oi(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=Ee(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,p=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(p&&p());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var f,d=r.position,y=r.focalPoint,v=r.zoom,g=r.roll,m=l||Ni(a),T=function(){n.setFocalPoint(y),n.setPosition(d),n.setRoll(g),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),p&&p()};this.canvas.requestAnimationFrame((function t(e){void 0===f&&(f=e);var r=e-f;if(u<r)T();else{var i,o,a=m(r/u),s=tr(),c=tr();dr(s,n.focalPoint,y,a),dr(c,n.position,d,a),o=n.roll*(1-a)+g*a,i=n.zoom*(1-a)+v*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(i),br(s,y)+br(c,d)>.01?(n.computeMatrix(),n.triggerUpdate(),u>r&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):T()}}))}},r._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},r.computeMatrix=function(){var e=kr(Pr(),[0,0,1],this.roll*mc);Hn(this.matrix);var n=kr(Pr(),[1,0,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation*mc),r=kr(Pr(),[0,1,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth*mc),i=xr(Pr(),r,n);i=xr(Pr(),i,e);var o=Qn(Gn(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(qn(this.matrix,this.matrix,this.focalPoint),Wn(this.matrix,this.matrix,o),qn(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(qn(this.matrix,this.matrix,this.position),Wn(this.matrix,this.matrix,o))},r._setPosition=function(t,e,n){this.position=jr(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},r._getAxes=function(){ir(this.right,jr(wr(Sr(),[1,0,0,0],this.matrix))),ir(this.up,jr(wr(Sr(),[0,1,0,0],this.matrix))),ir(this.forward,jr(wr(Sr(),[0,0,1,0],this.matrix))),hr(this.right,this.right),hr(this.up,this.up),hr(this.forward,this.forward)},r._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=nr(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Math.asin(n/i)*Tc,this.azimuth=Math.atan2(-e,-r)*Tc):(this.elevation=-Math.asin(n/i)*Tc,this.azimuth=-Math.atan2(-e,-r)*Tc)},r._getPosition=function(){ir(this.position,jr(wr(Sr(),[0,0,0,1],this.matrix))),this._getDistance()},r._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=Vn(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),ar(this.focalPoint,this.position,this.distanceVector),this._getDistance()},r._getDistance=function(){this.distanceVector=sr(tr(),this.focalPoint,this.position),this.distance=nr(this.distanceVector),this.dollyingStep=this.distance/100},r._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=kr(Pr(),[0,0,1],-this.roll*Math.PI/180);Jn(this.orthoMatrix,n,rr((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),rr(this.zoom,this.zoom,1),e)}},r.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=Wn(Gn(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.emit(gc.UPDATED)}},r.syncFromLandmark=function(t){this.matrix=jn(this.matrix,t.matrix),this.right=ir(this.right,t.right),this.up=ir(this.up,t.up),this.forward=ir(this.forward,t.forward),this.position=ir(this.position,t.position),this.focalPoint=ir(this.focalPoint,t.focalPoint),this.distanceVector=ir(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},n}(ne.EventEmitter),Sc=function(){function t(t){this.plugins=[],this.config=void 0,this.config=qt({enableDirtyCheck:!0,enableCulling:!0,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}();let wc=1;const Pc="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},kc=Date.now();let xc={},Cc=Date.now();const Nc=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-Cc,r=n>16?0:16-n,i=wc++;return xc[i]=t,Object.keys(xc).length>1||setTimeout((()=>{Cc=e;const t=xc;xc={},Object.keys(t).forEach((e=>t[e](Pc.performance&&"function"==typeof Pc.performance.now?Pc.performance.now():Date.now()-kc)))}),r),i},_c=t=>{delete xc[t]},Ac=t=>"string"!=typeof t?Nc:""===t?Pc.requestAnimationFrame:Pc[t+"RequestAnimationFrame"],Mc=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!Ac(t))),Oc=Ac(Mc),Ic="string"!=typeof(Rc=Mc)?_c:""===Rc?Pc.cancelAnimationFrame:Pc[Rc+"CancelAnimationFrame"]||Pc[Rc+"CancelRequestAnimationFrame"];var Rc,Lc,Dc;Pc.requestAnimationFrame=Oc,Pc.cancelAnimationFrame=Ic,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:Oc,cancelAnimationFrame:Ic});var Uc,Fc,Bc=i.defineToken("CullingStrategyContribution"),Vc=(Lc=function(){function t(){this.strategyProvider=void 0}return t.prototype.apply=function(t){var e=this.strategyProvider.getContributions();t.hooks.cull.tap(Dc.tag,(function(t){if(t){var n=t.cullable;return n.visible=0===e.length||e.every((function(e){return e.isVisible(t)})),!n.isCulled()&&t.isVisible()?t:null}return t})),t.hooks.afterRender.tap(Dc.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t}(),Lc.tag="Culling",Dc=Lc);Ja([Bt(Bc),$a("design:type",Object)],Vc.prototype,"strategyProvider",void 0),Vc=Dc=Ja([lt({contrib:rc})],Vc);var Gc,jc,Hc=(Uc=function(){function e(){this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this;e.hooks.dirtycheck.tap(Fc.tag,(function(e){if(e){var r=e.renderable,i=n.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED);return r.dirty||i?e:null}return e}))},e}(),Uc.tag="DirtyCheck",Fc=Uc);Ja([ht(nc),$a("design:type",Object)],Hc.prototype,"renderingContext",void 0),Hc=Fc=Ja([lt({contrib:rc})],Hc);var zc=(Gc=function(){function t(){var t=this;this.canvasConfig=void 0,this.contextService=void 0,this.renderingService=void 0,this.renderingContext=void 0,this.eventService=void 0,this.autoPreventDefault=!0,this.rootPointerEvent=new Cu(null),this.rootWheelEvent=new Nu(null),this.onPointerMove=function(e){var n,r,i=null===(n=t.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=te(t.normalizeToPointerEvent(e,i));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,i);t.eventService.mapEvent(s)}t.setCursor(t.eventService.cursor)}}}var e=t.prototype;return e.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView;this.eventService.setPickHandler(function(){var t=Ht(Gt().mark((function t(n){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.renderingService.hooks.pick.promise({position:n,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.hooks.pointerWheel.tap(jc.tag,(function(t){var n=e.normalizeWheelEvent(t);e.eventService.mapEvent(n)})),t.hooks.pointerDown.tap(jc.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var r=e.normalizeToPointerEvent(t,n);if(e.autoPreventDefault&&r[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i,o=te(r);!(i=o()).done;){var a=e.bootstrapEvent(e.rootPointerEvent,i.value,n);e.eventService.mapEvent(a)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerUp.tap(jc.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var r,i=e.contextService.getDomElement(),o=i&&t.target&&t.target!==i&&i.contains&&!i.contains(t.target)?"outside":"",a=te(e.normalizeToPointerEvent(t,n));!(r=a()).done;){var s=e.bootstrapEvent(e.rootPointerEvent,r.value,n);s.type+=o,e.eventService.mapEvent(s)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerMove.tap(jc.tag,this.onPointerMove),t.hooks.pointerOver.tap(jc.tag,this.onPointerMove),t.hooks.pointerOut.tap(jc.tag,this.onPointerMove)},e.bootstrapEvent=function(t,e,n){t.pointerType=e.pointerType;var r=t;r.view=n,r.originalEvent=null,r.nativeEvent=e,r.pointerId=e.pointerId,r.width=e.width,r.height=e.height,r.isPrimary=e.isPrimary,r.pressure=e.pressure,r.tangentialPressure=e.tangentialPressure,r.tiltX=e.tiltX,r.tiltY=e.tiltY,r.twist=e.twist,this.transferMouseData(r,e);var i=this.eventService.client2Viewport(new ea(e.clientX,e.clientY)),o=i.y;r.viewport.x=i.x,r.viewport.y=o;var a=this.eventService.viewport2Canvas(r.viewport),s=a.y;return r.canvas.x=a.x,r.canvas.y=s,r.global.copyFrom(r.canvas),r.offset.copyFrom(r.canvas),r.isTrusted=e.isTrusted,"pointerleave"===r.type&&(r.type="pointerout"),r.type.startsWith("mouse")&&(r.type=r.type.replace("mouse","pointer")),r.type.startsWith("touch")&&(r.type=Ei[r.type]||r.type),r},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.eventService.client2Viewport(new ea(t.clientX,t.clientY)),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.contextService.applyCursorStyle(t||this.canvasConfig.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];Te(i.button)&&(i.button=t.touches.length?1:0),Te(i.buttons)&&(i.buttons=t.touches.length?1:0),Te(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Te(i.width)&&(i.width=i.radiusX||1),Te(i.height)&&(i.height=i.radiusY||1),Te(i.tiltX)&&(i.tiltX=0),Te(i.tiltY)&&(i.tiltY=0),Te(i.pointerType)&&(i.pointerType="touch"),Te(i.pointerId)&&(i.pointerId=i.identifier||0),Te(i.pressure)&&(i.pressure=i.force||.5),Te(i.twist)&&(i.twist=0),Te(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Te(o.isPrimary)&&(o.isPrimary=!0),Te(o.width)&&(o.width=1),Te(o.height)&&(o.height=1),Te(o.tiltX)&&(o.tiltX=0),Te(o.tiltY)&&(o.tiltY=0),Te(o.pointerType)&&(o.pointerType="mouse"),Te(o.pointerId)&&(o.pointerId=1),Te(o.pressure)&&(o.pressure=.5),Te(o.twist)&&(o.twist=0),Te(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}(),Gc.tag="Event",jc=Gc);Ja([ht(Qi),$a("design:type",Object)],zc.prototype,"canvasConfig",void 0),Ja([ht(ec),$a("design:type",Object)],zc.prototype,"contextService",void 0),Ja([ht(t.RenderingService),$a("design:type",t.RenderingService)],zc.prototype,"renderingService",void 0),Ja([ht(nc),$a("design:type",Object)],zc.prototype,"renderingContext",void 0),Ja([ht(t.EventService),$a("design:type",t.EventService)],zc.prototype,"eventService",void 0),zc=jc=Ja([lt({contrib:rc})],zc);var Wc,qc,Yc=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],Xc=function(){function e(){this.camera=void 0}var n=e.prototype;return n.isVisible=function(e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(zo.isEmpty(o))return!1;var a=this.camera.getFrustum(),s=null===(n=e.parentNode)||void 0===n||null===(r=n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||t.Mask.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==t.Mask.OUTSIDE,i.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=Yc.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,p=l.distance;if(0>pr(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>pr(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}();Ja([ht(vc),$a("design:type",Ec)],Xc.prototype,"camera",void 0),Xc=Ja([lt({contrib:Bc})],Xc);var Kc=(Wc=function(){function e(){this.renderingContext=void 0,this.styleValueRegistry=void 0}return e.prototype.apply=function(e){var n=this,r=function(t){t.target.renderable.dirty=!0,e.dirtify()},i=function(){e.dirtify()},o=function(t){var r=t.target;n.styleValueRegistry.recalc(r),Qu(r),e.dirtify()},a=function(t){Qu(t.target),e.dirtify()};e.hooks.init.tapPromise(qc.tag,Ht(Gt().mark((function e(){return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,r),n.renderingContext.root.addEventListener(t.ElementEvent.BOUNDS_CHANGED,i);case 4:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(qc.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,i)}))},e}(),Wc.tag="Prepare",qc=Wc);Ja([ht(nc),$a("design:type",Object)],Kc.prototype,"renderingContext",void 0),Ja([ht(ue),$a("design:type",Object)],Kc.prototype,"styleValueRegistry",void 0),Kc=qc=Ja([lt({contrib:rc})],Kc);var Zc,Jc=Ot((function(e){Rt.register(e,rc,{cache:!1}),Rt.register(e,Bc,{cache:!1}),e(t.RenderingService),e(t.EventService),e(zc),e(Kc),e(Hc),e(Vc),e(Xc)}));(Zc=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Zc.BEFORE_RENDER="beforerender",Zc.AFTER_RENDER="afterrender",Zc.BEFORE_DESTROY="beforedestroy",Zc.AFTER_DESTROY="afterdestroy",Zc.RESIZE="resize";var Qc=function(e){function n(t){var n;(n=e.call(this)||this).container=Ut.createChild(),n.document=void 0,n.customElements=void 0,n.requestAnimationFrame=void 0,n.cancelAnimationFrame=void 0,n.devicePixelRatio=void 0,n.supportsPointerEvents=void 0,n.supportsTouchEvents=void 0,n.isTouchEvent=void 0,n.isMouseEvent=void 0,n.Element=tu,n.frameId=void 0,n.eventService=void 0,n.renderingService=void 0,n.inited=!1,n.readyPromise=void 0,n.resolveReadyPromise=void 0,n.document=new ku,n.document.defaultView=Qt(n),n.customElements=new Yu;var r=t.container,i=t.canvas,o=t.offscreenCanvas,a=t.width,s=t.height,u=t.devicePixelRatio,c=t.renderer,l=t.background,h=t.document,p=t.requestAnimationFrame,f=t.cancelAnimationFrame,d=t.createImage,y=t.supportsPointerEvents,v=t.supportsTouchEvents,g=t.isTouchEvent,m=t.isMouseEvent;Nn(r,Qt(n));var T=a,b=s,E=u;return i&&(E=1>(E=u||_n&&window.devicePixelRatio||1)?1:Math.ceil(E),T=a||Ti(i)||i.width/E,b=s||bi(i)||i.height/E),n.devicePixelRatio=E,n.requestAnimationFrame=null!=p?p:Oc.bind(globalThis),n.cancelAnimationFrame=null!=f?f:Ic.bind(globalThis),n.supportsTouchEvents=null!=v?v:"ontouchstart"in globalThis,n.supportsPointerEvents=null!=y?y:!!globalThis.PointerEvent,n.isTouchEvent=null!=g?g:function(t){return n.supportsTouchEvents&&t instanceof globalThis.TouchEvent},n.isMouseEvent=null!=m?m:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:T,height:b,renderer:c,offscreenCanvas:o,devicePixelRatio:E,cursor:"default",background:l,createImage:d,document:h}),n.initDefaultCamera(T,b),n.initRenderer(c),n}Yt(n,e);var r=n.prototype;return r.initRenderingContext=function(e){var n=this;this.container.register({token:Qi,useValue:e}),this.container.register({token:nc,useValue:{root:this.document.documentElement,renderReasons:new Set,force:!1,dirty:!1}}),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_INSERTED,(function(t){n.mountChildren(t.detail.child)})),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_REMOVED,(function(t){n.unmountChildren(t.detail.child)}))},r.initDefaultCamera=function(e,n){var r=(new Ec).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3);r.canvas=this;var i=this.container.get(nc);r.on(gc.UPDATED,(function(){i.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.container.register({token:vc,useValue:r})},r.getConfig=function(){return this.container.get(Qi)},r.getContainer=function(){return this.container},r.getRoot=function(){return this.document.documentElement},r.getCamera=function(){return this.container.get(vc)},r.getContextService=function(){return this.container.get(ec)},r.getEventService=function(){return this.eventService},r.getRenderingService=function(){return this.renderingService},r.getRenderingContext=function(){return this.container.get(nc)},r.getStats=function(){return this.getRenderingService().getStats()},r.destroy=function(e){(void 0===e&&(e=!0),this.emit(t.CanvasEvent.BEFORE_DESTROY,(function(){})),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),this.emit(t.CanvasEvent.AFTER_DESTROY,{})},r.changeSize=function(t,e){this.resize(t,e)},r.resize=function(e,n){var r=this.container.get(Qi);r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.container.get(vc),o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.emit(t.CanvasEvent.RESIZE,{width:e,height:n})},r.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},r.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},r.removeChild=function(t,e){return void 0===e&&(e=!0),this.document.documentElement.removeChild(t,e)},r.removeChildren=function(t){void 0===t&&(t=!0),this.document.documentElement.removeChildren(t)},r.render=function(){(this.emit(t.CanvasEvent.BEFORE_RENDER,{}),this.container.isBound(t.RenderingService))&&this.container.get(t.RenderingService).render(this.getConfig());this.emit(t.CanvasEvent.AFTER_RENDER,{})},r.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},r.initRenderer=function(){var e=Ht(Gt().mark((function e(n){var r;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.loadCommonContainerModule(),this.loadRendererContainerModule(n),r=this.container.get(ec),this.renderingService=this.container.get(t.RenderingService),this.eventService=this.container.get(t.EventService),r.init(),e.next=12,this.renderingService.init();case 12:this.emit(t.CanvasEvent.READY,{}),this.readyPromise&&this.resolveReadyPromise(),this.inited=!0,n.getConfig().enableAutoRendering&&this.run(),this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot());case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.loadCommonContainerModule=function(){this.container.unload(Jc),this.container.load(Jc,!0)},r.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.init(e.container)}))},r.setRenderer=function(t){var e=this,n=this.getConfig();if(n.renderer!==t){var r=n.renderer;n.renderer=t,this.destroy(!1),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy(e.container)})),this.initRenderer(t)}},r.setCursor=function(t){this.getContextService().applyCursorStyle(t)},r.unmountChildren=function(e){var n=this,r=[];e.forEach((function(t){t.isConnected&&r.push(t)})),r.reverse().forEach((function(e){e instanceof nu&&e.disconnectedCallback&&e.disconnectedCallback(),e.emit(t.ElementEvent.UNMOUNTED,{}),e!==n.document.documentElement&&(e.ownerDocument=null),e.isConnected=!1}))},r.mountChildren=function(e){var n=this;e.forEach((function(e){e.isConnected||(e.ownerDocument=n.document,e.isConnected=!0,e.dispatchEvent(new Rs(t.ElementEvent.MOUNTED)),e instanceof nu&&e.connectedCallback&&e.connectedCallback())}))},r.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},r.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},r.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},r.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},r.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},r.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},Wt(n,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),n}(Ls);Ut.load(yc);var $c=Ut.get(t.LayoutEngine);t.AABB=zo,t.AbstractLayoutDefinition=ls,t.AbstractRenderer=Sc,t.Animation=Xs,t.AnimationEffectTiming=_u,t.AnimationEvent=qs,t.AnimationTimeline=Zs,t.AsyncParallelHook=mo,t.AsyncSeriesWaterfallHook=So,t.BUILT_IN_PROPERTIES=hc,t.BoundingSphere=qo,t.CSS=Ts,t.CSSColorValue=de,t.CSSGradientValue=Xe,t.CSSKeywordValue=ye,t.CSSMathInvert=De,t.CSSMathMax=je,t.CSSMathMin=Ge,t.CSSMathNegate=Ue,t.CSSMathProduct=ze,t.CSSMathSum=He,t.CSSMathValue=Le,t.CSSMathVariadic=Ve,t.CSSNumericValue=Ne,t.CSSNumericValueType=Ce,t.CSSProperty=Os,t.CSSPropertySyntaxFactory=Ms,t.CSSRGB=Ye,t.CSSStyleValue=fe,t.CSSUnitValue=Re,t.Camera=Ec,t.CameraEvent=gc,t.Canvas=Qc,t.CanvasConfig=Qi,t.Circle=iu,t.ContextNode=ss,t.ContextService=ec,t.Cullable=Gs,t.CustomElement=nu,t.CustomElementRegistry=Yu,t.CustomEvent=Rs,t.DCHECK=ve,t.DCHECK_EQ=ge,t.DCHECK_NE=me,t.DELEGATION_SPLITTER=":",t.DefaultCamera=vc,t.Deferred=vi,t.DisplayObject=tu,t.Document=ku,t.EasingFunctions=fi,t.Element=Ws,t.Ellipse=au,t.EventTarget=Ls,t.FederatedEvent=Is,t.FederatedMouseEvent=xu,t.FederatedPointerEvent=Cu,t.FederatedWheelEvent=Nu,t.FragmentResultFactory=os,t.FragmentResultOptions=as,t.Frustum=Xo,t.Geometry=Us,t.GeometryAABBUpdater=cc,t.GeometryUpdaterFactory=uc,t.Group=uu,t.HTML=Pu,t.Image=lu,t.KeyframeEffect=qu,t.LayoutChildrenFactory=us,t.LayoutChildrenOptions=cs,t.LayoutContextFactory=ns,t.LayoutContextOptions=rs,t.LayoutEdgesFactory=fs,t.LayoutEdgesOptions=ds,t.LayoutFragmentFactory=gs,t.LayoutFragmentOptions=ms,t.LayoutObject=es,t.Line=pu,t.MOUSE_POINTER_ID=1,t.ManaSyringe=Vt,t.MutationEvent=Hs,t.MutationObserver=Ru,t.MutationRecord=Au,t.Node=Ds,t.ObjectTyped=gi,t.Odeg=qe,t.Opx=We,t.Path=du,t.Plane=Yo,t.Point=ea,t.Polygon=vu,t.Polyline=mu,t.Ray=ta,t.Rect=bu,t.Rectangle=na,t.Registration=Iu,t.Renderable=Fs,t.RenderingContext=nc,t.RenderingPluginContribution=rc,t.SceneGraphSelector=Ku,t.SceneGraphSelectorFactory=Xu,t.SceneGraphService=$u,t.Sortable=js,t.StyleValueRegistry=ue,t.SyncHook=No,t.SyncWaterfallHook=Ro,t.TOUCH_TO_POINTER=Ei,t.Text=Su,t.Transform=Vs,t.baseTypeToString=xe,t.camelCase=Mi,t.clamp=Vr,t.clampedMergeNumbers=ya,t.cleanExistedCanvas=Nn,t.clonePath=ao,t.compareAnimations=Ks,t.convertAngleUnit=ua,t.convertEffectInput=Ii,t.convertPercentUnit=ha,t.convertToDash=Kr,t.convertToPath=function(e,n){void 0===n&&(n=!0);var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1.value,i.y1.value,i.x2.value,i.y2.value);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=uo(a.value,a.value,o.cx.value,o.cy.value);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=uo(s.rx.value,s.ry.value,s.cx.value,s.cy.value);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,p=u.y,f=u.radius,d=f&&f.some((function(t){return 0!==t.value}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3];return[["M",n,o+r],o?["A",o,o,0,0,1,o+n,r]:null,["L",t-a+n,r],a?["A",a,a,0,0,1,t+n,a+r]:null,["L",t+n,e-s+r],s?["A",s,s,0,0,1,t-s+n,e+r]:null,["L",u+n,e+r],u?["A",u,u,0,0,1,n,e-u+r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(c.value,l.value,h.value,p.value,d&&f.map((function(t){return t.value})));break;case t.Shape.PATH:var y=e.parsedStyle.path,v=y.zCommandIndexes;r=[].concat(y.curve),v.forEach((function(t,e){r.splice(t+e,1,["Z"])}))}if(r.length)return function(t,e,n){var r;void 0===n&&(n=!0),n&&(r=e.getLocalTransform());var i=e.parsedStyle,o=i.defX,a=void 0===o?0:o,s=i.defY,u=void 0===s?0:s;return t.reduce((function(t,e){var i="";if("M"===e[0]||"L"===e[0]){var o=rr(e[1]-a,e[2]-u,0);n&&yr(o,o,r),i=""+e[0]+o[0]+","+o[1]}else if("Z"===e[0])i=e[0];else if("C"===e[0]){var s=rr(e[1]-a,e[2]-u,0),c=rr(e[3]-a,e[4]-u,0),l=rr(e[5]-a,e[6]-u,0);n&&(yr(s,s,r),yr(c,c,r),yr(l,l,r)),i=""+e[0]+s[0]+","+s[1]+","+c[0]+","+c[1]+","+l[0]+","+l[1]}else if("A"===e[0]){var h=rr(e[6]-a,e[7]-u,0);n&&yr(h,h,r),i=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+h[0]+","+h[1]}return t+i}),"")}(r,e,n)},t.createVec3=jr,t.decompose=Xr,t.deg2rad=function(t){return t*(Math.PI/180)},t.deg2turn=function(t){return t/360},t.dirtifyToRoot=Qu,t.equalSet=function(t,e){if(t.size!==e.size)return!1;for(var n,r=te(t);!(n=r()).done;){if(!e.has(n.value))return!1}return!0},t.equalizeSegments=eo,t.formatAttribute=Bi,t.fromRotationTranslationScale=qr,t.getAngle=Gr,t.getDrawDirection=no,t.getEasingFunction=di,t.getEuler=Wr,t.getHeight=bi,t.getPathArea=io,t.getRotatedCurve=so,t.getRotationInRadians=function(t){return Math.atan2(t[1],t[4])},t.getScaling=function(t,e){var n=e[3],r=e[4];return t[0]=Math.hypot(e[0],e[1]),t[1]=Math.hypot(n,r),t},t.getStyle=mi,t.getTranslation=function(t,e){return t[0]=e[6],t[1]=e[7],t},t.getWidth=Ti,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBoolean=we,t.isBrowser=_n,t.isComparison=function(e){return e===t.CSSMathOperator.kMin||e===t.CSSMathOperator.kMax||e===t.CSSMathOperator.kClamp},t.isFunction=Se,t.isNil=be,t.isNumber=Ee,t.isObject=Pe,t.isString=Oi,t.isUndefined=Te,t.layoutEngine=$c,t.makePerspective=Yr,t.makeQuerablePromise=yi,t.makeTiming=Hu,t.mergeColors=jo,t.mergeDimensionList=la,t.mergeDimensions=sa,t.mergeNumberLists=function(t,e){if(t.length==e.length)return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t}]},t.mergeNumbers=da,t.mergePaths=ja,t.mergeTransforms=Cs,t.normalizeKeyframes=Vu,t.normalizeTimingInput=zu,t.numberToString=pa,t.numericTimingToObject=Wu,t.parseAngle=aa,t.parseColor=Go,t.parseDimension=ra,t.parseDimensionArray=ca,t.parseFilter=Za,t.parseLength=ia,t.parseLengthOrPercentage=oa,t.parseNumber=fa,t.parseNumberList=function(t){return Oi(t)?t.split(" ").map(fa):t.map(fa)},t.parseParam=Xa,t.parsePath=Ga,t.parsePoints=Ha,t.parseTransform=Ps,t.parseTransformOrigin=Ns,t.parserPercentage=function(t){return ra(new RegExp("%","g"),t)},t.rad2deg=Hr,t.reverseCurve=oo,t.setDOMSize=function(t,e,n){_n&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.sortByZIndex=Ju,t.toFontString=Do,t.turn2deg=zr,t.typeCheck=Fe,t.unitTypeToBaseType=ke,Object.defineProperty(t,"__esModule",{value:!0})}));
|