@antv/g-lite 1.0.8 → 1.0.9
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/camera/Camera.d.ts +4 -0
- package/dist/camera/Camera.d.ts.map +1 -1
- package/dist/camera/interfaces.d.ts +1 -0
- package/dist/camera/interfaces.d.ts.map +1 -1
- package/dist/index.esm.js +27 -0
- package/dist/index.js +27 -0
- package/dist/index.umd.js +27 -0
- package/dist/index.umd.min.js +2 -2
- package/package.json +3 -3
package/dist/index.umd.min.js
CHANGED
|
@@ -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 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,f=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,p=new(l||"function"!=typeof WeakMap?nt():WeakMap);function d(t,e,n,r){if(L(n)){if(!H(t))throw new TypeError;if(!q(e))throw new TypeError;return S(t,e)}if(!H(t))throw new TypeError;if(!U(e))throw new TypeError;if(!U(r)&&!L(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),N(t,e,n=Y(n),r)}function v(t,e){function n(n,r){if(!U(n))throw new TypeError;if(!L(r)&&!X(r))throw new TypeError;A(t,e,n,r)}return n}function y(t,e,n,r){if(!U(n))throw new TypeError;return L(r)||(r=Y(r)),A(t,e,n,r)}function g(t,e,n){if(!U(e))throw new TypeError;return L(n)||(n=Y(n)),k(t,e,n)}function m(t,e,n){if(!U(e))throw new TypeError;return L(n)||(n=Y(n)),P(t,e,n)}function T(t,e,n){if(!U(e))throw new TypeError;return L(n)||(n=Y(n)),_(t,e,n)}function E(t,e,n){if(!U(e))throw new TypeError;return L(n)||(n=Y(n)),C(t,e,n)}function b(t,e){if(!U(t))throw new TypeError;return L(e)||(e=Y(e)),O(t,e)}function x(t,e){if(!U(t))throw new TypeError;return L(e)||(e=Y(e)),I(t,e)}function w(t,e,n){if(!U(e))throw new TypeError;L(n)||(n=Y(n));var r=M(e,n,!1);if(L(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=p.get(e);return i.delete(n),i.size>0||p.delete(e),!0}function S(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 N(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(!U(o))throw new TypeError;r=o}}return r}function M(t,e,n){var r=p.get(t);if(L(r)){if(!n)return;r=new h,p.set(t,r)}var i=r.get(e);if(L(i)){if(!n)return;i=new h,r.set(e,i)}return i}function k(t,e,n){if(P(t,e,n))return!0;var r=$(e);return!D(r)&&k(t,r,n)}function P(t,e,n){var r=M(e,n,!1);return!L(r)&&F(r.has(t))}function _(t,e,n){if(P(t,e,n))return C(t,e,n);var r=$(e);return D(r)?void 0:_(t,r,n)}function C(t,e,n){var r=M(e,n,!1);if(!L(r))return r.get(t)}function A(t,e,n,r){M(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 f,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=M(t,e,!1);if(L(r))return n;for(var i=K(r.keys()),o=0;;){var a=Z(i);if(!a)return n.length=o,n;var s=J(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 B(t){return"symbol"==typeof t}function U(t){return"object"==typeof t?null!==t:"function"==typeof t}function G(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=z(t,r);if(void 0!==i){var o=i.call(t,n);if(U(o))throw new TypeError;return o}return j(t,"default"===n?"number":n)}function j(t,e){if("string"===e){var n=t.toString;if(W(n))if(!U(i=n.call(t)))return i;if(W(r=t.valueOf))if(!U(i=r.call(t)))return i}else{var r;if(W(r=t.valueOf))if(!U(i=r.call(t)))return i;var i,o=t.toString;if(W(o))if(!U(i=o.call(t)))return i}throw new TypeError}function F(t){return!!t}function V(t){return""+t}function Y(t){var e=G(t,3);return B(e)?e:V(e)}function H(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 X(t){switch(R(t)){case 3:case 4:return!0;default:return!1}}function z(t,e){var n=t[e];if(null!=n){if(!W(n))throw new TypeError;return n}}function K(t){var e=z(t,i);if(!W(e))throw new TypeError;var n=e.call(t);if(!U(n))throw new TypeError;return n}function J(t){return t.value}function Z(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",v),t("defineMetadata",y),t("hasMetadata",g),t("hasOwnMetadata",m),t("getMetadata",T),t("getOwnMetadata",E),t("getMetadataKeys",b),t("getOwnMetadataKeys",x),t("deleteMetadata",w)}(i)}()}(e||(e={}));var i,o=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]})),a=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"}})),s=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}})),u=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var n=function(){function t(t,e){this.id=s.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=a.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===a.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})),c=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"})),l=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(o.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(o.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(o.TAGGED_PROP,t)||[]},t}();e.MetadataReader=n})),h=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===c.STACK_OVERFLOW}})),p=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(c.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})),d=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var n=function(){function t(t){this.id=s.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===o.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=n})),y=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}})),g=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(c.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var u=o[s];if(Array.isArray(u))for(var l=0,h=u;h.length>l;l++){var f=h[l];if(f.key===r.key)throw new Error(c.DUPLICATED_METADATA+" "+f.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(o.TAGGED,t,e,i,r)},e.tagProperty=function(t,e,r){n(o.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)}})),m=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(c.UNDEFINED_INJECT_ANNOTATION(e.name));var i=new v.Metadata(o.INJECT_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),T=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=s.id(),this.type=t,this.serviceIdentifier=n,this.name=new T.QueryableString(e||""),this.metadata=new Array;var i=null;"string"==typeof r?i=new v.Metadata(o.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(o.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(o.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(o.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return o.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(o.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===o.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return o.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(o.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})),b=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 o=t.getConstructorMetadata(n),a=o.compilerGeneratedMetadata;if(void 0===a)throw new Error(c.MISSING_INJECTABLE_ANNOTATION+" "+e+".");var l=o.userGeneratedMetadata,h=Object.keys(l),f=function(t,e,n,r,i){for(var o=[],a=0;i>a;a++){var u=s(a,t,e,n,r);null!==u&&o.push(u)}return o}(i,e,a,l,0===n.length&&h.length>0||h.length>n.length?h.length:n.length),p=u(t,n);return r(r([],f),p)}function s(t,e,n,r,i){var o=i[t.toString()]||[],s=l(o),u=!0!==s.unmanaged,h=r[t],f=s.inject||s.multiInject;if((h=f||h)instanceof m.LazyServiceIdentifer&&(h=h.unwrap()),u){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(c.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".");var p=new E.Target(a.TargetTypeEnum.ConstructorArgument,s.targetName,h);return p.metadata=o,p}return null}function u(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,s=Object.keys(n);s.length>o;o++){var c=s[o],h=n[c],f=l(n[c]),p=new E.Target(a.TargetTypeEnum.ClassProperty,f.targetName||c,f.inject||f.multiInject);p.metadata=h,i.push(p)}var d=Object.getPrototypeOf(e.prototype).constructor;if(d!==Object){var v=u(t,d);i=r(r([],i),v)}return i}function l(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[o.INJECT_TAG],multiInject:e[o.MULTI_INJECT_TAG],targetName:e[o.NAME_TAG],unmanaged:e[o.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 p.getFunctionName}}),e.getDependencies=function(t,e){return i(t,p.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var a=i(e,p.getFunctionName(r),r,!0),s=a.map((function(t){return t.metadata.filter((function(t){return t.key===o.UNMANAGED_TAG}))})),u=[].concat.apply([],s).length,c=a.length-u;return c>0?c:t(e,r)}return 0}})),x=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=s.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})),w=r((function(t,e){function n(t){return t._bindingDictionary}function r(t,e,n,r,i,a){var s=new v.Metadata(t?o.MULTI_INJECT_TAG:o.INJECT_TAG,n),u=new E.Target(e,r,n,s);if(void 0!==i){var c=new v.Metadata(i,a);u.metadata.push(c)}return u}function i(t,e,n,r,i){var o=u(n.container,i.serviceIdentifier),a=[];return o.length===h.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 x.Request(t.serviceIdentifier,n,r,t,i);return t.constraint(e)})),function(t,e,n,r){switch(e.length){case h.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var i=p.getServiceIdentifierAsString(t),o=c.NOT_REGISTERED;throw o+=p.listMetadataForTarget(i,n),o+=p.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o);case h.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;default:if(n.isArray())return e;i=p.getServiceIdentifierAsString(t),o=c.AMBIGUOUS_MATCH+" "+i;throw o+=p.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o)}}(i.serviceIdentifier,a,i,n.container),a}function s(t,e,n,r,o,u){var l,h;if(null===o){l=i(t,e,r,null,u),h=new x.Request(n,r,null,l,u);var f=new y.Plan(r,h);r.addPlan(f)}else l=i(t,e,r,o,u),h=o.addChildRequest(u.serviceIdentifier,l,u);l.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===a.BindingTypeEnum.Instance&&null!==e.implementationType){var i=b.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks)if(b.getBaseClassDependencyCount(t,e.implementationType)>i.length){var o=c.ARGUMENTS_LENGTH_MISMATCH(b.getFunctionName(e.implementationType));throw new Error(o)}i.forEach((function(e){s(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,o,a,u,c){void 0===c&&(c=!1);var l=new d.Context(e),h=r(n,i,o,"",a,u);try{return s(t,c,o,l,null,h),l}catch(t){throw f.isStackOverflowExeption(t)&&l.plan&&p.circularDependencyToException(l.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new E.Target(a.TargetTypeEnum.Variable,"",e,new v.Metadata(n,r)),o=new d.Context(t);return new x.Request(e,o,null,[],i)}})),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};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0,e.resolveInstance=function(t,e,n){var i,s=null;if(e.length>0){var u=e.filter((function(t){return null!==t.target&&t.target.type===a.TargetTypeEnum.ConstructorArgument})).map(n);s=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===a.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value(),t[r]=i[n]})),t}(s=new((i=t).bind.apply(i,r([void 0],u))),e,n)}else s=new t;return function(t,e){if(Reflect.hasMetadata(o.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(o.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(c.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,s),s}})),N=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(c.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,s=e.target&&e.target.isArray(),u=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(s&&u)return o.map((function(e){return r(t)(e)}));var l=null;if(!e.target.isOptional()||0!==i.length){var h=i[0],f=h.scope===a.BindingScopeEnum.Singleton,d=h.scope===a.BindingScopeEnum.Request;if(f&&h.activated)return h.cache;if(d&&null!==t&&t.has(h.id))return t.get(h.id);if(h.type===a.BindingTypeEnum.ConstantValue)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Function)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Constructor)l=h.implementationType;else if(h.type===a.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)l=n("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(e.parentContext)}));else if(h.type===a.BindingTypeEnum.Factory&&null!==h.factory)l=n("toFactory",h.serviceIdentifier,(function(){return h.factory(e.parentContext)}));else if(h.type===a.BindingTypeEnum.Provider&&null!==h.provider)l=n("toProvider",h.serviceIdentifier,(function(){return h.provider(e.parentContext)}));else{if(h.type!==a.BindingTypeEnum.Instance||null===h.implementationType){var v=p.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(c.INVALID_BINDING_TYPE+" "+v)}l=S.resolveInstance(h.implementationType,o,r(t))}return"function"==typeof h.onActivation&&(l=h.onActivation(e.parentContext,l)),f&&(h.cache=l,h.activated=!0),d&&null!==t&&!t.has(h.id)&&t.set(h.id,l),l}}};e.resolve=function(t){return r(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}})),M=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(o.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)}}})),k=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 P.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=M.namedConstraint(t),new P.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new P.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=M.taggedConstraint(t)(e),new P.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return M.typeConstraint(t)(e.parentRequest)},new P.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return M.namedConstraint(t)(e.parentRequest)},new P.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return M.taggedConstraint(t)(e)(n.parentRequest)},new P.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return M.traverseAncerstors(e,M.typeConstraint(t))},new P.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!M.traverseAncerstors(e,M.typeConstraint(t))},new P.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return M.traverseAncerstors(e,M.namedConstraint(t))},new P.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!M.traverseAncerstors(e,M.namedConstraint(t))},new P.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return M.traverseAncerstors(n,M.taggedConstraint(t)(e))},new P.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!M.traverseAncerstors(n,M.taggedConstraint(t)(e))},new P.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return M.traverseAncerstors(e,t)},new P.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!M.traverseAncerstors(e,t)},new P.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=n})),P=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 k.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=n})),_=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 k.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new P.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})),C=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=a.BindingScopeEnum.Request,new _.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=a.BindingScopeEnum.Transient,new _.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=n})),A=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 k.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new P.BindingOnSyntax(this._binding),this._bindingInSyntax=new C.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})),O=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=a.BindingTypeEnum.Instance,this._binding.implementationType=t,new A.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+c.INVALID_TO_SELF_VALUE);return this.to(this._binding.serviceIdentifier)},t.prototype.toConstantValue=function(t){return this._binding.type=a.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=a.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new A.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=a.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(c.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=a.BindingTypeEnum.Function,this._binding.scope=a.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=a.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=n})),I=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})),R=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(c.NULL_ARGUMENT);if(null==e)throw new Error(c.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(c.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(c.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(c.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(c.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(c.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})),L=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])}}},h=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 f=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+c.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=a.BindingScopeEnum.Transient;else if(e.defaultScope!==a.BindingScopeEnum.Singleton&&e.defaultScope!==a.BindingScopeEnum.Transient&&e.defaultScope!==a.BindingScopeEnum.Request)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=s.id(),this._bindingDictionary=new R.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new l.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;arguments.length>i;i++)r[i-2]=arguments[i];var o=new t,a=h([e,n],r).map((function(t){return w.getBindingDictionary(t)})),s=w.getBindingDictionary(o);function u(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return a.forEach((function(t){u(t,s)})),o},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 u.Binding(t,this.options.defaultScope||a.BindingScopeEnum.Transient);return this._bindingDictionary.add(t,e),new O.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(c.CANNOT_UNBIND+" "+p.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new R.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,o.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=w.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(I.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(c.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,a.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,a.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,o.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,a.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,a.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,o.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(c.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=w.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),N.resolve(n)}},t}();e.Container=f})),D=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0,e.ContainerModule=function(t){this.id=s.id(),this.registry=t},e.AsyncContainerModule=function(t){this.id=s.id(),this.registry=t}})),B=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0,e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(o.PARAM_TYPES,t))throw new Error(c.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(o.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(o.PARAM_TYPES,e,t),t}}})),U=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?g.tagParameter(n,r,i,o):g.tagProperty(n,r,o)}}})),G=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(o.NAMED_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),j=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(o.OPTIONAL_TAG,!0);"number"==typeof n?g.tagParameter(t,e,n,r):g.tagProperty(t,e,r)}}})),F=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(o.UNMANAGED_TAG,!0);g.tagParameter(t,e,n,r)}}})),V=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(o.MULTI_INJECT_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),Y=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(o.NAME_TAG,t);g.tagParameter(e,n,r,i)}}})),H=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(o.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(o.POST_CONSTRUCT,t.constructor))throw new Error(c.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(o.POST_CONSTRUCT,r,t.constructor)}}})),W=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)}))}}}})),q=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=o,Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return L.Container}}),Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return a.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return a.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return a.TargetTypeEnum}}),Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return D.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return D.ContainerModule}}),Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return B.injectable}}),Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return U.tagged}}),Object.defineProperty(e,"named",{enumerable:!0,get:function(){return G.named}}),Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return m.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return m.LazyServiceIdentifer}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return j.optional}}),Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return F.unmanaged}}),Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return V.multiInject}}),Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return Y.targetName}}),Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return H.postConstruct}}),Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return l.MetadataReader}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return s.id}}),Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return g.decorate}}),Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return M.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return M.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return M.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return M.typeConstraint}}),Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return p.getServiceIdentifierAsString}}),Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return W.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 z(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 K(t,e,n){return e&&z(t.prototype,e),n&&z(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 Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function Q(e,n){return n.lifecycle===t.Syringe.Lifecycle.singleton?function(t){return t.inSingletonScope()}(e):function(t){return t.inTransientScope()}(e)}function $(t,e){t.whenTargetNamed(nt(e))}function tt(t,e){return e.bind(rt(t))}function et(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 nt(t){return i.isDefinedToken(t)?t.symbol:t}function rt(t){return i.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=K((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}}(t.Syringe||(t.Syringe={})),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}}(i||(i={}));var it=new q.Container;function ot(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 at(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(n),!0).forEach((function(e){st(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function st(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ut(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=q.injectable();return function(r){Reflect.defineMetadata(t.Syringe.ClassOptionSymbol,at(at({},e),{},{target:r}),r),n(r)}}function ct(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ut(at(at({},e),{},{lifecycle:t.Syringe.Lifecycle.singleton}))}function lt(t){return q.inject(rt(t))}var ht=Symbol("SyringeOptionSymbol");function ft(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 pt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(n),!0).forEach((function(e){dt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function dt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vt(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 yt=function(){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),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=t,this.token=n,this.option=r,this.rawToken=i.isNamedToken(n)?n.token:n,this.named=i.isNamedToken(n)?n.named:void 0,this.mutiple=!!this.named||i.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}var n,r,o;return n=e,r=[{key:"resolve",value:function(){var t=this,e=this.register;(function(t){return t&&"object"===Z(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){i.isMultipleEnabled(n)?tt(n,e).toService(t.generalToken):et(n,e).toService(t.generalToken)}))))}},{key:"resolveMono",value:function(t){if("useValue"in this.option)return et(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var e=this.option.useDynamic[this.option.useDynamic.length-1];return Q(et(this.generalToken,t).toDynamicValue((function(t){var n=Gt.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 et(this.generalToken,t).toFactory((function(t){var e=Gt.getContainer(t.container);return n({container:e})}))}if(this.option.useClass.length>0){var r=this.option.useClass[this.option.useClass.length-1];return Q(et(this.generalToken,t).to(r),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return Q(tt(e.generalToken,t).to(n),e.option)})),r=this.option.useDynamic.map((function(n){return Q(tt(e.generalToken,t).toDynamicValue((function(t){var e=Gt.getContainer(t.container);return n({container:e})})),e.option)})),i=this.option.useFactory.map((function(n){return tt(e.generalToken,t).toFactory((function(t){var e=Gt.getContainer(t.container);return n({container:e})}))})),o="useValue"in this.option?tt(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&$(t,e.named)})),r.forEach((function(t){return e.named&&$(t,e.named)})),i.forEach((function(t){return e.named&&$(t,e.named)})),o&&$(o,this.named))}}],o=[{key:"resolveTarget",value:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var a=Reflect.getMetadata(ht,r);a&&e.resolveOption(n,a)}catch(t){}if(i.isClass(r))if(o.useClass){var s=i.toArray(o.useClass);s.unshift(r),o.useClass=s}else o.useClass=[r];var u;try{u=Reflect.getMetadata(t.Syringe.ClassOptionSymbol,r)}catch(t){}if((u=pt(pt({},u||{}),o)).token){var c=i.toArray(u.token);c.unshift(r),u.token=c}else u.token=[r];e.resolveOption(n,u)}catch(t){}}},{key:"resolveOption",value:function(n,r){var o=function(e){var n=i.toArray(e.token),r=i.toArray(e.useClass),o=i.toArray(e.useDynamic),a=i.toArray(e.useFactory),s=i.toArray(e.contrib),u={token:n,useClass:r,lifecycle:s.length>0?t.Syringe.Lifecycle.singleton:e.lifecycle||t.Syringe.Lifecycle.transient,contrib:s,useDynamic:o,useFactory:a};return"useValue"in e&&(u.useValue=e.useValue),u}(pt(pt({},e.globalConfig),r));(0!==o.useClass.length||0!==o.useDynamic.length||0!==o.useFactory.length||"useValue"in o)&&o.token.forEach((function(t){new e(n,t,pt({},o)).resolve()}))}}],r&&vt(n.prototype,r),o&&vt(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}();yt.globalConfig=t.Syringe.DefaultOption;var gt=t.Syringe.defineToken("ContributionProvider");function mt(t){return function(t){if(Array.isArray(t))return Tt(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 Tt(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 Tt(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 Tt(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 Et(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 bt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(n),!0).forEach((function(e){xt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wt(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 St=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=bt(bt({},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,mt(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=bt(bt({},this.option),t),n=e.cache,r=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!r)),this.services}}],n&&wt(e.prototype,n),r&&wt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Nt(e,n){return{token:{token:gt,named:e},useDynamic:function(t){return new St(e,t.container,n)},lifecycle:t.Syringe.Lifecycle.singleton}}function Mt(e,n,r){e({token:{token:gt,named:n},useDynamic:function(t){return new St(n,t.container,r)},lifecycle:t.Syringe.Lifecycle.singleton})}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 Pt=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,o){var a={bind:t,unbind:e,isBound:r,rebind:o},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i.isInjectOption(t)?yt.resolveOption(a,t):yt.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 q.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(Nt(e))})),this}}],n&&kt(e.prototype,n),r&&kt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _t(t){return t&&"inversifyModule"in t}function Ct(t){return new Pt(t)}function At(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 Ot,It,Rt,Lt,Dt,Bt,Ut=new Map,Gt=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 q.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)?(_t(t)?this.container.load(t.inversifyModule):console.warn("Unsupported module.",t),this.loadedModules.push(t.id),{dispose:function(){n.unload(t)}}):{dispose:function(){}}}},{key:"unload",value:function(t){_t(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),nt(e))}},{key:"getAll",value:function(t){return this.container.getAll(rt(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(rt(t),nt(e))}},{key:"isBound",value:function(t){return this.container.isBound(rt(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(rt(t),nt(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]:{};i.isInjectOption(t)?yt.resolveOption(this.container,t):yt.resolveTarget(this.container,t,e)}}],r=[{key:"setContainer",value:function(t,e){return Ut.set(t.id,e)}},{key:"getContainer",value:function(e){var n=Ut.get(e.id);if(!n){var r=new t(e);return t.setContainer(e,r),r}return n}},{key:"config",value:function(t){yt.globalConfig=t}}],n&&At(e.prototype,n),r&&At(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),jt=new Gt(it),Ft=(jt.register.bind(jt),function(t){return function(e,n,r){q.named(nt(t))(e,n,r),lt(gt)(e,n,r)}});function Vt(t,e,n,r,i){Yt(t,e,n||0,r||t.length-1,i||Wt)}function Yt(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(0>a-o/2?-1:1);Yt(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}var l=t[e],h=n,f=r;for(Ht(t,n,e),i(t[r],l)>0&&Ht(t,n,r);f>h;){for(Ht(t,h,f),h++,f--;0>i(t[h],l);)h++;for(;i(t[f],l)>0;)f--}0===i(t[n],l)?Ht(t,n,f):Ht(t,++f,r),f>e||(n=f+1),e>f||(r=f-1)}}function Ht(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Wt(t,e){return e>t?-1:t>e?1:0}!function(t){t.Provider=gt,t.register=Mt}(Ot||(Ot={}));class qt{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!re(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],s=e.leaf?r(a):a;re(t,s)&&(e.leaf?n.push(a):ne(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n}collides(t){let e=this.data;if(!re(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(re(t,o)){if(e.leaf||ne(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=ie([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let a,s,u;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],a=o.pop(),u=!0),n.leaf){const r=Xt(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}u||n.leaf||!ne(n,r)?s?(a++,n=s.children[a],u=!1):n=null:(i.push(n),o.push(a),a=0,s=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,a=this._maxEntries;if(a>=i)return o=ie(t.slice(e,n+1)),zt(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=ie([]),o.leaf=!1,o.height=r;const s=Math.ceil(i/a),u=s*Math.ceil(Math.sqrt(a));oe(t,e,n,u,this.compareMinX);for(let i=e;n>=i;i+=u){const e=Math.min(i+u-1,n);oe(t,i,e,s,this.compareMinY);for(let n=i;e>=n;n+=s){const i=Math.min(n+s-1,e);o.children.push(this._build(t,n,i,r-1))}}return zt(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let s=0;e.children.length>s;s++){const u=e.children[s],c=$t(u),l=(i=t,o=u,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-c);a>l?(a=l,r=r>c?c:r,n=u):l===a&&r>c&&(r=c,n=u)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),Jt(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=ie(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,zt(n,this.toBBox),zt(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=ie([t,e]),this.data.height=t.height+1,this.data.leaf=!1,zt(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=Kt(t,0,a,this.toBBox),s=Kt(t,a,n,this.toBBox),u=ee(e,s),c=$t(e)+$t(s);i>u?(i=u,r=a,o=o>c?c:o):u===i&&o>c&&(o=c,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:Zt,i=t.leaf?this.compareMinY:Qt,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=Kt(t,0,e,i),a=Kt(t,n-e,n,i);let s=te(o)+te(a);for(let r=e;n-e>r;r++){const e=t.children[r];Jt(o,t.leaf?i(e):e),s+=te(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];Jt(a,t.leaf?i(e):e),s+=te(a)}return s}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)Jt(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():zt(t[n],this.toBBox)}}function Xt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function zt(t,e){Kt(t,0,t.children.length,e,t)}function Kt(t,e,n,r,i){i||(i=ie(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];Jt(i,t.leaf?r(e):e)}return i}function Jt(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Zt(t,e){return t.minX-e.minX}function Qt(t,e){return t.minY-e.minY}function $t(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function te(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ee(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function ne(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function re(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function ie(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oe(t,e,n,r,i){const o=[e,n];for(;o.length;){if(r>=(n=o.pop())-(e=o.pop()))continue;const a=e+Math.ceil((n-e)/r/2)*r;Vt(t,a,e,n,i),o.push(e,a,a,n)}}function ae(){
|
|
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,f=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,p=new(l||"function"!=typeof WeakMap?nt():WeakMap);function d(t,e,n,r){if(L(n)){if(!H(t))throw new TypeError;if(!q(e))throw new TypeError;return S(t,e)}if(!H(t))throw new TypeError;if(!U(e))throw new TypeError;if(!U(r)&&!L(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),N(t,e,n=Y(n),r)}function v(t,e){function n(n,r){if(!U(n))throw new TypeError;if(!L(r)&&!X(r))throw new TypeError;A(t,e,n,r)}return n}function y(t,e,n,r){if(!U(n))throw new TypeError;return L(r)||(r=Y(r)),A(t,e,n,r)}function g(t,e,n){if(!U(e))throw new TypeError;return L(n)||(n=Y(n)),k(t,e,n)}function m(t,e,n){if(!U(e))throw new TypeError;return L(n)||(n=Y(n)),P(t,e,n)}function T(t,e,n){if(!U(e))throw new TypeError;return L(n)||(n=Y(n)),_(t,e,n)}function E(t,e,n){if(!U(e))throw new TypeError;return L(n)||(n=Y(n)),C(t,e,n)}function b(t,e){if(!U(t))throw new TypeError;return L(e)||(e=Y(e)),O(t,e)}function x(t,e){if(!U(t))throw new TypeError;return L(e)||(e=Y(e)),I(t,e)}function w(t,e,n){if(!U(e))throw new TypeError;L(n)||(n=Y(n));var r=M(e,n,!1);if(L(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=p.get(e);return i.delete(n),i.size>0||p.delete(e),!0}function S(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 N(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(!U(o))throw new TypeError;r=o}}return r}function M(t,e,n){var r=p.get(t);if(L(r)){if(!n)return;r=new h,p.set(t,r)}var i=r.get(e);if(L(i)){if(!n)return;i=new h,r.set(e,i)}return i}function k(t,e,n){if(P(t,e,n))return!0;var r=$(e);return!D(r)&&k(t,r,n)}function P(t,e,n){var r=M(e,n,!1);return!L(r)&&F(r.has(t))}function _(t,e,n){if(P(t,e,n))return C(t,e,n);var r=$(e);return D(r)?void 0:_(t,r,n)}function C(t,e,n){var r=M(e,n,!1);if(!L(r))return r.get(t)}function A(t,e,n,r){M(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 f,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=M(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 B(t){return"symbol"==typeof t}function U(t){return"object"==typeof t?null!==t:"function"==typeof t}function G(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=z(t,r);if(void 0!==i){var o=i.call(t,n);if(U(o))throw new TypeError;return o}return j(t,"default"===n?"number":n)}function j(t,e){if("string"===e){var n=t.toString;if(W(n))if(!U(i=n.call(t)))return i;if(W(r=t.valueOf))if(!U(i=r.call(t)))return i}else{var r;if(W(r=t.valueOf))if(!U(i=r.call(t)))return i;var i,o=t.toString;if(W(o))if(!U(i=o.call(t)))return i}throw new TypeError}function F(t){return!!t}function V(t){return""+t}function Y(t){var e=G(t,3);return B(e)?e:V(e)}function H(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 X(t){switch(R(t)){case 3:case 4:return!0;default:return!1}}function z(t,e){var n=t[e];if(null!=n){if(!W(n))throw new TypeError;return n}}function K(t){var e=z(t,i);if(!W(e))throw new TypeError;var n=e.call(t);if(!U(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",v),t("defineMetadata",y),t("hasMetadata",g),t("hasOwnMetadata",m),t("getMetadata",T),t("getOwnMetadata",E),t("getMetadataKeys",b),t("getOwnMetadataKeys",x),t("deleteMetadata",w)}(i)}()}(e||(e={}));var i,o=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]})),a=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"}})),s=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}})),u=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var n=function(){function t(t,e){this.id=s.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=a.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===a.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})),c=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"})),l=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(o.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(o.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(o.TAGGED_PROP,t)||[]},t}();e.MetadataReader=n})),h=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===c.STACK_OVERFLOW}})),p=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(c.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})),d=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var n=function(){function t(t){this.id=s.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===o.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=n})),y=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}})),g=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(c.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var u=o[s];if(Array.isArray(u))for(var l=0,h=u;h.length>l;l++){var f=h[l];if(f.key===r.key)throw new Error(c.DUPLICATED_METADATA+" "+f.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(o.TAGGED,t,e,i,r)},e.tagProperty=function(t,e,r){n(o.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)}})),m=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(c.UNDEFINED_INJECT_ANNOTATION(e.name));var i=new v.Metadata(o.INJECT_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),T=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=s.id(),this.type=t,this.serviceIdentifier=n,this.name=new T.QueryableString(e||""),this.metadata=new Array;var i=null;"string"==typeof r?i=new v.Metadata(o.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(o.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(o.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(o.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return o.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(o.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===o.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return o.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(o.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})),b=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 o=t.getConstructorMetadata(n),a=o.compilerGeneratedMetadata;if(void 0===a)throw new Error(c.MISSING_INJECTABLE_ANNOTATION+" "+e+".");var l=o.userGeneratedMetadata,h=Object.keys(l),f=function(t,e,n,r,i){for(var o=[],a=0;i>a;a++){var u=s(a,t,e,n,r);null!==u&&o.push(u)}return o}(i,e,a,l,0===n.length&&h.length>0||h.length>n.length?h.length:n.length),p=u(t,n);return r(r([],f),p)}function s(t,e,n,r,i){var o=i[t.toString()]||[],s=l(o),u=!0!==s.unmanaged,h=r[t],f=s.inject||s.multiInject;if((h=f||h)instanceof m.LazyServiceIdentifer&&(h=h.unwrap()),u){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(c.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".");var p=new E.Target(a.TargetTypeEnum.ConstructorArgument,s.targetName,h);return p.metadata=o,p}return null}function u(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,s=Object.keys(n);s.length>o;o++){var c=s[o],h=n[c],f=l(n[c]),p=new E.Target(a.TargetTypeEnum.ClassProperty,f.targetName||c,f.inject||f.multiInject);p.metadata=h,i.push(p)}var d=Object.getPrototypeOf(e.prototype).constructor;if(d!==Object){var v=u(t,d);i=r(r([],i),v)}return i}function l(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[o.INJECT_TAG],multiInject:e[o.MULTI_INJECT_TAG],targetName:e[o.NAME_TAG],unmanaged:e[o.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 p.getFunctionName}}),e.getDependencies=function(t,e){return i(t,p.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var a=i(e,p.getFunctionName(r),r,!0),s=a.map((function(t){return t.metadata.filter((function(t){return t.key===o.UNMANAGED_TAG}))})),u=[].concat.apply([],s).length,c=a.length-u;return c>0?c:t(e,r)}return 0}})),x=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=s.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})),w=r((function(t,e){function n(t){return t._bindingDictionary}function r(t,e,n,r,i,a){var s=new v.Metadata(t?o.MULTI_INJECT_TAG:o.INJECT_TAG,n),u=new E.Target(e,r,n,s);if(void 0!==i){var c=new v.Metadata(i,a);u.metadata.push(c)}return u}function i(t,e,n,r,i){var o=u(n.container,i.serviceIdentifier),a=[];return o.length===h.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 x.Request(t.serviceIdentifier,n,r,t,i);return t.constraint(e)})),function(t,e,n,r){switch(e.length){case h.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var i=p.getServiceIdentifierAsString(t),o=c.NOT_REGISTERED;throw o+=p.listMetadataForTarget(i,n),o+=p.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o);case h.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;default:if(n.isArray())return e;i=p.getServiceIdentifierAsString(t),o=c.AMBIGUOUS_MATCH+" "+i;throw o+=p.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o)}}(i.serviceIdentifier,a,i,n.container),a}function s(t,e,n,r,o,u){var l,h;if(null===o){l=i(t,e,r,null,u),h=new x.Request(n,r,null,l,u);var f=new y.Plan(r,h);r.addPlan(f)}else l=i(t,e,r,o,u),h=o.addChildRequest(u.serviceIdentifier,l,u);l.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===a.BindingTypeEnum.Instance&&null!==e.implementationType){var i=b.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks)if(b.getBaseClassDependencyCount(t,e.implementationType)>i.length){var o=c.ARGUMENTS_LENGTH_MISMATCH(b.getFunctionName(e.implementationType));throw new Error(o)}i.forEach((function(e){s(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,o,a,u,c){void 0===c&&(c=!1);var l=new d.Context(e),h=r(n,i,o,"",a,u);try{return s(t,c,o,l,null,h),l}catch(t){throw f.isStackOverflowExeption(t)&&l.plan&&p.circularDependencyToException(l.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new E.Target(a.TargetTypeEnum.Variable,"",e,new v.Metadata(n,r)),o=new d.Context(t);return new x.Request(e,o,null,[],i)}})),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};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0,e.resolveInstance=function(t,e,n){var i,s=null;if(e.length>0){var u=e.filter((function(t){return null!==t.target&&t.target.type===a.TargetTypeEnum.ConstructorArgument})).map(n);s=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===a.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value(),t[r]=i[n]})),t}(s=new((i=t).bind.apply(i,r([void 0],u))),e,n)}else s=new t;return function(t,e){if(Reflect.hasMetadata(o.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(o.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(c.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,s),s}})),N=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(c.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,s=e.target&&e.target.isArray(),u=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(s&&u)return o.map((function(e){return r(t)(e)}));var l=null;if(!e.target.isOptional()||0!==i.length){var h=i[0],f=h.scope===a.BindingScopeEnum.Singleton,d=h.scope===a.BindingScopeEnum.Request;if(f&&h.activated)return h.cache;if(d&&null!==t&&t.has(h.id))return t.get(h.id);if(h.type===a.BindingTypeEnum.ConstantValue)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Function)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Constructor)l=h.implementationType;else if(h.type===a.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)l=n("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(e.parentContext)}));else if(h.type===a.BindingTypeEnum.Factory&&null!==h.factory)l=n("toFactory",h.serviceIdentifier,(function(){return h.factory(e.parentContext)}));else if(h.type===a.BindingTypeEnum.Provider&&null!==h.provider)l=n("toProvider",h.serviceIdentifier,(function(){return h.provider(e.parentContext)}));else{if(h.type!==a.BindingTypeEnum.Instance||null===h.implementationType){var v=p.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(c.INVALID_BINDING_TYPE+" "+v)}l=S.resolveInstance(h.implementationType,o,r(t))}return"function"==typeof h.onActivation&&(l=h.onActivation(e.parentContext,l)),f&&(h.cache=l,h.activated=!0),d&&null!==t&&!t.has(h.id)&&t.set(h.id,l),l}}};e.resolve=function(t){return r(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}})),M=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(o.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)}}})),k=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 P.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=M.namedConstraint(t),new P.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new P.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=M.taggedConstraint(t)(e),new P.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return M.typeConstraint(t)(e.parentRequest)},new P.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return M.namedConstraint(t)(e.parentRequest)},new P.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return M.taggedConstraint(t)(e)(n.parentRequest)},new P.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return M.traverseAncerstors(e,M.typeConstraint(t))},new P.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!M.traverseAncerstors(e,M.typeConstraint(t))},new P.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return M.traverseAncerstors(e,M.namedConstraint(t))},new P.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!M.traverseAncerstors(e,M.namedConstraint(t))},new P.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return M.traverseAncerstors(n,M.taggedConstraint(t)(e))},new P.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!M.traverseAncerstors(n,M.taggedConstraint(t)(e))},new P.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return M.traverseAncerstors(e,t)},new P.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!M.traverseAncerstors(e,t)},new P.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=n})),P=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 k.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=n})),_=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 k.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new P.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})),C=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=a.BindingScopeEnum.Request,new _.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=a.BindingScopeEnum.Transient,new _.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=n})),A=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 k.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new P.BindingOnSyntax(this._binding),this._bindingInSyntax=new C.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})),O=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=a.BindingTypeEnum.Instance,this._binding.implementationType=t,new A.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+c.INVALID_TO_SELF_VALUE);return this.to(this._binding.serviceIdentifier)},t.prototype.toConstantValue=function(t){return this._binding.type=a.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=a.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new A.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=a.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(c.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=a.BindingTypeEnum.Function,this._binding.scope=a.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=a.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=n})),I=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})),R=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(c.NULL_ARGUMENT);if(null==e)throw new Error(c.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(c.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(c.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(c.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(c.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(c.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})),L=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])}}},h=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 f=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+c.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=a.BindingScopeEnum.Transient;else if(e.defaultScope!==a.BindingScopeEnum.Singleton&&e.defaultScope!==a.BindingScopeEnum.Transient&&e.defaultScope!==a.BindingScopeEnum.Request)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=s.id(),this._bindingDictionary=new R.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new l.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;arguments.length>i;i++)r[i-2]=arguments[i];var o=new t,a=h([e,n],r).map((function(t){return w.getBindingDictionary(t)})),s=w.getBindingDictionary(o);function u(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return a.forEach((function(t){u(t,s)})),o},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 u.Binding(t,this.options.defaultScope||a.BindingScopeEnum.Transient);return this._bindingDictionary.add(t,e),new O.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(c.CANNOT_UNBIND+" "+p.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new R.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,o.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=w.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(I.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(c.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,a.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,a.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,o.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,a.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,a.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,o.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(c.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=w.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),N.resolve(n)}},t}();e.Container=f})),D=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0,e.ContainerModule=function(t){this.id=s.id(),this.registry=t},e.AsyncContainerModule=function(t){this.id=s.id(),this.registry=t}})),B=r((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0,e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(o.PARAM_TYPES,t))throw new Error(c.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(o.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(o.PARAM_TYPES,e,t),t}}})),U=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?g.tagParameter(n,r,i,o):g.tagProperty(n,r,o)}}})),G=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(o.NAMED_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),j=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(o.OPTIONAL_TAG,!0);"number"==typeof n?g.tagParameter(t,e,n,r):g.tagProperty(t,e,r)}}})),F=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(o.UNMANAGED_TAG,!0);g.tagParameter(t,e,n,r)}}})),V=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(o.MULTI_INJECT_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),Y=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(o.NAME_TAG,t);g.tagParameter(e,n,r,i)}}})),H=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(o.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(o.POST_CONSTRUCT,t.constructor))throw new Error(c.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(o.POST_CONSTRUCT,r,t.constructor)}}})),W=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)}))}}}})),q=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=o,Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return L.Container}}),Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return a.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return a.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return a.TargetTypeEnum}}),Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return D.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return D.ContainerModule}}),Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return B.injectable}}),Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return U.tagged}}),Object.defineProperty(e,"named",{enumerable:!0,get:function(){return G.named}}),Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return m.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return m.LazyServiceIdentifer}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return j.optional}}),Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return F.unmanaged}}),Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return V.multiInject}}),Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return Y.targetName}}),Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return H.postConstruct}}),Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return l.MetadataReader}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return s.id}}),Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return g.decorate}}),Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return M.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return M.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return M.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return M.typeConstraint}}),Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return p.getServiceIdentifierAsString}}),Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return W.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 z(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 K(t,e,n){return e&&z(t.prototype,e),n&&z(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J(t){return J="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},J(t)}function Q(e,n){return n.lifecycle===t.Syringe.Lifecycle.singleton?function(t){return t.inSingletonScope()}(e):function(t){return t.inTransientScope()}(e)}function $(t,e){t.whenTargetNamed(nt(e))}function tt(t,e){return e.bind(rt(t))}function et(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 nt(t){return i.isDefinedToken(t)?t.symbol:t}function rt(t){return i.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=K((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(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}}(t.Syringe||(t.Syringe={})),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}}(i||(i={}));var it=new q.Container;function ot(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 at(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(n),!0).forEach((function(e){st(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function st(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ut(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=q.injectable();return function(r){Reflect.defineMetadata(t.Syringe.ClassOptionSymbol,at(at({},e),{},{target:r}),r),n(r)}}function ct(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ut(at(at({},e),{},{lifecycle:t.Syringe.Lifecycle.singleton}))}function lt(t){return q.inject(rt(t))}var ht=Symbol("SyringeOptionSymbol");function ft(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 pt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(n),!0).forEach((function(e){dt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function dt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vt(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 yt=function(){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),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=t,this.token=n,this.option=r,this.rawToken=i.isNamedToken(n)?n.token:n,this.named=i.isNamedToken(n)?n.named:void 0,this.mutiple=!!this.named||i.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}var n,r,o;return n=e,r=[{key:"resolve",value:function(){var t=this,e=this.register;(function(t){return t&&"object"===J(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){i.isMultipleEnabled(n)?tt(n,e).toService(t.generalToken):et(n,e).toService(t.generalToken)}))))}},{key:"resolveMono",value:function(t){if("useValue"in this.option)return et(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var e=this.option.useDynamic[this.option.useDynamic.length-1];return Q(et(this.generalToken,t).toDynamicValue((function(t){var n=Gt.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 et(this.generalToken,t).toFactory((function(t){var e=Gt.getContainer(t.container);return n({container:e})}))}if(this.option.useClass.length>0){var r=this.option.useClass[this.option.useClass.length-1];return Q(et(this.generalToken,t).to(r),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return Q(tt(e.generalToken,t).to(n),e.option)})),r=this.option.useDynamic.map((function(n){return Q(tt(e.generalToken,t).toDynamicValue((function(t){var e=Gt.getContainer(t.container);return n({container:e})})),e.option)})),i=this.option.useFactory.map((function(n){return tt(e.generalToken,t).toFactory((function(t){var e=Gt.getContainer(t.container);return n({container:e})}))})),o="useValue"in this.option?tt(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&$(t,e.named)})),r.forEach((function(t){return e.named&&$(t,e.named)})),i.forEach((function(t){return e.named&&$(t,e.named)})),o&&$(o,this.named))}}],o=[{key:"resolveTarget",value:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var a=Reflect.getMetadata(ht,r);a&&e.resolveOption(n,a)}catch(t){}if(i.isClass(r))if(o.useClass){var s=i.toArray(o.useClass);s.unshift(r),o.useClass=s}else o.useClass=[r];var u;try{u=Reflect.getMetadata(t.Syringe.ClassOptionSymbol,r)}catch(t){}if((u=pt(pt({},u||{}),o)).token){var c=i.toArray(u.token);c.unshift(r),u.token=c}else u.token=[r];e.resolveOption(n,u)}catch(t){}}},{key:"resolveOption",value:function(n,r){var o=function(e){var n=i.toArray(e.token),r=i.toArray(e.useClass),o=i.toArray(e.useDynamic),a=i.toArray(e.useFactory),s=i.toArray(e.contrib),u={token:n,useClass:r,lifecycle:s.length>0?t.Syringe.Lifecycle.singleton:e.lifecycle||t.Syringe.Lifecycle.transient,contrib:s,useDynamic:o,useFactory:a};return"useValue"in e&&(u.useValue=e.useValue),u}(pt(pt({},e.globalConfig),r));(0!==o.useClass.length||0!==o.useDynamic.length||0!==o.useFactory.length||"useValue"in o)&&o.token.forEach((function(t){new e(n,t,pt({},o)).resolve()}))}}],r&&vt(n.prototype,r),o&&vt(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}();yt.globalConfig=t.Syringe.DefaultOption;var gt=t.Syringe.defineToken("ContributionProvider");function mt(t){return function(t){if(Array.isArray(t))return Tt(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 Tt(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 Tt(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 Tt(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 Et(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 bt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(n),!0).forEach((function(e){xt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wt(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 St=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=bt(bt({},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,mt(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=bt(bt({},this.option),t),n=e.cache,r=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!r)),this.services}}],n&&wt(e.prototype,n),r&&wt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Nt(e,n){return{token:{token:gt,named:e},useDynamic:function(t){return new St(e,t.container,n)},lifecycle:t.Syringe.Lifecycle.singleton}}function Mt(e,n,r){e({token:{token:gt,named:n},useDynamic:function(t){return new St(n,t.container,r)},lifecycle:t.Syringe.Lifecycle.singleton})}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 Pt=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,o){var a={bind:t,unbind:e,isBound:r,rebind:o},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i.isInjectOption(t)?yt.resolveOption(a,t):yt.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 q.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(Nt(e))})),this}}],n&&kt(e.prototype,n),r&&kt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _t(t){return t&&"inversifyModule"in t}function Ct(t){return new Pt(t)}function At(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 Ot,It,Rt,Lt,Dt,Bt,Ut=new Map,Gt=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 q.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)?(_t(t)?this.container.load(t.inversifyModule):console.warn("Unsupported module.",t),this.loadedModules.push(t.id),{dispose:function(){n.unload(t)}}):{dispose:function(){}}}},{key:"unload",value:function(t){_t(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),nt(e))}},{key:"getAll",value:function(t){return this.container.getAll(rt(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(rt(t),nt(e))}},{key:"isBound",value:function(t){return this.container.isBound(rt(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(rt(t),nt(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]:{};i.isInjectOption(t)?yt.resolveOption(this.container,t):yt.resolveTarget(this.container,t,e)}}],r=[{key:"setContainer",value:function(t,e){return Ut.set(t.id,e)}},{key:"getContainer",value:function(e){var n=Ut.get(e.id);if(!n){var r=new t(e);return t.setContainer(e,r),r}return n}},{key:"config",value:function(t){yt.globalConfig=t}}],n&&At(e.prototype,n),r&&At(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),jt=new Gt(it),Ft=(jt.register.bind(jt),function(t){return function(e,n,r){q.named(nt(t))(e,n,r),lt(gt)(e,n,r)}});function Vt(t,e,n,r,i){Yt(t,e,n||0,r||t.length-1,i||Wt)}function Yt(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(0>a-o/2?-1:1);Yt(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}var l=t[e],h=n,f=r;for(Ht(t,n,e),i(t[r],l)>0&&Ht(t,n,r);f>h;){for(Ht(t,h,f),h++,f--;0>i(t[h],l);)h++;for(;i(t[f],l)>0;)f--}0===i(t[n],l)?Ht(t,n,f):Ht(t,++f,r),f>e||(n=f+1),e>f||(r=f-1)}}function Ht(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Wt(t,e){return e>t?-1:t>e?1:0}!function(t){t.Provider=gt,t.register=Mt}(Ot||(Ot={}));class qt{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!re(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],s=e.leaf?r(a):a;re(t,s)&&(e.leaf?n.push(a):ne(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n}collides(t){let e=this.data;if(!re(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(re(t,o)){if(e.leaf||ne(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=ie([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let a,s,u;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],a=o.pop(),u=!0),n.leaf){const r=Xt(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}u||n.leaf||!ne(n,r)?s?(a++,n=s.children[a],u=!1):n=null:(i.push(n),o.push(a),a=0,s=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,a=this._maxEntries;if(a>=i)return o=ie(t.slice(e,n+1)),zt(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=ie([]),o.leaf=!1,o.height=r;const s=Math.ceil(i/a),u=s*Math.ceil(Math.sqrt(a));oe(t,e,n,u,this.compareMinX);for(let i=e;n>=i;i+=u){const e=Math.min(i+u-1,n);oe(t,i,e,s,this.compareMinY);for(let n=i;e>=n;n+=s){const i=Math.min(n+s-1,e);o.children.push(this._build(t,n,i,r-1))}}return zt(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let s=0;e.children.length>s;s++){const u=e.children[s],c=$t(u),l=(i=t,o=u,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-c);a>l?(a=l,r=r>c?c:r,n=u):l===a&&r>c&&(r=c,n=u)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),Zt(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=ie(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,zt(n,this.toBBox),zt(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=ie([t,e]),this.data.height=t.height+1,this.data.leaf=!1,zt(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=Kt(t,0,a,this.toBBox),s=Kt(t,a,n,this.toBBox),u=ee(e,s),c=$t(e)+$t(s);i>u?(i=u,r=a,o=o>c?c:o):u===i&&o>c&&(o=c,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:Jt,i=t.leaf?this.compareMinY:Qt,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=Kt(t,0,e,i),a=Kt(t,n-e,n,i);let s=te(o)+te(a);for(let r=e;n-e>r;r++){const e=t.children[r];Zt(o,t.leaf?i(e):e),s+=te(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];Zt(a,t.leaf?i(e):e),s+=te(a)}return s}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)Zt(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():zt(t[n],this.toBBox)}}function Xt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function zt(t,e){Kt(t,0,t.children.length,e,t)}function Kt(t,e,n,r,i){i||(i=ie(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];Zt(i,t.leaf?r(e):e)}return i}function Zt(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Jt(t,e){return t.minX-e.minX}function Qt(t,e){return t.minY-e.minY}function $t(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function te(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ee(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function ne(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function re(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function ie(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oe(t,e,n,r,i){const o=[e,n];for(;o.length;){if(r>=(n=o.pop())-(e=o.pop()))continue;const a=e+Math.ceil((n-e)/r/2)*r;Vt(t,a,e,n,i),o.push(e,a,a,n)}}function ae(){
|
|
16
16
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
17
|
-
ae=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 N()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(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 f(){}function p(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(S([])));y&&y!==e&&n.call(y,i)&&(d=y);var g=p.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 E(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,E(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 b(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 x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(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:N}}function N(){return{value:void 0,done:!0}}return f.prototype=p,s(g,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,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=S,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(x),!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),x(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;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function se(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 ue(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){se(o,r,i,a,s,"next",t)}function s(t){se(o,r,i,a,s,"throw",t)}a(void 0)}))}}function ce(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 le(t,e,n){return e&&ce(t.prototype,e),n&&ce(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function he(){return he=Object.assign?Object.assign.bind():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},he.apply(this,arguments)}function fe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,pe(t,e)}function pe(t,e){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pe(t,e)}function de(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 ve(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ye(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 ge(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 ye(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)?ye(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.")}(It=t.UnitType||(t.UnitType={}))[It.kUnknown=0]="kUnknown",It[It.kNumber=1]="kNumber",It[It.kPercentage=2]="kPercentage",It[It.kEms=3]="kEms",It[It.kPixels=4]="kPixels",It[It.kRems=5]="kRems",It[It.kDegrees=6]="kDegrees",It[It.kRadians=7]="kRadians",It[It.kGradians=8]="kGradians",It[It.kTurns=9]="kTurns",It[It.kMilliseconds=10]="kMilliseconds",It[It.kSeconds=11]="kSeconds",It[It.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(Rt||(Rt={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Lt||(Lt={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Dt||(Dt={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Bt||(Bt={}));var me,Te=[{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}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(me||(me={}));var Ee,be=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Te.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},xe=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},we=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms: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""},Se=function(){function e(){}e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds};var n=e.prototype;return n.toString=function(){return this.buildCSSText(Dt.kNo,Bt.kNo,"")},n.isNumericValue=function(){return this.getType()>=me.kUnitType&&this.getType()<=me.kClampType},e}(),Ne=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}fe(e,t);var n=e.prototype;return n.getType=function(){return me.kColorType},n.to=function(t){return this},e}(Se);(Ee=t.GradientType||(t.GradientType={}))[Ee.Constant=0]="Constant",Ee[Ee.LinearGradient=1]="LinearGradient",Ee[Ee.RadialGradient=2]="RadialGradient";var Me=function(t){function e(e,n){var r;return(r=t.call(this)||this).type=void 0,r.value=void 0,r.type=e,r.value=n,r}fe(e,t);var n=e.prototype;return n.clone=function(){return new e(this.type,this.value)},n.buildCSSText=function(t,e,n){return n},n.getType=function(){return me.kColorType},e}(Se),ke=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}fe(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return me.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(Se),Pe=1e-6,_e="undefined"!=typeof Float32Array?Float32Array:Array;function Ce(){var t=new _e(9);return _e!=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 Ae(){var t=new _e(16);return _e!=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 Oe(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 Ie(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,v,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=p,t[13]=d,t[14]=v,t[15]=y,t}function Re(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 Le(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function De(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],f=e[10],p=e[11],d=e[12],v=e[13],y=e[14],g=e[15],m=n*s-r*a,T=n*u-i*a,E=n*c-o*a,b=r*u-i*s,x=r*c-o*s,w=i*c-o*u,S=l*v-h*d,N=l*y-f*d,M=l*g-p*d,k=h*y-f*v,P=h*g-p*v,_=f*g-p*y,C=m*_-T*P+E*k+b*M-x*N+w*S;return C?(t[0]=(s*_-u*P+c*k)*(C=1/C),t[1]=(i*P-r*_-o*k)*C,t[2]=(v*w-y*x+g*b)*C,t[3]=(f*x-h*w-p*b)*C,t[4]=(u*M-a*_-c*N)*C,t[5]=(n*_-i*M+o*N)*C,t[6]=(y*E-d*w-g*T)*C,t[7]=(l*w-f*E+p*T)*C,t[8]=(a*P-s*M+c*S)*C,t[9]=(r*M-n*P-o*S)*C,t[10]=(d*x-v*E+g*m)*C,t[11]=(h*E-l*x-p*m)*C,t[12]=(s*N-a*k-u*S)*C,t[13]=(n*k-r*N+i*S)*C,t[14]=(v*T-d*b-y*m)*C,t[15]=(l*b-h*T+f*m)*C,t):null}function Be(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],f=t[11],p=t[12],d=t[13],v=t[14],y=t[15];return(e*a-n*o)*(h*y-f*v)-(e*s-r*o)*(l*y-f*d)+(e*u-i*o)*(l*v-h*d)+(n*s-r*a)*(c*y-f*p)-(n*u-i*a)*(c*v-h*p)+(r*u-i*s)*(c*d-l*p)}function Ue(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],f=e[9],p=e[10],d=e[11],v=e[12],y=e[13],g=e[14],m=e[15],T=n[0],E=n[1],b=n[2],x=n[3];return t[0]=T*r+E*s+b*h+x*v,t[1]=T*i+E*u+b*f+x*y,t[2]=T*o+E*c+b*p+x*g,t[3]=T*a+E*l+b*d+x*m,t[4]=(T=n[4])*r+(E=n[5])*s+(b=n[6])*h+(x=n[7])*v,t[5]=T*i+E*u+b*f+x*y,t[6]=T*o+E*c+b*p+x*g,t[7]=T*a+E*l+b*d+x*m,t[8]=(T=n[8])*r+(E=n[9])*s+(b=n[10])*h+(x=n[11])*v,t[9]=T*i+E*u+b*f+x*y,t[10]=T*o+E*c+b*p+x*g,t[11]=T*a+E*l+b*d+x*m,t[12]=(T=n[12])*r+(E=n[13])*s+(b=n[14])*h+(x=n[15])*v,t[13]=T*i+E*u+b*f+x*y,t[14]=T*o+E*c+b*p+x*g,t[15]=T*a+E*l+b*d+x*m,t}function Ge(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,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]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=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]=f,t[10]=p,t[11]=d,t[12]=r*v+s*y+h*g+e[12],t[13]=i*v+u*y+f*g+e[13],t[14]=o*v+c*y+p*g+e[14],t[15]=a*v+l*y+d*g+e[15]),t}function je(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 Fe(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],f=e[11];return 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+f*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function Ve(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function Ye(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function He(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,f=r*c,p=i*u,d=i*c,v=o*c,y=a*s,g=a*u,m=a*c;return t[0]=1-(p+v),t[1]=h+m,t[2]=f-g,t[3]=0,t[4]=h-m,t[5]=1-(l+v),t[6]=d+y,t[7]=0,t[8]=f+g,t[9]=d-y,t[10]=1-(l+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function We(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function qe(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 Xe(t,e){var n=new _e(3);qe(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,f=e[8]*r,p=e[9]*i,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-p)/y,t[1]=(f-u)/y,t[2]=(s-c)/y):a>l&&a>d?(y=2*Math.sqrt(1+a-l-d),t[3]=(h-p)/y,t[0]=.25*y,t[1]=(s+c)/y,t[2]=(f+u)/y):l>d?(y=2*Math.sqrt(1+l-a-d),t[3]=(f-u)/y,t[0]=(s+c)/y,t[1]=.25*y,t[2]=(h+p)/y):(y=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/y,t[0]=(f+u)/y,t[1]=(h+p)/y,t[2]=.25*y),t}function ze(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,f=o*c,p=o*l,d=o*h,v=a*l,y=a*h,g=s*h,m=u*c,T=u*l,E=u*h,b=r[0],x=r[1],w=r[2],S=i[0],N=i[1],M=i[2],k=(1-(v+g))*b,P=(p+E)*b,_=(d-T)*b,C=(p-E)*x,A=(1-(f+g))*x,O=(y+m)*x,I=(d+T)*w,R=(y-m)*w,L=(1-(f+v))*w;return t[0]=k,t[1]=P,t[2]=_,t[3]=0,t[4]=C,t[5]=A,t[6]=O,t[7]=0,t[8]=I,t[9]=R,t[10]=L,t[11]=0,t[12]=n[0]+S-(k*S+C*N+I*M),t[13]=n[1]+N-(P*S+A*N+R*M),t[14]=n[2]+M-(_*S+O*N+L*M),t[15]=1,t}function Ke(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,f=i*a,p=i*s,d=i*u,v=o*a,y=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=f-y,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=p+v,t[7]=0,t[8]=f+y,t[9]=p-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Je(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function Ze(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}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Qe=Ze;function $e(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d=e[0],v=e[1],y=e[2],g=r[0],m=r[1],T=r[2],E=n[0],b=n[1],x=n[2];return Math.abs(d-E)<Pe&&Math.abs(v-b)<Pe&&Math.abs(y-x)<Pe?Re(t):(l=d-E,h=v-b,f=y-x,i=m*(f*=p=1/Math.hypot(l,h,f))-T*(h*=p),o=T*(l*=p)-g*f,a=g*h-m*l,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-f*o,u=f*i-l*a,c=l*o-h*i,(p=Math.hypot(s,u,c))?(s*=p=1/p,u*=p,c*=p):(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]=f,t[11]=0,t[12]=-(i*d+o*v+a*y),t[13]=-(s*d+u*v+c*y),t[14]=-(l*d+h*v+f*y),t[15]=1,t)}function tn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var en=Object.freeze({__proto__:null,create:Ae,clone:function(t){var e=new _e(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:Oe,fromValues:function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,v){var y=new _e(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=o,y[6]=a,y[7]=s,y[8]=u,y[9]=c,y[10]=l,y[11]=h,y[12]=f,y[13]=p,y[14]=d,y[15]=v,y},set:Ie,identity:Re,transpose:Le,invert:De,adjoint:function(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],f=e[10],p=e[11],d=e[12],v=e[13],y=e[14],g=e[15];return t[0]=s*(f*g-p*y)-h*(u*g-c*y)+v*(u*p-c*f),t[1]=-(r*(f*g-p*y)-h*(i*g-o*y)+v*(i*p-o*f)),t[2]=r*(u*g-c*y)-s*(i*g-o*y)+v*(i*c-o*u),t[3]=-(r*(u*p-c*f)-s*(i*p-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*g-p*y)-l*(u*g-c*y)+d*(u*p-c*f)),t[5]=n*(f*g-p*y)-l*(i*g-o*y)+d*(i*p-o*f),t[6]=-(n*(u*g-c*y)-a*(i*g-o*y)+d*(i*c-o*u)),t[7]=n*(u*p-c*f)-a*(i*p-o*f)+l*(i*c-o*u),t[8]=a*(h*g-p*v)-l*(s*g-c*v)+d*(s*p-c*h),t[9]=-(n*(h*g-p*v)-l*(r*g-o*v)+d*(r*p-o*h)),t[10]=n*(s*g-c*v)-a*(r*g-o*v)+d*(r*c-o*s),t[11]=-(n*(s*p-c*h)-a*(r*p-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*y-f*v)-l*(s*y-u*v)+d*(s*f-u*h)),t[13]=n*(h*y-f*v)-l*(r*y-i*v)+d*(r*f-i*h),t[14]=-(n*(s*y-u*v)-a*(r*y-i*v)+d*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t},determinant:Be,multiply:Ue,translate:Ge,scale:je,rotate:function(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d,v,y,g,m,T,E,b,x,w,S,N,M,k,P=r[0],_=r[1],C=r[2],A=Math.hypot(P,_,C);return Pe>A?null:(P*=A=1/A,_*=A,C*=A,i=Math.sin(n),o=Math.cos(n),u=e[1],c=e[2],l=e[3],f=e[5],p=e[6],d=e[7],y=e[9],g=e[10],m=e[11],x=P*_*(a=1-o)-C*i,w=_*_*a+o,S=C*_*a+P*i,N=P*C*a+_*i,M=_*C*a-P*i,k=C*C*a+o,t[0]=(s=e[0])*(T=P*P*a+o)+(h=e[4])*(E=_*P*a+C*i)+(v=e[8])*(b=C*P*a-_*i),t[1]=u*T+f*E+y*b,t[2]=c*T+p*E+g*b,t[3]=l*T+d*E+m*b,t[4]=s*x+h*w+v*S,t[5]=u*x+f*w+y*S,t[6]=c*x+p*w+g*S,t[7]=l*x+d*w+m*S,t[8]=s*N+h*M+v*k,t[9]=u*N+f*M+y*k,t[10]=c*N+p*M+g*k,t[11]=l*N+d*M+m*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:Fe,rotateY:Ve,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7];return e!==t&&(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[0]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:Ye,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return Pe>c?null:(a*=c=1/c,s*=c,u*=c,r=Math.sin(e),i=Math.cos(e),t[0]=a*a*(o=1-i)+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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},fromRotationTranslation:He,fromQuat2:function(t,e){var n=new _e(3),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=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+l*r+u*o-c*i)/h,n[1]=2*(u*a+l*i+c*r-s*o)/h,n[2]=2*(c*a+l*o+s*i-u*r)/h):(n[0]=2*(s*a+l*r+u*o-c*i),n[1]=2*(u*a+l*i+c*r-s*o),n[2]=2*(c*a+l*o+s*i-u*r)),He(t,e,n),t},getTranslation:We,getScaling:qe,getRotation:Xe,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,p=i*l,d=o*c,v=o*l,y=a*l,g=s*u,m=s*c,T=s*l,E=r[0],b=r[1],x=r[2];return t[0]=(1-(d+y))*E,t[1]=(f+T)*E,t[2]=(p-m)*E,t[3]=0,t[4]=(f-T)*b,t[5]=(1-(h+y))*b,t[6]=(v+g)*b,t[7]=0,t[8]=(p+m)*x,t[9]=(v-g)*x,t[10]=(1-(h+d))*x,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:ze,fromQuat:Ke,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},perspectiveNO:Je,perspective:Je,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Ze,ortho:Qe,orthoZO: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]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t},lookAt:$e,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],f=a-n[2],p=l*l+h*h+f*f;p>0&&(l*=p=1/Math.sqrt(p),h*=p,f*=p);var d=u*f-c*h,v=c*l-s*f,y=s*h-u*l;return(p=d*d+v*v+y*y)>0&&(d*=p=1/Math.sqrt(p),v*=p,y*=p),t[0]=d,t[1]=v,t[2]=y,t[3]=0,t[4]=h*y-f*v,t[5]=f*d-l*y,t[6]=l*v-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:tn,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(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[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(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]},equals:function(t,e){var n=t[0],r=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],f=t[10],p=t[11],d=t[12],v=t[13],y=t[14],g=t[15],m=e[0],T=e[1],E=e[2],b=e[3],x=e[4],w=e[5],S=e[6],N=e[7],M=e[8],k=e[9],P=e[10],_=e[11],C=e[12],A=e[13],O=e[14],I=e[15];return!(Math.abs(n-m)>Pe*Math.max(1,Math.abs(n),Math.abs(m))||Math.abs(r-T)>Pe*Math.max(1,Math.abs(r),Math.abs(T))||Math.abs(i-E)>Pe*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(o-b)>Pe*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(a-x)>Pe*Math.max(1,Math.abs(a),Math.abs(x))||Math.abs(s-w)>Pe*Math.max(1,Math.abs(s),Math.abs(w))||Math.abs(u-S)>Pe*Math.max(1,Math.abs(u),Math.abs(S))||Math.abs(c-N)>Pe*Math.max(1,Math.abs(c),Math.abs(N))||Math.abs(l-M)>Pe*Math.max(1,Math.abs(l),Math.abs(M))||Math.abs(h-k)>Pe*Math.max(1,Math.abs(h),Math.abs(k))||Math.abs(f-P)>Pe*Math.max(1,Math.abs(f),Math.abs(P))||Math.abs(p-_)>Pe*Math.max(1,Math.abs(p),Math.abs(_))||Math.abs(d-C)>Pe*Math.max(1,Math.abs(d),Math.abs(C))||Math.abs(v-A)>Pe*Math.max(1,Math.abs(v),Math.abs(A))||Math.abs(y-O)>Pe*Math.max(1,Math.abs(y),Math.abs(O))||Math.abs(g-I)>Pe*Math.max(1,Math.abs(g),Math.abs(I)))},mul:Ue,sub:tn});function nn(){var t=new _e(3);return _e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function rn(t){return Math.hypot(t[0],t[1],t[2])}function on(t,e,n){var r=new _e(3);return r[0]=t,r[1]=e,r[2]=n,r}function an(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function sn(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function un(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function cn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ln(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function hn(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 fn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pn(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 dn(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 vn(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)<=Pe*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=Pe*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=Pe*Math.max(1,Math.abs(i),Math.abs(s))}var yn,gn=cn,mn=rn;yn=nn();function Tn(){var t=new _e(4);return _e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function En(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=Tn()}();function bn(){var t=new _e(4);return _e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function xn(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 wn(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 Sn(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],f=e[3],p=n[0],d=n[1],v=n[2],y=n[3];return 0>(o=c*p+l*d+h*v+f*y)&&(o=-o,p=-p,d=-d,v=-v,y=-y),1-o>Pe?(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*p,t[1]=s*l+u*d,t[2]=s*h+u*v,t[3]=s*f+u*y,t}function Nn(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 Mn(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 kn,Pn,_n,Cn,An,On,In=function(t,e,n,r){var i=new _e(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},Rn=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ln=wn,Dn=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};kn=nn(),Pn=on(1,0,0),_n=on(0,1,0),Cn=bn(),An=bn(),On=Ce();function Bn(t,e){var n=new _e(2);return n[0]=t,n[1]=e,n}!function(){var t,e=(t=new _e(2),_e!=Float32Array&&(t[0]=0,t[1]=0),t)}();function Un(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var Gn=function(){return Gn=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Gn.apply(this,arguments)};function jn(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 Fn(t,e){return function(n,r){e(n,r,t)}}var Vn={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Yn(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 Hn={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Wn(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Hn[e]===t.length-1&&"achlmqstvz".includes(e)}))}function qn(t){return Wn(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Xn(t){return qn(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function zn(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Hn[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Hn[n]))),Hn[n]););}function Kn(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Jn(t){return t>=48&&57>=t||43===t||45===t||46===t}function Zn(t){return t>=48&&57>=t}function Qn(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),Zn(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Zn(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&Zn(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;Zn(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Zn(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&Zn(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function $n(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function tr(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Hn[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,$n(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Qn(t):Kn(t),t.err.length)return;t.data.push(t.param),$n(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,$n(t))}if(t.index>=t.max)break;if(!Jn(n.charCodeAt(t.index)))break}zn(t)}else zn(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var er=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function nr(t){if(qn(t))return Un(t);var e=function(t){if(Wn(t))return Un(t);var e=new er(t);for($n(e);e.max>e.index&&!e.err.length;)tr(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function rr(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var p=s[1];e.qx=s[0],e.qy=p}return u}function ir(t){if(Xn(t))return Un(t);for(var e=nr(t),n=Gn({},Vn),r=0;e.length>r;r+=1){e[r]=rr(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function or(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function ar(t,e,n,r,i,o,a,s,u,c){var l,h,f,p,d,v=t,y=e,g=n,m=r,T=s,E=u,b=120*Math.PI/180,x=Math.PI/180*(+i||0),w=[];if(c)h=c[0],f=c[1],p=c[2],d=c[3];else{y=(l=or(v,y,-x)).y;var S=((v=l.x)-(T=(l=or(T,E,-x)).x))/2,N=(y-(E=l.y))/2,M=S*S/(g*g)+N*N/(m*m);M>1&&(g*=M=Math.sqrt(M),m*=M);var k=g*g,P=m*m,_=(o===a?-1:1)*Math.sqrt(Math.abs((k*P-k*N*N-P*S*S)/(k*N*N+P*S*S)));p=_*g*N/m+(v+T)/2,d=_*-m*S/g+(y+E)/2,h=Math.asin(((y-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),f=Math.asin(((E-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),h=p>v?Math.PI-h:h,f=p>T?Math.PI-f:f,0>h&&(h=2*Math.PI+h),0>f&&(f=2*Math.PI+f),a&&h>f&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var C=f-h;if(Math.abs(C)>b){var A=f,O=T,I=E;f=h+b*(a&&f>h?1:-1),w=ar(T=p+g*Math.cos(f),E=d+m*Math.sin(f),g,m,i,0,a,O,I,[f,A,p,d])}C=f-h;var R=Math.cos(h),L=Math.sin(h),D=Math.cos(f),B=Math.sin(f),U=Math.tan(C/4),G=4/3*g*U,j=4/3*m*U,F=[v,y],V=[v+G*L,y-j*R],Y=[T+G*B,E-j*D],H=[T,E];if(V[0]=2*F[0]-V[0],V[1]=2*F[1]-V[1],c)return V.concat(Y,H,w);for(var W=[],q=0,X=(w=V.concat(Y,H,w)).length;X>q;q+=1)W[q]=q%2?or(w[q-1],w[q],x).y:or(w[q],w[q+1],x).x;return W}function sr(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ur(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function cr(t,e,n,r,i){var o=ur([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=sr([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function lr(t,e,n,r){var i=.5,o=[t,e],a=[n,r],s=sr(o,a,i),u=sr(a,s,i),c=sr(s,u,i),l=sr(u,c,i),h=sr(c,l,i),f=cr(o[0],o[1],s[0],s[1],c[0]).point,p=cr(h[0],h[1],l[0],l[1],u[0]).point;return[f.x,f.y,p.x,p.y,n,r]}function hr(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],f=l[1],p=e.x1,d=e.y1,v=e.x,y=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=f,t;case"A":return n=[p,d].concat(l),["C"].concat(ar(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[p,d].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(lr(p,d,h,f));case"Z":return p===v&&d===y?["C",p,d,v,y,v,y]:["C"].concat(lr(p,d,v,y))}return t}function fr(t,e){if(void 0===e&&(e=!1),function(t){return Xn(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=Un(t);return e?[n,[]]:n}for(var r,i,o=ir(t),a=Gn({},Vn),s=[],u="",c=o.length,l=[],h=0;c>h;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var f=hr(o[h],a);o[h]=f,Yn(o,s,h),c=o.length,"Z"===u&&l.push(h),a.x1=+(r=o[h])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,l]:o}function pr(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(0>n*o-r*i?-1:1)*Math.acos(a/s)}function dr(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,p=Math.sqrt,d=Math.PI,v=l(n),y=l(r),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===y)return cr(t,e,s,u,c).point;var m=(t-s)/2,T=(e-u)/2,E={x:f(g)*m+h(g)*T,y:-h(g)*m+f(g)*T},b=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(y,2);b>1&&(v*=p(b),y*=p(b));var x=(Math.pow(v,2)*Math.pow(y,2)-Math.pow(v,2)*Math.pow(E.y,2)-Math.pow(y,2)*Math.pow(E.x,2))/(Math.pow(v,2)*Math.pow(E.y,2)+Math.pow(y,2)*Math.pow(E.x,2)),w=(o!==a?1:-1)*p(x=0>x?0:x),S=w*(v*E.y/y),N=w*(-y*E.x/v),M=f(g)*S-h(g)*N+(t+s)/2,k=h(g)*S+f(g)*N+(e+u)/2,P={x:(E.x-S)/v,y:(E.y-N)/y},_=pr({x:1,y:0},P),C=pr(P,{x:(-E.x-S)/v,y:(-E.y-N)/y});!a&&C>0?C-=2*d:a&&0>C&&(C+=2*d);var A=_+(C%=2*d)*c,O=v*f(A),I=y*h(A);return{x:f(g)*O-h(g)*I+M,y:h(g)*O+f(g)*I+k}}function vr(t,e,n,r,i,o,a,s,u,c,l){var h,f=l.bbox,p=void 0===f||f,d=l.length,v=void 0===d||d,y=l.sampleSize,g=void 0===y?30:y,m="number"==typeof c,T=t,E=e,b=0,x=[T,E,b],w=[T,E],S={x:0,y:0},N=[{x:T,y:E}];m&&0>=c&&(S={x:T,y:E});for(var M=0;g>=M;M+=1){if(T=(h=dr(t,e,n,r,i,o,a,s,u,M/g)).x,E=h.y,p&&N.push({x:T,y:E}),v&&(b+=ur(w,[T,E])),w=[T,E],m&&b>=c&&c>x[2]){var k=(b-c)/(b-x[2]);S={x:w[0]*(1-k)+x[0]*k,y:w[1]*(1-k)+x[1]*k}}x=[T,E,b]}return m&&c>=b&&(S={x:s,y:u}),{length:b,point:S,min:{x:Math.min.apply(null,N.map((function(t){return t.x}))),y:Math.min.apply(null,N.map((function(t){return t.y})))},max:{x:Math.max.apply(null,N.map((function(t){return t.x}))),y:Math.max.apply(null,N.map((function(t){return t.y})))}}}function yr(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function gr(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,f=void 0===h||h,p=c.length,d=void 0===p||p,v=c.sampleSize,y=void 0===v?10:v,g="number"==typeof u,m=t,T=e,E=0,b=[m,T,E],x=[m,T],w={x:0,y:0},S=[{x:m,y:T}];g&&0>=u&&(w={x:m,y:T});for(var N=0;y>=N;N+=1){if(m=(l=yr(t,e,n,r,i,o,a,s,N/y)).x,T=l.y,f&&S.push({x:m,y:T}),d&&(E+=ur(x,[m,T])),x=[m,T],g&&E>=u&&u>b[2]){var M=(E-u)/(E-b[2]);w={x:x[0]*(1-M)+b[0]*M,y:x[1]*(1-M)+b[1]*M}}b=[m,T,E]}return g&&u>=E&&(w={x:a,y:s}),{length:E,point:w,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function mr(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Tr(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,p=s.sampleSize,d=void 0===p?10:p,v="number"==typeof a,y=t,g=e,m=0,T=[y,g,m],E=[y,g],b={x:0,y:0},x=[{x:y,y:g}];v&&0>=a&&(b={x:y,y:g});for(var w=0;d>=w;w+=1){if(y=(u=mr(t,e,n,r,i,o,w/d)).x,g=u.y,l&&x.push({x:y,y:g}),f&&(m+=ur(E,[y,g])),E=[y,g],v&&m>=a&&a>T[2]){var S=(m-a)/(m-T[2]);b={x:E[0]*(1-S)+T[0]*S,y:E[1]*(1-S)+T[1]*S}}T=[y,g,m]}return v&&a>=m&&(b={x:i,y:o}),{length:m,point:b,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function Er(t,e,n){for(var r,i,o,a,s,u,c,l,h,f=ir(t),p="number"==typeof e,d=[],v=0,y=0,g=0,m=0,T=[],E=[],b=0,x={x:0,y:0},w=x,S=x,N=x,M=0,k=0,P=f.length;P>k;k+=1)d=(c="M"===(l=(h=f[k])[0]))?d:[v,y].concat(h.slice(1)),c?(w=x={x:g=h[1],y:m=h[2]},b=0,p&&.001>e&&(N=x)):"L"===l?(b=(r=cr(d[0],d[1],d[2],d[3],(e||0)-M)).length,x=r.min,w=r.max,S=r.point):"A"===l?(b=(i=vr(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-M,n||{})).length,x=i.min,w=i.max,S=i.point):"C"===l?(b=(o=gr(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-M,n||{})).length,x=o.min,w=o.max,S=o.point):"Q"===l?(b=(a=Tr(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-M,n||{})).length,x=a.min,w=a.max,S=a.point):"Z"===l&&(b=(s=cr((d=[v,y,g,m])[0],d[1],d[2],d[3],(e||0)-M)).length,x=s.min,w=s.max,S=s.point),p&&e>M&&M+b>=e&&(N=S),E.push(w),T.push(x),M+=b,v=(u="Z"!==l?h.slice(-2):[g,m])[0],y=u[1];return p&&e>=M&&(N={x:v,y:y}),{length:M,point:N,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function br(t){return function(t){var e=0,n=0,r=0;return fr(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,f,p=t.slice(1);return r=3*(((f=p[5])-(a=n))*((s=p[0])+(c=p[2]))-((h=p[4])-(o=e))*((u=p[1])+(l=p[3]))+u*(o-c)-s*(a-l)+f*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function xr(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?gr(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length: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=sr(n,r,e),s=sr(r,i,e),u=sr(i,o,e),c=sr(a,s,e),l=sr(s,u,e),h=sr(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function wr(t,e,n){var r=xr(t),i=xr(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),f=[c,l],p=[h-o,h-a],d=0,v=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return p[e]-=(d=n&&p[e]&&t.l>=f[e])?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:wr(v[0],v[1],h)}var Sr={}.toString,Nr=function(t,e){return Sr.call(t)==="[object "+e+"]"},Mr=function(t){return null==t},kr=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},Pr=function(t){return Nr(t,"String")},_r=function(t,e,n){return e>t?e:t>n?n:t},Cr=function(t){return Nr(t,"Number")},Ar=function(t){return Nr(t,"Boolean")},Or=function(t){return void 0===t},Ir=function(t,e){if(!Nr(t,"Function"))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n},Rr=Ir((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}));function Lr(t){if(!t)throw new Error}function Dr(t,e){if(t===e)throw new Error}function Br(t){return"function"==typeof t}var Ur,Gr,jr={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign",values:{middle:"center"}},src:{alias:"img"}},Fr=Ir((function(t){var e=Rr(t),n=jr[e];return[e=(null==n?void 0:n.alias)||e,n]}));function Vr(t,e){var n,r=Fr(t),i=r[1];return[r[0],Pr(e)&&(null==i||null===(n=i.values)||void 0===n?void 0:n[e])||e]}!function(t){t.kAdd="+",t.kSubtract="-",t.kMultiply="*",t.kDivide="/",t.kMin="min",t.kMax="max",t.kClamp="clamp",t.kInvalid=""}(Ur||(Ur={})),function(t){t[t.kLength=0]="kLength",t[t.kAngle=1]="kAngle",t[t.kTime=2]="kTime",t[t.kFrequency=3]="kFrequency",t[t.kResolution=4]="kResolution",t[t.kFlex=5]="kFlex",t[t.kPercent=6]="kPercent",t[t.kNumBaseTypes=7]="kNumBaseTypes"}(Gr||(Gr={}));var Yr=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=Gr.kPercent,this.hasPercentHint=!1,this.exponents=new Array(Gr.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(function(e){switch(Dr(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kPixels:case t.UnitType.kRems:return Gr.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Gr.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Gr.kAngle;case t.UnitType.kPercentage:return Gr.kPercent;default:return Gr.kLength}}(e),n)}var n=e.prototype;return n.applyPercentHint=function(t){Dr(t,Gr.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(Gr.kPercent)),this.setExponent(Gr.kPercent,0),this.percentHint=t,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return Dr(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(t){return Dr(t,Gr.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(Gr.kPercent,1)},n.matchesBaseTypePercentage=function(t){return Dr(t,Gr.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(Gr.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(Gr.kPercent,1)},e.add=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint),function(t,e){if(t!==e)throw new Error}(t.percentHint,e.percentHint);for(var r=0;Gr.kNumBaseTypes>r;++r){var i=r;if(t.exponents[r]!==e.exponents[r]&&(i!==Gr.kPercent&&(t.applyPercentHint(i),e.applyPercentHint(i)),t.exponents[r]!==e.exponents[r]))return t}return t},e.multiply=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);for(var r=0;Gr.kNumBaseTypes>r;++r){var i=r;t.setExponent(i,t.exponent(i)+e.exponent(i))}return t},e}(),Hr=function(e){return"number"==typeof e?new Qr(e,t.UnitType.kNumber):e},Wr=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}fe(n,e);var r=n.prototype;return r.getType=function(){return me.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=qr(n);return i.every((function(e){return t.equals(e)}))},r.add=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);Xr(me.kSumType,r,this);var i=Kr(r,Ur.kAdd);return i||si.create(r)},r.sub=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);r=r.map((function(t){return t.negate()})),Xr(me.kSumType,r,this);var i=Kr(r,Ur.kAdd);return i||si.create(r)},r.mul=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);Xr(me.kProductType,r,this);var i=Jr(r);return i||ui.create(r)},r.div=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);r=r.map((function(t){return t.invert()})),Xr(me.kProductType,r,this);var i=Jr(r);return i||ui.create(r)},r.min=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);Xr(me.kMinType,r,this);var i=Kr(r,Ur.kMin);return i||oi.create(r)},r.max=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);Xr(me.kMaxType,r,this);var i=Kr(r,Ur.kMax);return i||ai.create(r)},r.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=zr(e[0]);return r?(n="string"==typeof t?be(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(be(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=ge(s);!(u=l()).done;){var h=u.value,f=zr(h);if(!f)return null;c.push(f)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var p=si.create(c);return Lr(!!p),p}for(var d=[],v=function(){var t=be(g[y]);Lr(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 Qr(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 si.create(d)},r.type=function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},e=this.type_.exponent(Gr.kLength);return e&&(t.length=e),(e=this.type_.exponent(Gr.kAngle))&&(t.angle=e),(e=this.type_.exponent(Gr.kTime))&&(t.time=e),(e=this.type_.exponent(Gr.kFrequency))&&(t.frequency=e),(e=this.type_.exponent(Gr.kResolution))&&(t.resolution=e),(e=this.type_.exponent(Gr.kFlex))&&(t.flex=e),(e=this.type_.exponent(Gr.kPercent))&&(t.percent=e),this.type_.hasPercentHint&&(t.percentHint=function(t){switch(t){case Gr.kLength:return"length";case Gr.kAngle:return"angle";case Gr.kTime:return"time";case Gr.kFrequency:return"frequency";case Gr.kResolution:return"resolution";case Gr.kFlex:return"flex";case Gr.kPercent:return"percent"}return""}(this.type_.percentHint)),t},n.isValidUnit=function(e){return!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e))},r.negate=function(){return ei.create(this)},r.invert=function(){return ti.create(this)},n}(Se);function qr(t){return t.map(Hr)}function Xr(t,e,n){Lr(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function zr(t){return 0===Object.keys(t.units).length?new Qr(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Qr(t.value,Number(Object.keys(t.units)[0])):null}function Kr(t,e){Lr(!!t.length);var n=t[0]instanceof Qr?t[0]:null;if(!n)return null;for(var r=n.value,i=1;t.length>i;i++){var o=t[i]instanceof Qr?t[i]:null;if(!o||o.unit!==n.unit)return null;e===Ur.kAdd?r+=o.value:e===Ur.kMax?r=Math.max(r,o.value):e===Ur.kMin&&(r=Math.min(r,o.value))}return new Qr(r,n.unit)}function Jr(e){Lr(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var o=e[i]instanceof Qr?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 Qr(r,n)}var Zr=function(e){return function(e){switch(e){case Rt.kUNumber:return t.UnitType.kNumber;case Rt.kULength:return t.UnitType.kPixels;case Rt.kUPercent:return t.UnitType.kPercentage;case Rt.kUTime:return t.UnitType.kSeconds;case Rt.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return Rt.kUNumber;case t.UnitType.kPercentage:return Rt.kUPercent;case t.UnitType.kPixels:return Rt.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Rt.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Rt.kUAngle;default:return Rt.kUOther}}(e))},Qr=function(e){function n(n,r){var i,o;return void 0===r&&(r=t.UnitType.kNumber),o="string"==typeof r?be(r):r,(i=e.call(this,new Yr(o))||this).unit=void 0,i.value=void 0,i.unit=o,i.value=n,i}fe(n,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=Zr(this.unit);if(r!==Zr(e)||r===t.UnitType.kUnknown)return null;var i=xe(this.unit)/xe(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 me.kUnitType},r.sumValue=function(){var e,n,r=[],i={};return this.unit!==t.UnitType.kNumber&&(i[(e=this.unit,n=Zr(e),n===t.UnitType.kUnknown?e:n)]=1),r.push({value:this.value*xe(this.unit),units:i}),r},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):ti.create(this)},r.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=we(this.unit);if(-999999>o||o>999999){var s=we(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(Lr(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e}(o,s):o+(s||"")}else i=""+o+a}return r+=i},n}(Wr),$r=function(t){function e(){return t.apply(this,arguments)||this}return fe(e,t),e.prototype.isUnitValue=function(){return!1},e}(Wr),ti=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="invert",r.value=e,r}fe(e,t),e.create=function(t){return new e(t,Yr.negateExponents(t.type_))};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return me.kInvertType},n.equals=function(t){return t.getType()===me.kInvertType&&this.value.equals(t.value)},n.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)},n.buildCSSText=function(t,e,n){return e==Bt.kNo&&(n+=t===Dt.kYes?"(":"calc("),n=this.value.buildCSSText(Dt.kYes,Bt.kNo,n+="1 / "),e===Bt.kNo&&(n+=")"),n},e}($r),ei=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="negate",r.value=e,r}fe(e,t),e.create=function(t){return new e(t,t.type_)};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return me.kNegateType},n.equals=function(t){return t.getType()===me.kNegateType&&this.value.equals(t.value)},n.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},n.buildCSSText=function(t,e,n){return e==Bt.kNo&&(n+=t===Dt.kYes?"(":"calc("),n=this.value.buildCSSText(Dt.kYes,Bt.kNo,n+="-"),e===Bt.kNo&&(n+=")"),n},e}($r);function ni(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 ri,ii=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).values=void 0,r.values=e,r}fe(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}($r),oi=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).operator="min",e}fe(e,t),e.create=function(t){return new e(t,ni(t,Yr.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return me.kMinType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=ge(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},n.buildCSSText=function(t,e,n){n+="min(";for(var r,i=!0,o=ge(this.numericValues());!(r=o()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(Dt.kYes,Bt.kYes,n)}return n+=")"},e}(ii),ai=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).operator="max",e}fe(e,t),e.create=function(t){return new e(t,ni(t,Yr.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return me.kMaxType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=ge(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},n.buildCSSText=function(t,e,n){n+="max(";for(var r,i=!0,o=ge(this.numericValues());!(r=o()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(Dt.kYes,Bt.kYes,n)}return n+=")"},e}(ii),si=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).operator="sum",e}fe(e,t),e.create=function(t){return new e(t,ni(t,Yr.add))},e.numericTypeFromUnitMap=function(t){var e=new Yr;return Object.keys(t).forEach((function(n){var r=t[n];e=Yr.multiply(e,new Yr(Number(n),r),false),Lr(!0)})),e},e.canCreateNumericTypeFromSumValue=function(t){var e=this;Lr(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return Yr.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return me.kSumType},n.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(he({},e)):t[n].value+=e.value}))})),e.canCreateNumericTypeFromSumValue(t)?t:null},n.buildCSSText=function(t,e,n){e==Bt.kNo&&(n+=t===Dt.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(Dt.kYes,Bt.kNo,n);for(var i=1;r.length>i;i++){var o=r[i];n=o.getType()===me.kNegateType?o.value.buildCSSText(Dt.kYes,Bt.kNo,n+=" - "):o.buildCSSText(Dt.kYes,Bt.kNo,n+=" + ")}return e===Bt.kNo&&(n+=")"),n},e}(ii),ui=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).operator="product",e}fe(e,t),e.create=function(t){return new e(t,ni(t,Yr.multiply))},e.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){Dr(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 n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return me.kProductType},n.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(n){var r=n.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(n){i.push({value:t.value*n.value,units:e.multiplyUnitMaps(t.units,n.units)})}))})),t=i})),t},n.buildCSSText=function(t,e,n){e==Bt.kNo&&(n+=t===Dt.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(Dt.kYes,Bt.kNo,n);for(var i=1;r.length>i;i++){var o=r[i];n=o.getType()===me.kInvertType?o.value.buildCSSText(Dt.kYes,Bt.kNo,n+=" / "):o.buildCSSText(Dt.kYes,Bt.kNo,n+=" * ")}return e===Bt.kNo&&(n+=")"),n},e}(ii),ci=new Qr(0,"px"),li=new Qr(0,"deg"),hi=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}fe(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}(Ne);(ri=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",ri.COLOR="<color>",ri.PAINT="<paint>",ri.NUMBER="<number>",ri.ANGLE="<angle>",ri.OPACITY_VALUE="<opacity-value>",ri.SHADOW_BLUR="<shadow-blur>",ri.LENGTH="<length>",ri.PERCENTAGE="<percentage>",ri.LENGTH_PERCENTAGE="<length> | <percentage>",ri.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",ri.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",ri.LIST_OF_POINTS="<list-of-points>",ri.PATH="<path>",ri.FILTER="<filter>",ri.Z_INDEX="<z-index>",ri.OFFSET_PATH="<offset-path>",ri.OFFSET_DISTANCE="<offset-distance>",ri.CLIP_PATH="<clip-path>",ri.MARKER="<marker>",ri.TRANSFORM="<transform>",ri.TRANSFORM_ORIGIN="<transform-origin>",ri.TEXT="<text>",ri.TEXT_TRANSFORM="<text-transform>";var fi=t.Syringe.defineToken(""),pi=t.Syringe.defineToken(""),di={number:function(t){return new Qr(t)},percent:function(t){return new Qr(t,"%")},px:function(t){return new Qr(t,"px")},em:function(t){return new Qr(t,"em")},rem:function(t){return new Qr(t,"rem")},deg:function(t){return new Qr(t,"deg")},grad:function(t){return new Qr(t,"grad")},rad:function(t){return new Qr(t,"rad")},turn:function(t){return new Qr(t,"turn")},s:function(t){return new Qr(t,"s")},ms:function(t){return new Qr(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;jt.get(fi).registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},registerLayout:function(t,e){jt.get(pi).registerLayout(t,e)}},vi=t.Syringe.defineToken(""),yi=t.Syringe.defineToken(""),gi=new ke("unset"),mi=new ke("initial"),Ti=new ke("inherit"),Ei={"":gi,unset:gi,initial:mi,inherit:Ti},bi=function(t){return Ei[t]||(Ei[t]=new ke(t)),Ei[t]},xi=new hi(0,0,0,0,!0),wi=new hi(0,0,0,0),Si=Ir((function(t,e,n,r){return new hi(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),Ni=Ir((function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Qr(e,n)}),(function(e,n){return void 0===n&&(n=t.UnitType.kNumber),""+e+n}));function Mi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ki(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pi(){}var _i=.7,Ci=1/_i,Ai="\\s*([+-]?\\d+)\\s*",Oi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ii="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ri=/^#([0-9a-f]{3,8})$/,Li=new RegExp("^rgb\\("+[Ai,Ai,Ai]+"\\)$"),Di=new RegExp("^rgb\\("+[Ii,Ii,Ii]+"\\)$"),Bi=new RegExp("^rgba\\("+[Ai,Ai,Ai,Oi]+"\\)$"),Ui=new RegExp("^rgba\\("+[Ii,Ii,Ii,Oi]+"\\)$"),Gi=new RegExp("^hsl\\("+[Oi,Ii,Ii]+"\\)$"),ji=new RegExp("^hsla\\("+[Oi,Ii,Ii,Oi]+"\\)$"),Fi={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 Vi(){return this.rgb().formatHex()}function Yi(){return this.rgb().formatRgb()}function Hi(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ri.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Wi(e):3===n?new zi(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?qi(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?qi(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=Li.exec(t))?new zi(e[1],e[2],e[3],1):(e=Di.exec(t))?new zi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Bi.exec(t))?qi(e[1],e[2],e[3],e[4]):(e=Ui.exec(t))?qi(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Gi.exec(t))?Qi(e[1],e[2]/100,e[3]/100,1):(e=ji.exec(t))?Qi(e[1],e[2]/100,e[3]/100,e[4]):Fi.hasOwnProperty(t)?Wi(Fi[t]):"transparent"===t?new zi(NaN,NaN,NaN,0):null}function Wi(t){return new zi(t>>16&255,t>>8&255,255&t,1)}function qi(t,e,n,r){return r>0||(t=e=n=NaN),new zi(t,e,n,r)}function Xi(t){return t instanceof Pi||(t=Hi(t)),t?new zi((t=t.rgb()).r,t.g,t.b,t.opacity):new zi}function zi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ki(){return"#"+Zi(this.r)+Zi(this.g)+Zi(this.b)}function Ji(){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 Zi(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Qi(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new to(t,e,n,r)}function $i(t){if(t instanceof to)return new to(t.h,t.s,t.l,t.opacity);if(t instanceof Pi||(t=Hi(t)),!t)return new to;if(t instanceof to)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 to(a,s,u,t.opacity)}function to(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function eo(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Mi(Pi,Hi,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Vi,formatHex:Vi,formatHsl:function(){return $i(this).formatHsl()},formatRgb:Yi,toString:Yi}),Mi(zi,(function(t,e,n,r){return 1===arguments.length?Xi(t):new zi(t,e,n,null==r?1:r)}),ki(Pi,{brighter:function(t){return t=null==t?Ci:Math.pow(Ci,t),new zi(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?_i:Math.pow(_i,t),new zi(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:Ki,formatHex:Ki,formatRgb:Ji,toString:Ji})),Mi(to,(function(t,e,n,r){return 1===arguments.length?$i(t):new to(t,e,n,null==r?1:r)}),ki(Pi,{brighter:function(t){return t=null==t?Ci:Math.pow(Ci,t),new to(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?_i:Math.pow(_i,t),new to(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 zi(eo(240>t?t+120:t-240,i,r),eo(t,i,r),eo(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 no={},ro=0;var io="undefined"!=typeof window&&void 0!==window.document;function oo(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 ao(t){var e=t;do{var n;if(null===(n=e.style)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function so(t,e){if(io)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var uo="Method not implemented.",co="Use document.documentElement instead.",lo={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function ho(t){return void 0===t?0:t>360||-360>t?t%360:t}function fo(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Cr(t)?on(t,e,n):Array.isArray(t)&&3===t.length?(r=t,(i=new _e(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):on(t[0],t[1]||e,t[2]||n);var r,i}function po(t){return t*(Math.PI/180)}function vo(t){return t*(180/Math.PI)}function yo(t){return 360*t}function go(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=qe(nn(),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 mo(t,e,n,r,i){var o,a,s,u,c,l,h,f,p,d,v=Math.cos(t),y=Math.sin(t);return o=r*v,a=i*y,s=0,u=-r*y,c=i*v,l=0,h=e,f=n,p=1,(d=new _e(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=f,d[8]=p,d}function To(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=vo(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Eo=Ae(),bo=Ae(),xo=Tn(),wo=[nn(),nn(),nn()],So=nn();function No(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}function Mo(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var ko,Po=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,p=/^\)/,d=/^,/,v=/^\#([0-9a-fA-F]+)/,y=/^([a-zA-Z]+)/,g=/^rgb/i,m=/^rgba/i,T=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function b(t){throw new Error(E+": "+t)}function x(){var t=O(w);return E.length>0&&b("Invalid input not EOF"),t}function w(){return S("linear-gradient",t,M)||S("repeating-linear-gradient",e,M)||S("radial-gradient",n,k)||S("repeating-radial-gradient",r,k)||S("conic-gradient",i,k)}function S(t,e,n){return N(e,(function(e){var r=n();return r&&(U(d)||b("Missing comma before color stops")),{type:t,orientation:r,colorStops:O(I)}}))}function N(t,e){var n=U(t);if(n){U(f)||b("Missing (");var r=e(n);return U(p)||b("Missing )"),r}}function M(){return B("directional",o,1)||B("angular",h,1)}function k(){var t,e,n=P();return n&&((t=[]).push(n),e=E,U(d)&&((n=P())?t.push(n):E=e)),t}function P(){var t=function(){var t=B("shape",/^(circle)/i,0);t&&(t.style=D()||_());return t}()||function(){var t=B("shape",/^(ellipse)/i,0);t&&(t.style=L()||_());return t}();if(t)t.at=C();else{var e=_();if(e){t=e;var n=C();n&&(t.at=n)}else{var r=A();r&&(t={type:"default-radial",at:r})}}return t}function _(){return B("extent-keyword",a,1)}function C(){if(B("position",/^at/,0)){var t=A();return t||b("Missing positioning value"),t}}function A(){var t={x:L(),y:L()};if(t.x||t.y)return{type:"position",value:t}}function O(t){var e=t(),n=[];if(e)for(n.push(e);U(d);)(e=t())?n.push(e):b("One extra comma");return n}function I(){var t=B("hex",v,1)||N(m,(function(){return{type:"rgba",value:O(R)}}))||N(g,(function(){return{type:"rgb",value:O(R)}}))||B("literal",y,0);return t||b("Expected color definition"),t.length=L(),t}function R(){return U(T)[1]}function L(){return B("%",c,1)||B("position-keyword",s,1)||D()}function D(){return B("px",u,1)||B("em",l,1)}function B(t,e,n){var r=U(e);if(r)return{type:t,value:r[n]}}function U(t){var e=/^[\n\r\t\s]+/.exec(E);e&&G(e[0].length);var n=t.exec(E);return n&&G(n[0].length),n}function G(t){E=E.substring(t)}return function(t){return E=t,x()}}();(ko=t.Shape||(t.Shape={})).GROUP="g",ko.CIRCLE="circle",ko.ELLIPSE="ellipse",ko.IMAGE="image",ko.RECT="rect",ko.LINE="line",ko.POLYLINE="polyline",ko.POLYGON="polygon",ko.TEXT="text",ko.PATH="path",ko.HTML="html",ko.MESH="mesh";var _o=t.Syringe.defineToken(""),Co=t.Syringe.defineToken(""),Ao=t.Syringe.defineToken("");function Oo(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Er(t.parsedStyle.path.absolutePath,void 0,Gn(Gn({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Io(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 Ro=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)},Do=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},Bo=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=Ro,this.call=Ro,this._callAsync=Lo,this.callAsync=Lo,this._promise=Do,this.promise=Do,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=ge(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}(),Uo=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=ge(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,f=0,p=function(t){var i=t;h!==o&&("sync"!==e.options.taps[i].type||f++>20)&&(f=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var a=h,p=function(t){return t?"":o()},d=e.callTap(i,{onError:function(t){return n(i,t,a,p)},onResult:r&&function(t){return r(i,t,a,p)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)p(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}(),Go=function(t){function e(){return t.apply(this,arguments)||this}return fe(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}(Uo),jo=new Go,Fo=function(t){return jo.setup(this,t),jo.create(t)},Vo=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=Fo,r._call=void 0,r.call=void 0,r}return fe(e,t),e}(Bo),Yo=function(t){function e(){return t.apply(this,arguments)||this}return fe(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}(Uo),Ho=new Yo,Wo=function(t){return Ho.setup(this,t),Ho.create(t)},qo=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=Wo,r._call=void 0,r.call=void 0,r}return fe(e,t),e}(Bo),Xo=function(t){function e(){return t.apply(this,arguments)||this}return fe(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}(Uo),zo=new Xo,Ko=function(){throw new Error("tapAsync is not supported on a SyncHook")},Jo=function(){throw new Error("tapPromise is not supported on a SyncHook")},Zo=function(t){return zo.setup(this,t),zo.create(t)},Qo=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=Jo,r.compile=Zo,r}return fe(e,t),e}(Bo),$o=function(t){function e(){return t.apply(this,arguments)||this}return fe(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}(Uo),ta=new $o,ea=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},na=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},ra=function(t){return ta.setup(this,t),ta.create(t)},ia=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=ea,r.tapPromise=na,r.compile=ra,r}return fe(e,t),e}(Qo),oa=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];var aa=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,sa=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ua=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ca=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var la={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},ha=Ir((function(t){var e;return e="angular"===t.type?Number(t.value):la[t.value]||0,Ni(e,"deg")})),fa=Ir((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Ni(e,r),cy:Ni(n,i)}})),pa=Ir((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Po(e).map((function(e){var n=e.type,r=e.orientation,i=e.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;r>a;a++){var s,u=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!Mr(u)&&!Mr(o)){for(var c=1;a-i>c;c++)t[i+c].length={type:"%",value:""+(o+(Number(u)-o)*c/(a-i))};i=a,o=Number(u)}}}(i);var o=i.map((function(t){return{offset:Ni(t.length.value,"%"),color:Mo(t)}}));if("linear-gradient"===n)return new Me(t.GradientType.LinearGradient,{angle:r?ha(r):li,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a,s=fa(r[0].at),u=s.cx,c=s.cy;if(r[0].style){var l=r[0].style,h=l.type,f=l.value;a="extent-keyword"===h?bi(f):Ni(f,h)}return new Me(t.GradientType.RadialGradient,{cx:u,cy:c,size:a,steps:o})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=aa.exec(e);if(r){var i,o=(null===(i=r[2].match(ca))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Me(t.GradientType.LinearGradient,{angle:Ni(parseFloat(r[1]),"deg"),steps:o.map((function(t){var e=t[1];return{offset:Ni(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var a=function(t){var e=sa.exec(t);if(e){var n,r=(null===(n=e[4].match(ca))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Ni(50,"%"),cy:Ni(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:Ni(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(a){if(!Pr(a))return[new Me(t.GradientType.RadialGradient,a)];e=a}}else if("p"===n)return function(t){var e=ua.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{image:r,repetition:n}}return null}(e)}));function da(t){return kr(t)&&!!t.image}var va=Ir((function(t){if(da(t))return he({repetition:"repeat"},t);if(Mr(t)&&(t=""),"transparent"===t)return wi;"currentColor"===t&&(t="black");var e=pa(t);if(e)return e;var n=Hi(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Si.apply(void 0,r)}));function ya(t,e){if(t instanceof hi&&e instanceof hi)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(_r(e[n],0,255));return e[3]=_r(e[3],0,1),"rgba("+e.join(",")+")"}]}var ga,ma=function(){function t(t,e){this.center=nn(),this.halfExtents=nn(),this.min=nn(),this.max=nn(),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){t&&an(this.center,t),e&&an(this.halfExtents,e||on(0,0,0)),this.min=gn(this.min,this.center,this.halfExtents),this.max=un(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){un(this.center,e,t),ln(this.center,this.center,.5),gn(this.halfExtents,e,t),ln(this.halfExtents,this.halfExtents,.5),an(this.min,t),an(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,f=i-u,p=i+u,d=o-c,v=o+c,y=e.center,g=y[0],m=y[1],T=y[2],E=e.halfExtents,b=E[0],x=E[1],w=E[2],S=g-b,N=g+b,M=m-x,k=m+x,P=T-w,_=T+w;l>S&&(l=S),N>h&&(h=N),f>M&&(f=M),k>p&&(p=k),d>P&&(d=P),_>v&&(v=_),n[0]=.5*(l+h),n[1]=.5*(f+p),n[2]=.5*(d+v),a[0]=.5*(h-l),a[1]=.5*(p-f),a[2]=.5*(v-d),this.min[0]=l,this.min[1]=f,this.min[2]=d,this.max[0]=h,this.max[1]=p,this.max[2]=v}},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],f=e[2],p=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),E=Math.abs(h),b=Math.abs(f),x=Math.abs(p),w=Math.abs(d);sn(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]+f*i[0]+p*i[1]+d*i[2]),sn(r,v*o[0]+y*o[1]+g*o[2],m*o[0]+T*o[1]+E*o[2],b*o[0]+x*o[1]+w*o[2]),this.min=gn(this.min,n,r),this.max=un(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=nn(),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}(nn(),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?an(nn(),this.min):272===t.pnVertexFlag?on(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?on(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?on(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?on(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?on(this.max[0],this.min[1],this.max[2]):on(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?an(nn(),this.max):272===t.pnVertexFlag?on(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?on(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?on(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?on(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?on(this.min[0],this.max[1],this.min[2]):on(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),Ta=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||on(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 fn(t,this.normal)-this.distance},e.normalize=function(){var t=1/mn(this.normal);ln(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&&function(t,e,n,r){var i=e[0],o=e[1],a=e[2];t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a)}(n,t,e,i),o},t}();(ga=t.Mask||(t.Mask={}))[ga.OUTSIDE=4294967295]="OUTSIDE",ga[ga.INSIDE=0]="INSIDE",ga[ga.INDETERMINATE=2147483647]="INDETERMINATE";var Ea=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Ta)}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],f=t[11],p=t[12],d=t[13],v=t[14],y=t[15];sn(this.planes[0].normal,i-e,u-o,f-c),this.planes[0].distance=y-p,sn(this.planes[1].normal,i+e,u+o,f+c),this.planes[1].distance=y+p,sn(this.planes[2].normal,i+n,u+a,f+l),this.planes[2].distance=y+d,sn(this.planes[3].normal,i-n,u-a,f-l),this.planes[3].distance=y-d,sn(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=y-v,sn(this.planes[5].normal,i+r,u+s,f+h),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),ba=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}(),xa=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 wa(t,e){if(Mr(e))return Ni(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Ni(Number(e),"px");if("deg".search(t)>=0)return Ni(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 Ni(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var Sa=Ir((function(t){return wa(new RegExp("px","g"),t)})),Na=(Ir((function(t){return wa(new RegExp("%","g"),t)})),Ir((function(t){return Cr(t)||isFinite(Number(t))?Ni(Number(t),"px"):wa(new RegExp("px|%|em|rem","g"),t)}))),Ma=Ir((function(t){return wa(new RegExp("deg|rad|grad|turn","g"),t)}));function ka(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=Zr(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=we(t.unit)):(Qr.isLength(t.unit)||Qr.isLength(e.unit))&&(a=Ca(t,i,n),s=Ca(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Pa(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=vo(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=yo(Number(e.value))),n}function _a(t){return Pr(t)?t.split(" ").map((function(t){return Na(t)})):t.map((function(t){return Na(t.toString())}))}function Ca(e,n,r){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds(),o=0;return ma.isEmpty(i)||(o=2*i.halfExtents[n]),Number(e.value)/100*o}return 0}var Aa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Oa(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,Aa.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return wa(/deg|rad|grad|turn|px|%/g,t)||va(t)}))}),n.lastIndex===t.length)return r}return[]}function Ia(t){return t.toString()}var Ra=Ir((function(t){return"number"==typeof t?Ni(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ni(Number(t)):Ni(0)}));Ir((function(t){return Pr(t)?t.split(" ").map(Ra):t.map(Ra)}));function La(t,e){return[t,e,Ia]}function Da(t,e){return function(n,r){return[n,r,function(n){return Ia(_r(n,t,e))}]}}function Ba(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var Ua=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,zCommandIndexes:[],rect:{x:0,y:0,width:0,height:0}};var e;try{e=ir(t)}catch(n){e=ir(""),console.error("[g]: Invalid SVG Path definition: "+t)}var n=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}(e),r=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]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=fr(e,!0),s=a[0],u=a[1],c=function(t){for(var e,n,r=[],i=null,o=null,a=0,s=t.length,u=0;s>u;u++){var c=t[u];o=t[u+1];var l=c[0],h={command:l,prePoint:i,params:c,startTangent:null,endTangent:null};"M"===l&&(a=u);var f=c.length;h.currentPoint=i=[c[f-2],c[f-1]],r[a]&&(e=i)[0]===(n=r[a].currentPoint)[0]&&e[1]===n[1]&&(r[a].prePoint=h.prePoint),h.nextPoint=o?[o[o.length-2],o[o.length-1]]:null;var p=h.prePoint;if("C"===l){var d=[c[1],c[2]],v=[c[3],c[4]];h.startTangent=[p[0]-d[0],p[1]-d[1]],h.endTangent=[i[0]-v[0],i[1]-v[1]],0===h.startTangent[0]&&0===h.startTangent[1]&&(h.startTangent=[d[0]-v[0],d[1]-v[1]]),0===h.endTangent[0]&&0===h.endTangent[1]&&(h.endTangent=[v[0]-d[0],v[1]-d[1]])}r.push(h)}return r}(s),l=function(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var n=Er(t,void 0,Gn(Gn({},e),{length:!1})),r=n.min,i=r.x,o=r.y,a=n.max,s=a.x,u=a.y,c=s-i,l=u-o;return{width:c,height:l,x:i,y:o,x2:s,y2:u,cx:i+c/2,cy:o+l/2,cz:Math.max(c,l)+Math.min(c,l)/2}}(e),h=l.x,f=l.y,p=l.width,d=l.height;return{absolutePath:e,hasArc:n,segments:c,polygons:i,polylines:o,curve:s,totalLength:0,zCommandIndexes:u,rect:{x:Number.isFinite(h)?h:0,y:Number.isFinite(f)?f:0,width:Number.isFinite(p)?p:0,height:Number.isFinite(d)?d:0}}},Ga=Ir(Ua);function ja(t,e){var n=Pr(t)?Ga(t):Ua(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Fa(t,e,n){var r=t.curve,i=e.curve,o=[r,i];r.length!==i.length&&(o=wr(r,i));var a,s,u,c,l,h,f,p,d=br(o[0])!==br(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):Un(o[0]);return[d,(u=o[1],c=d,l=u.length-1,h=[],f=0,p=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])}))}))}(u),p.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=ur(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=f,f=0})),p[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Va(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Ya(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 Ha={box:function(t,e,n,r){return Ya([t,n],[e,r])},length:function(t,e,n,r){return Va(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?Va(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?Va(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)}};var Wa=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+=Va(r[0],r[1],i[0],i[1])}return e}(t)};function qa(t,e){var n;n=Pr(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=Wa(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Ha.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 Xa=null;function za(t){return function(e){var n=0;return t.map((function(t){return t===Xa?e[n++]:t}))}}function Ka(t){return t}var Ja={matrix:["NNNNNN",[Xa,Xa,0,0,Xa,Xa,0,0,0,0,1,0,Xa,Xa,0,1],Ka],matrix3d:["NNNNNNNNNNNNNNNN",Ka],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",za([Xa,Xa,di.number(1)]),Ka],scalex:["N",za([Xa,di.number(1),di.number(1)]),za([Xa,di.number(1)])],scaley:["N",za([di.number(1),Xa,di.number(1)]),za([di.number(1),Xa])],scalez:["N",za([di.number(1),di.number(1),Xa])],scale3d:["NNN",Ka],skew:["Aa",null,Ka],skewx:["A",null,za([Xa,li])],skewy:["A",null,za([li,Xa])],translate:["Tt",za([Xa,Xa,ci]),Ka],translatex:["T",za([Xa,ci,ci]),za([Xa,ci])],translatey:["T",za([ci,Xa,ci]),za([ci,Xa])],translatez:["L",za([ci,ci,Xa])],translate3d:["TTL",Ka]};function Za(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=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],f=u[l],p=void 0;if(void 0===(p=h?{A:function(t){return"0"===t.trim()?li:Ma(t)},N:Ra,T:Na,L:Sa}[f.toUpperCase()](h):{a:li,n:c[0],t:ci}[f]))return[];c.push(p)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Qa(t){var e,n,r,i;switch(t.t){case"rotatex":return i=po(Pa(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=po(Pa(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=po(Pa(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=po(Pa(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var l=po(Pa(t.d[0])),h=po(Pa(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=po(Pa(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=po(Pa(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ca(t.d[0],0,null)||0,n=Ca(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ca(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Ca(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Ca(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ca(t.d[0],0,null)||0,n=Ca(t.d[1],0,null)||0,r=Ca(t.d[2],0,null)||0,1];case"perspective":var f=Ca(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function $a(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function ts(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Eo,t))return!1;if(Oe(bo,Eo),bo[3]=0,bo[7]=0,bo[11]=0,bo[15]=1,1e-8>Math.abs(Be(bo)))return!1;var a,s,u=Eo[3],c=Eo[7],l=Eo[11],h=Eo[12],f=Eo[13],p=Eo[14],d=Eo[15];if(0!==u||0!==c||0!==l){if(xo[0]=u,xo[1]=c,xo[2]=l,xo[3]=d,!De(bo,bo))return!1;Le(bo,bo),En(i,xo,bo)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=p,(a=wo)[0][0]=(s=Eo)[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=rn(wo[0]),hn(wo[0],wo[0]),r[0]=fn(wo[0],wo[1]),No(wo[1],wo[1],wo[0],1,-r[0]),n[1]=rn(wo[1]),hn(wo[1],wo[1]),r[0]/=n[1],r[1]=fn(wo[0],wo[2]),No(wo[2],wo[2],wo[0],1,-r[1]),r[2]=fn(wo[1],wo[2]),No(wo[2],wo[2],wo[1],1,-r[2]),n[2]=rn(wo[2]),hn(wo[2],wo[2]),r[1]/=n[2],r[2]/=n[2],pn(So,wo[1],wo[2]),0>fn(wo[0],So))for(var v=0;3>v;v++)n[v]*=-1,wo[v][0]*=-1,wo[v][1]*=-1,wo[v][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+wo[0][0]-wo[1][1]-wo[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-wo[0][0]+wo[1][1]-wo[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-wo[0][0]-wo[1][1]+wo[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+wo[0][0]+wo[1][1]+wo[2][2],0)),wo[2][1]>wo[1][2]&&(o[0]=-o[0]),wo[0][2]>wo[2][0]&&(o[1]=-o[1]),wo[1][0]>wo[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Qa).reduce($a)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var es=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(var u=0;3>u;u++)for(var c=0;3>c;c++)a[3][u]+=e[c]*a[c][u];var l=i[0],h=i[1],f=i[2],p=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(h*h+f*f),d[0][1]=2*(l*h-f*p),d[0][2]=2*(l*f+h*p),d[1][0]=2*(l*h+f*p),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(h*f-l*p),d[2][0]=2*(l*f-h*p),d[2][1]=2*(h*f+l*p),d[2][2]=1-2*(l*l+h*h),a=t(a,d);var v,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y));for(var g=0;3>g;g++)for(var m=0;3>m;m++)a[g][m]*=n[g];return 0==(v=a)[0][2]&&0==v[0][3]&&0==v[1][2]&&0==v[1][3]&&0==v[2][0]&&0==v[2][1]&&1==v[2][2]&&0==v[2][3]&&0==v[3][2]&&1==v[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function ns(t){return t.toFixed(6).replace(".000000","")}function rs(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=ts(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=ts(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=_r(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return es(t[0],t[1],t[2],e,t[4]).map(ns).join(",")}])}function is(t){return t.replace(/[xy]/,"")}function os(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function as(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?Ni(a):Ni(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length){var h=rs(t,e);u=[h[0]],c=[h[1]],l=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var p=t[f].t,d=e[f].t,v=t[f].d,y=e[f].d,g=Ja[p],m=Ja[d],T=void 0;if(s=d,"perspective"===(a=p)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var E=rs([t[f]],[e[f]]);u.push(E[0]),c.push(E[1]),l.push(["matrix",[E[2]]])}else{if(p===d)T=p;else if(g[2]&&m[2]&&is(p)===is(d))T=is(p),v=g[2](v),y=m[2](y);else{if(!g[1]||!m[1]||os(p)!==os(d)){var b=rs(t,e);u=[b[0]],c=[b[1]],l=[["matrix",[b[2]]]];break}T=os(p),v=g[1](v),y=m[1](y)}for(var x=[],w=[],S=[],N=0;v.length>N;N++){var M=ka(v[N],y[N],n,!1,N);x[N]=M[0],w[N]=M[1],S.push(M[2])}u.push(x),c.push(w),l.push([T,S])}}if(r){var k=u;u=c,c=k}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var ss=Ir((function(t){if(Pr(t)){if("text-anchor"===t)return[Ni(0,"px"),Ni(0,"px")];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:[Na(us(e[0])),Na(us(e[1]))]}return[Ni(t[0]||0,"px"),Ni(t[1]||0,"px")]}));function us(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var cs=function(){function t(){this.parser=Ma,this.mixer=La}return t.prototype.calculator=function(t,e,n,r){return Pa(n)},t}();cs=jn([ct({token:{token:yi,named:t.PropertySyntax.ANGLE}})],cs);var ls=t.Syringe.defineToken(""),hs=t.Syringe.defineToken("");t.CircleUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),t.CircleUpdater=jn([ct({token:{token:hs,named:t.Shape.CIRCLE}})],t.CircleUpdater),t.EllipseUpdater=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),t.EllipseUpdater=jn([ct({token:{token:hs,named:t.Shape.ELLIPSE}})],t.EllipseUpdater),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,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),t.LineUpdater=jn([ct({token:{token:hs,named:t.Shape.LINE}})],t.LineUpdater),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=jn([ct({token:{token:hs,named:t.Shape.PATH}})],t.PathUpdater),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=jn([ct({token:[{token:hs,named:t.Shape.POLYLINE},{token:hs,named:t.Shape.POLYGON}]})],t.PolylineUpdater),t.RectUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!Pr(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),t.RectUpdater=jn([ct({token:[{token:hs,named:t.Shape.RECT},{token:hs,named:t.Shape.IMAGE},{token:hs,named:t.Shape.GROUP}]})],t.RectUpdater),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=jn([ct()],t.OffscreenCanvasCreator);var fs={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]},ps=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ds=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),vs=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source);t.TextService=function(){function t(t){var e=this;this.offscreenCanvas=void 0,this.cache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!vs.exec(n)&&!ds.exec(t))},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},this.offscreenCanvas=t}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=fs.MetricsString+fs.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(fs.BaselineSymbol).width),u=fs.HeightMultiplier*s;s=s*fs.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,f=0,p=0,d=!1;for(f=0;s>f;++f){for(var v=0;h>v;v+=4)if(255!==c[p+v]){d=!0;break}if(d)break;p+=h}for(n.ascent=s-f,p=l-h,d=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==c[p+y]){d=!0;break}if(d)break;p-=h}return n.descent=f-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=e.lineWidth,s=e.textBaseline,u=e.textAlign,c=e.letterSpacing,l=e.leading,h=void 0===l?0:l,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Cr(e)&&e+"px"||"16px",s=Pr(n)?n.split(","):[n],u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&0>oa.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}(e),p=this.measureFont(f,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var d=this.offscreenCanvas.getOrCreateContext(n);d.font=f,e.isOverflowing=!1;for(var v=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(v.length),g=0,m=0;v.length>m;m++){var T=d.measureText(v[m]).width+(v[m].length-1)*c;y[m]=T,g=Math.max(g,T)}var E=g+a,b=o||p.fontSize+a,x=Math.max(b,p.fontSize+a)+(v.length-1)*(b+h),w=0;return"middle"===s?w=-x/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-x:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:E,height:x,lines:v,lineWidths:y,lineHeight:b+=h,maxLineWidth:g,fontProperties:p,lineMetrics:y.map((function(t,e){var n=0;return"center"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new xa(n-a/2,w+e*b,t+a,b)}))}},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,c=e.textOverflow,l=this.offscreenCanvas.getOrCreateContext(n),h=o+a,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);for(var p=[],d=0,v=0,y={},g=function(t){return r.getFromCache(t,a,y,l)},m=Array.from(f).reduce((function(t,e){return t+g(e)}),0),T=Array.from(t),E=0;T.length>E;E++){var b=T[E],x=t[E-1],w=t[E+1],S=g(b);if(this.isNewline(b))v=0,p[++d]="";else{if(v>0&&v+S>h){if(d+1>=u){if(e.isOverflowing=!0,m>0&&h>=m){for(var N=0,M=0,k=0;p[d].length>k;k++){var P=g(p[d][k]);if(N+P+m>h){M=k;break}N+=P}p[d]=(p[d]||"").slice(0,M)+f}break}if(v=0,p[++d]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(p=this.trimToBreakable(p),v=this.sumTextWidthByCache(p[d]||"",y)),this.shouldBreakByKinsokuShorui(b,w)&&(p=this.trimByKinsokuShorui(p),v+=g(x||""))}v+=S,p[d]=(p[d]||"")+b}}return p.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&fs.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&fs.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||!ps.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(!ps.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}(),t.TextService=jn([ct(),Fn(0,lt(t.OffscreenCanvasCreator))],t.TextService),t.TextUpdater=function(){function t(t){this.textService=void 0,this.textService=t}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&&!Mr(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 f=[h.width/2,h.height/2,0],p=[0,1],d=0;"center"===o?(d=a/2,p=[.5,1]):"right"!==o&&"end"!==o||(d=a,p=[1,1]);var v=0;return"middle"===s?v=f[1]:"top"===s||"hanging"===s?v=2*f[1]:"alphabetic"===s?v=h.lineHeight-h.fontProperties.ascent:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(d+=u),c&&(v+=c),t.anchor=[p[0],p[1],0],{width:2*f[0],height:2*f[1],offsetX:d,offsetY:v}},t}(),t.TextUpdater=jn([ct({token:{token:hs,named:t.Shape.TEXT}}),Fn(0,lt(t.TextService))],t.TextUpdater);var ys=t.Syringe.defineToken("",{multiple:!1}),gs=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 f,p=l.length;for(c=0;p>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(f=1,u=new Array(h-1);h>f;f++)u[f-1]=arguments[f];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})),ms=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,Ws),this.define(t.Shape.ELLIPSE,Ks),this.define(t.Shape.RECT,hu),this.define(t.Shape.IMAGE,eu),this.define(t.Shape.LINE,ru),this.define(t.Shape.GROUP,Zs),this.define(t.Shape.PATH,ou),this.define(t.Shape.POLYGON,su),this.define(t.Shape.POLYLINE,cu),this.define(t.Shape.TEXT,pu),this.define(t.Shape.HTML,$s)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),Ts=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 ba,this.page=new ba,this.canvas=new ba,this.viewport=new ba,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(){},e.clone=function(){throw new Error(uo)},le(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}(),Es=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(ve(r),n),r}return fe(e,t),e}(Ts),bs=function(){function t(){this.emitter=new gs.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=Ar(n)&&n||kr(n)&&n.capture,i=kr(n)&&n.once,o=Br(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=Br(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=Ar(n)&&n||kr(n)&&n.capture,o=Br(e)?void 0:e;return t=i?t+"capture":t,e=Br(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 Es(t,e))},e.dispatchEvent=function(t){if(!(t instanceof Ts))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var e;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var n;e=null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView}if(e){var r;if(t.manager=e.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],t.target=this,null===(r=t.manager)||void 0===r||r.dispatchEvent(t)}return!t.defaultPrevented},t}(),xs=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}fe(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(uo)},r.lookupNamespaceURI=function(t){throw new Error(uo)},r.lookupPrefix=function(t){throw new Error(uo)},r.normalize=function(){throw new Error(uo)},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],f=s[c+l];if(f!==h){var p=h.parentNode.childNodes;return p.indexOf(h)<p.indexOf(f)?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)}))},le(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=ge(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)})),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}(bs);xs.DOCUMENT_POSITION_DISCONNECTED=1,xs.DOCUMENT_POSITION_PRECEDING=2,xs.DOCUMENT_POSITION_FOLLOWING=4,xs.DOCUMENT_POSITION_CONTAINS=8,xs.DOCUMENT_POSITION_CONTAINED_BY=16,xs.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ws,Ss=function(e){function n(){var n;(n=e.call(this)||this).defaultView=null,n.documentElement=void 0,n.timeline=void 0,n.ownerDocument=null,n.nodeName="document";try{n.timeline=jt.get(Co),n.timeline.attach(ve(n))}catch(t){}var r={};return Xu.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=Br(n)?n(t.Shape.GROUP):n)})),n.documentElement=new Zs({id:"g-root",style:r}),n.documentElement.ownerDocument=ve(n),n.documentElement.parentNode=ve(n),n.childNodes=[n.documentElement],n}fe(n,e);var r=n.prototype;return r.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?pu:Zs);var r=new n(e);return r.ownerDocument=this,r},r.createElementNS=function(t,e,n){return this.createElement(e,n)},r.cloneNode=function(t){throw new Error(uo)},r.destroy=function(){try{this.documentElement.destroy(),this.timeline.destroy()}catch(t){}},r.elementsFromBBox=function(e,n,r,i){var o=this.defaultView.getRBushRoot().search({minX:e,minY:n,maxX:r,maxY:i}),a=jt.get(t.DisplayObjectPool),s=[];return o.forEach((function(t){var e=a.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&s.push(e)})),s.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),s},r.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},r.elementFromPoint=function(){var t=ue(ae().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return ae().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",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},r.elementsFromPoint=function(){var t=ue(ae().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return ae().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(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.appendChild=function(t,e){throw new Error(co)},r.insertBefore=function(t,e){throw new Error(co)},r.removeChild=function(t,e){throw new Error(co)},r.replaceChild=function(t,e,n){throw new Error(co)},r.append=function(){throw new Error(co)},r.prepend=function(){throw new Error(co)},r.getElementById=function(t){return this.documentElement.getElementById(t)},r.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},r.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},r.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},r.querySelector=function(t){return this.documentElement.querySelector(t)},r.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},r.find=function(t){return this.documentElement.find(t)},r.findAll=function(t){return this.documentElement.findAll(t)},le(n,[{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}}]),n}(xs);(ws=t.Strategy||(t.Strategy={}))[ws.Standard=0]="Standard";var Ns,Ms=t.Syringe.defineToken(""),ks=t.Syringe.defineToken("");(Ns=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",Ns.ATTR_MODIFIED="DOMAttrModified",Ns.INSERTED="DOMNodeInserted",Ns.CHILD_INSERTED="child-inserted",Ns.REMOVED="removed",Ns.CHILD_REMOVED="child-removed",Ns.MOUNTED="DOMNodeInsertedIntoDocument",Ns.UNMOUNTED="DOMNodeRemovedFromDocument",Ns.BOUNDS_CHANGED="bounds-changed",Ns.RENDER_ORDER_CHANGED="render-order-changed",Ns.CULLED="culled";var Ps=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 fe(e,t),e}(Ts);Ps.ADDITION=2,Ps.MODIFICATION=1,Ps.REMOVAL=3;var _s=0;var Cs,As=new Es(t.ElementEvent.CHILD_INSERTED,{child:null}),Os=new Ps(t.ElementEvent.INSERTED,null,"","","",0,"",""),Is=new Ps(t.ElementEvent.REMOVED,null,"","","",0,"",""),Rs=new Es(t.ElementEvent.DESTROY),Ls=new Es(t.ElementEvent.CHILD_REMOVED,{child:null}),Ds=function(e){function n(){for(var n,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];return(n=e.call.apply(e,[this].concat(i))||this).sceneGraphService=jt.get(ks),n.entity=_s++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:on(0,0,0),localRotation:In(0,0,0,1),localScale:on(1,1,1),localTransform:Ae(),localSkew:Bn(0,0),position:on(0,0,0),rotation:In(0,0,0,1),scaling:on(1,1,1),worldTransform:Ae(),origin:on(0,0,0)},n.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.id=void 0,n.name=void 0,n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle={anchor:gi,opacity:gi,fillOpacity:gi,strokeOpacity:gi,fill:gi,stroke:gi,transform:gi,transformOrigin:gi,visibility:gi,pointerEvents:gi,lineWidth:gi,lineCap:gi,lineJoin:gi,increasedLineWidthForHitTesting:gi,fontSize:gi,fontFamily:gi,fontStyle:gi,fontWeight:gi,fontVariant:gi,textAlign:gi,textBaseline:gi,textTransform:gi,zIndex:gi,filter:gi,shadowType:gi},n.parsedStyle={},n.attributes={},n}fe(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw new Error(uo)},r.appendChild=function(t,e){return this.sceneGraphService.attach(t,this,e),As.detail.child=t,this.dispatchEvent(As),Os.relatedNode=this,t.dispatchEvent(Os),t},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){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},r.removeChild=function(t){return Is.relatedNode=this,t.dispatchEvent(Is),Ls.detail.child=t,this.dispatchEvent(Ls),this.sceneGraphService.detach(t),t},r.removeChildren=function(){var t=this;this.childNodes.slice().forEach((function(e){t.removeChild(e),e.destroy()}))},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(){return this.parentNode?this.parentNode.removeChild(this):this},r.destroy=function(){this.dispatchEvent(Rs),this.remove(),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=this.attributes[t];if(void 0===e){var n=Vr(t.toString(),"");e=this.attributes[n[0]]}return Mr(e)?null:e},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(uo)},r.getAttributeNode=function(t){throw new Error(uo)},r.getAttributeNodeNS=function(t,e){throw new Error(uo)},r.hasAttributeNS=function(t,e){throw new Error(uo)},r.removeAttributeNS=function(t,e){throw new Error(uo)},r.removeAttributeNode=function(t){throw new Error(uo)},r.setAttributeNS=function(t,e,n){throw new Error(uo)},r.setAttributeNode=function(t){throw new Error(uo)},r.setAttributeNodeNS=function(t){throw new Error(uo)},r.toggleAttribute=function(t,e){throw new Error(uo)},le(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}(xs),Bs=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 ba,e.movement=new ba,e.offset=new ba,e.global=new ba,e.screen=new ba,e}fe(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(uo)},le(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}(Ts),Us=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}fe(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!")},n.clone=function(){return this.manager.clonePointerEvent(this)},e}(Bs),Gs=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 fe(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Bs),js={},Fs=[];t.DisplayObjectPool=function(){function e(){}var n=e.prototype;return n.getByEntity=function(t){return js[t]},n.getAll=function(){return Object.keys(js).map((function(t){return js[t]}))},n.add=function(e,n){js[e]=n,n.nodeName===t.Shape.HTML&&Fs.push(n)},n.remove=function(e){var n=js[e];if(n&&(delete js[e],n.nodeName===t.Shape.HTML)){var r=Fs.indexOf(n);Fs.splice(r,1)}},n.getHTMLs=function(){return Fs},e}(),t.DisplayObjectPool=jn([ct()],t.DisplayObjectPool);var Vs,Ys=function(e){function n(n){var r,i;return(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.activeAnimations=[],i.displayObjectPool=jt.get(t.DisplayObjectPool),i.styleValueRegistry=jt.get(fi),i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=he({},i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,{anchor:[0,0],fill:xi,stroke:xi,transform:[],zIndex:0,filter:[],shadowType:"outer"},i.config.initialParsedStyle),Object.assign(i.attributes,{anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""}),i.initAttributes(i.config.style),i.style=new Proxy({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}}),i.displayObjectPool.add(i.entity,ve(i)),i}fe(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),this.displayObjectPool.remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var r=he({},this.attributes);for(var i in r){var o=r[i];o instanceof n&&(r[i]=o.cloneNode(t)),e&&(r[i]=e(i,o))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;this.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0,usedAttributes:["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]}),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Vr(t,n),o=i[0],a=i[1];Or(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.parsedStyle.clipPathTargets&&this.parsedStyle.clipPathTargets.length&&this.parsedStyle.clipPathTargets.forEach((function(e){o.sceneGraphService.dirtifyToRoot(e),e.dispatchEvent(new Ps(t.ElementEvent.ATTR_MODIFIED,e,o,o,"clipPath",Ps.MODIFICATION,o,o)),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback("clipPath",o,o)})),a.dirty=!0;var c=this.parsedStyle[e];this.isConnected&&(Cs||(Cs=new Ps(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Ps.MODIFICATION,null,null)),Cs.relatedNode=this,Cs.prevValue=s,Cs.newValue=n,Cs.attrName=e,Cs.prevParsedValue=u,Cs.newParsedValue=c,this.dispatchEvent(Cs)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(e,s,n,u,c)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new xa(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,fo(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,fo(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,fo(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,fo(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,fo(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=fo(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=fo(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=go(nn(),this.sceneGraphService.getWorldTransform(this));return vo(t[2])},r.getLocalEulerAngles=function(){var t=go(nn(),this.sceneGraphService.getLocalRotation(this));return vo(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 Mr(e)&&Mr(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return Mr(e)&&Mr(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.setLocalSkew=function(t,e){return this.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return this.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return this.sceneGraphService.getLocalSkew(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.parsedStyle.clipPathTargets&&this.parsedStyle.clipPathTargets.length&&(i=null===(r=this.parsedStyle.clipPathTargets[0].ownerDocument)||void 0===r?void 0:r.timeline);return i?i.play(this,t,e):null},r.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},r.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},r.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},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.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?kr(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.getMatrix=function(t){var e=t||this.getWorldTransform(),n=We(nn(),e),r=n[0],i=n[1],o=qe(nn(),e),a=o[0],s=o[1],u=Xe(bn(),e),c=go(nn(),u);return mo(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=To(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=To(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},r.show=function(){this.style.visibility="visible"},r.hide=function(){this.style.visibility="hidden"},le(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(Ds),Hs=["style"],Ws=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,Hs);return e.call(this,he({type:t.Shape.CIRCLE,style:he({cx:"",cy:"",r:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))||this}return fe(n,e),n}(Ys),qs=["style"],Xs=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=de(r,qs);return(n=t.call(this,he({style:he({x:"",y:""},i)},o))||this).isCustomElement=!0,n}return fe(e,t),e}(Ys),zs=["style"],Ks=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,zs);return e.call(this,he({type:t.Shape.ELLIPSE,style:he({cx:"",cy:"",rx:"",ry:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))||this}return fe(n,e),n}(Ys),Js=["style"],Zs=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,Js);return e.call(this,he({type:t.Shape.GROUP,style:he({x:"",y:"",width:"",height:""},i)},o))||this}return fe(n,e),n}(Ys),Qs=["style"],$s=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=de(i,Qs);return(r=e.call(this,he({type:t.Shape.HTML,style:he({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,r}fe(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 ma;return a.setMinMax(on(i,o,0),on(i+n.width,o+n.height,0)),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=De(Ae(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!ma.isEmpty(e)){var n=new ma;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(Ys),tu=["style"],eu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,tu);return e.call(this,he({type:t.Shape.IMAGE,style:he({x:"",y:"",img:"",width:"",height:""},i)},o))||this}return fe(n,e),n}(Ys),nu=["style"],ru=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=de(i,nu);(r=e.call(this,he({type:t.Shape.LINE,style:he({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0;var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&u instanceof Ys&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&c instanceof Ys&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}fe(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Ys&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&r instanceof Ys&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=function(t){var e=this.parsedStyle,n=e.x1,r=e.x2,i=e.y1,o=e.y2,a=e.defX,s=e.defY,u=t?e.markerStart:e.markerEnd;if(u&&u instanceof Ys){var c,l,h,f,p,d,v;t?(f=n-a,p=i-s,l=r-n,h=o-i,d=e.markerStartOffset||0,v=this.markerStartAngle):(f=r-a,p=o-s,l=n-r,h=i-o,d=e.markerEndOffset||0,v=this.markerEndAngle),c=Math.atan2(h,l),u.setLocalEulerAngles(180*c/Math.PI+v),u.setLocalPosition(f+Math.cos(c)*d,p+Math.sin(c)*d)}},r.getPoint=function(t){var e=this.parsedStyle,n=e.defX,r=e.defY,i=Ha.pointAt(e.x1,e.y1,e.x2,e.y2,t),o=i.x,a=i.y,s=dn(nn(),on(o-n,a-r,0),this.getLocalTransform());return new ba(s[0],s[1])},r.getPointAtLength=function(t){return this.getPoint(t/this.getTotalLength())},r.getTotalLength=function(){var t=this.parsedStyle;return Ha.length(t.x1,t.y1,t.x2,t.y2)},n}(Ys),iu=["style"],ou=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=de(i,iu);(r=e.call(this,he({type:t.Shape.PATH,style:he({path:"",miterLimit:""},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof Ys&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof Ys&&r.placeMarkerMid(l),c&&c instanceof Ys&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}fe(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Ys&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof Ys&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&a instanceof Ys){var s,u,c,l,h,f,p;if(t){var d=this.getStartTangent(),v=d[0],y=d[1];l=y[0]-i,h=y[1]-o,u=v[0]-y[0],c=v[1]-y[1],f=n||0,p=this.markerStartAngle}else{var g=this.getEndTangent(),m=g[0],T=g[1];l=T[0]-i,h=T[1]-o,u=m[0]-T[0],c=m[1]-T[1],f=r||0,p=this.markerEndAngle}s=Math.atan2(c,u),a.setLocalEulerAngles(180*s/Math.PI+p),a.setLocalPosition(l+Math.cos(s)*f,h+Math.sin(s)*f)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&t instanceof Ys)for(var o=1;n.length-1>o;o++){var a=n[o].currentPoint,s=a[0],u=a[1],c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return Oo(this)},r.getPointAtLength=function(t){var e=this.parsedStyle,n=e.defX,r=e.defY,i=function(t,e,n){return Er(t,e,Gn(Gn({},n),{bbox:!1,length:!0})).point}(e.path.absolutePath,t),o=i.x,a=i.y,s=dn(nn(),on(o-n,a-r,0),this.getLocalTransform());return new ba(s[0],s[1])},r.getPoint=function(t){return this.getPointAtLength(t*Oo(this))},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}(Ys),au=["style"],su=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=de(i,au);(r=e.call(this,he({type:t.Shape.POLYGON,style:he({points:"",miterLimit:"",isClosed:!0},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof Ys&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof Ys&&r.placeMarkerMid(l),c&&c instanceof Ys&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}fe(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Ys&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof Ys&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY,o=t?e.markerStart:e.markerEnd;if(o&&o instanceof Ys){var a,s,u,c,l,h,f;if(c=n[0][0]-r,l=n[0][1]-i,t)s=n[1][0]-n[0][0],u=n[1][1]-n[0][1],h=e.markerStartOffset||0,f=this.markerStartAngle;else{var p=n.length;this.style.isClosed?(s=n[p-1][0]-n[0][0],u=n[p-1][1]-n[0][1]):(c=n[p-1][0]-r,l=n[p-1][1]-i,s=n[p-2][0]-n[p-1][0],u=n[p-2][1]-n[p-1][1]),h=e.markerEndOffset||0,f=this.markerEndAngle}a=Math.atan2(u,s),o.setLocalEulerAngles(180*a/Math.PI+f),o.setLocalPosition(c+Math.cos(a)*h,l+Math.sin(a)*h)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&t instanceof Ys)for(var o=1;(this.style.isClosed?n.length:n.length-1)>o;o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},n}(Ys),uu=["style"],cu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,uu);return e.call(this,he({type:t.Shape.POLYLINE,style:he({points:"",miterLimit:"",isClosed:!1},i)},o))||this}fe(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPointAtLength=function(t){return this.getPoint(t/this.getTotalLength())},r.getPoint=function(t){var e=this.parsedStyle,n=e.defX,r=e.defY,i=e.points,o=i.points,a=0,s=0;i.segments.forEach((function(e,n){e[0]>t||t>e[1]||(a=(t-e[0])/(e[1]-e[0]),s=n)}));var u=Ha.pointAt(o[s][0],o[s][1],o[s+1][0],o[s+1][1],a),c=u.x,l=u.y,h=dn(nn(),on(c-n,l-r,0),this.getLocalTransform());return new ba(h[0],h[1])},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}(su),lu=["style"],hu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,lu);return e.call(this,he({type:t.Shape.RECT,style:he({x:"",y:"",width:"",height:"",radius:""},i)},o))||this}return fe(n,e),n}(Ys),fu=["style"],pu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,fu);return e.call(this,he({type:t.Shape.TEXT,style:he({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},i)},o))||this}fe(n,e);var r=n.prototype;return r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},r.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},n}(Ys);(Vs=t.RenderReason||(t.RenderReason={}))[Vs.CAMERA_CHANGED=0]="CAMERA_CHANGED",Vs[Vs.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Vs[Vs.NONE=2]="NONE";var du=t.Syringe.defineToken("");t.EventService=function(){function t(t,e,n,r){var i=this;this.renderingContext=void 0,this.contextService=void 0,this.canvasConfig=void 0,this.displayObjectPool=void 0,this.rootTarget=void 0,this.emitter=new gs.EventEmitter,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=Ae(),this.tmpVec3=nn(),this.onPointerDown=function(){var t=ue(ae().mark((function t(e){var n;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,i.createPointerEvent(e);case 4:i.dispatchEvent(n=t.sent,"pointerdown"),"touch"===n.pointerType?i.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||i.dispatchEvent(n,2===n.button?"rightdown":"mousedown"),i.trackingData(e.pointerId).pressTargetsByButton[e.button]=n.composedPath(),i.freeEvent(n);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUp=function(){var t=ue(ae().mark((function t(e){var n,r,o,a,s,u,c,l,h;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return n=performance.now(),t.next=5,i.createPointerEvent(e);case 5:if(i.dispatchEvent(r=t.sent,"pointerup"),"touch"===r.pointerType?i.dispatchEvent(r,"touchend"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||i.dispatchEvent(r,2===r.button?"rightup":"mouseup"),o=i.trackingData(e.pointerId),a=i.findMountedTarget(o.pressTargetsByButton[e.button]),s=a,a&&!r.composedPath().includes(a)){for(u=a;u&&!r.composedPath().includes(u);)r.currentTarget=u,i.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?i.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||i.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),xs.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[e.button],s=u}s&&((l=i.clonePointerEvent(r,"click")).target=s,l.path=[],o.clicksByButton[e.button]||(o.clicksByButton[e.button]={clickCount:0,target:l.target,timeStamp:n}),(h=o.clicksByButton[e.button]).target===l.target&&200>n-h.timeStamp?++h.clickCount:h.clickCount=1,h.target=l.target,h.timeStamp=n,l.detail=h.clickCount,(null===(c=r.detail)||void 0===c?void 0:c.preventClick)||("mouse"!==l.pointerType&&"touch"!==l.pointerType||i.dispatchEvent(l,"click"),i.dispatchEvent(l,"pointertap")),i.freeEvent(l)),i.freeEvent(r);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerMove=function(){var t=ue(ae().mark((function t(e){var n,r,o,a,s,u,c,l,h,f;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,i.createPointerEvent(e);case 4:if(r="mouse"===(n=t.sent).pointerType||"pen"===n.pointerType,o=i.trackingData(e.pointerId),a=i.findMountedTarget(o.overTargets),!o.overTargets||a===n.target){t.next=23;break}return s="mousemove"===e.type?"mouseout":"pointerout",t.next=12,i.createPointerEvent(e,s,a||void 0);case 12:if(i.dispatchEvent(u=t.sent,"pointerout"),r&&i.dispatchEvent(u,"mouseout"),n.composedPath().includes(a)){t.next=22;break}return t.next=18,i.createPointerEvent(e,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!n.composedPath().includes(c.target);)c.currentTarget=c.target,i.notifyTarget(c),r&&i.notifyTarget(c,"mouseleave"),xs.isNode(c.target)&&(c.target=c.target.parentNode);i.freeEvent(c);case 22:i.freeEvent(u);case 23:if(a===n.target){t.next=38;break}l=i.clonePointerEvent(n,"mousemove"===e.type?"mouseover":"pointerover"),i.dispatchEvent(l,"pointerover"),r&&i.dispatchEvent(l,"mouseover"),h=a&&xs.isNode(a)&&a.parentNode;case 29:if(!h||h===(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode)){t.next=35;break}if(h!==n.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode)){for((f=i.clonePointerEvent(n,"pointerenter")).eventPhase=f.AT_TARGET;f.target&&f.target!==a&&f.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)f.currentTarget=f.target,i.notifyTarget(f),r&&i.notifyTarget(f,"mouseenter"),xs.isNode(f.target)&&(f.target=f.target.parentNode);i.freeEvent(f)}i.freeEvent(l);case 38:i.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&i.dispatchEvent(n,"touchmove"),r&&(i.dispatchEvent(n,"mousemove"),i.cursor=i.getCursor(n.target)),o.overTargets=n.composedPath(),i.freeEvent(n);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOut=function(){var t=ue(ae().mark((function t(e){var n,r,o,a,s;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:if(!(n=i.trackingData(e.pointerId)).overTargets){t.next=19;break}return r="mouse"===e.pointerType||"pen"===e.pointerType,o=i.findMountedTarget(n.overTargets),t.next=8,i.createPointerEvent(e,"pointerout",o||void 0);case 8:return i.dispatchEvent(a=t.sent),r&&i.dispatchEvent(a,"mouseout"),t.next=13,i.createPointerEvent(e,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)s.currentTarget=s.target,i.notifyTarget(s),r&&i.notifyTarget(s,"mouseleave"),xs.isNode(s.target)&&(s.target=s.target.parentNode);n.overTargets=null,i.freeEvent(a),i.freeEvent(s);case 19:i.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOver=function(){var t=ue(ae().mark((function t(e){var n,r,o,a;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return n=i.trackingData(e.pointerId),t.next=5,i.createPointerEvent(e);case 5:for(o="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,i.dispatchEvent(r,"pointerover"),o&&i.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(i.cursor=i.getCursor(r.target)),(a=i.clonePointerEvent(r,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)a.currentTarget=a.target,i.notifyTarget(a),o&&i.notifyTarget(a,"mouseenter"),xs.isNode(a.target)&&(a.target=a.target.parentNode);n.overTargets=r.composedPath(),i.freeEvent(r),i.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var t=ue(ae().mark((function t(e){var n,r,o,a;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return n=i.trackingData(e.pointerId),r=i.findMountedTarget(n.pressTargetsByButton[e.button]),t.next=6,i.createPointerEvent(e);case 6:if(o=t.sent,r){for(a=r;a;)o.currentTarget=a,i.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||i.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),xs.isNode(a)&&(a=a.parentNode);delete n.pressTargetsByButton[e.button]}i.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onWheel=function(){var t=ue(ae().mark((function t(e){var n;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Gs){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,i.createWheelEvent(e);case 4:i.dispatchEvent(n=t.sent),i.freeEvent(n);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.renderingContext=t,this.contextService=e,this.canvasConfig=n,this.displayObjectPool=r}var e=t.prototype;return e.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)},e.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new ba(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new ba(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.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=Ue(this.tmpMatrix,u,s),l=sn(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return dn(l,l,c),new ba(l[0],l[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=Ue(this.tmpMatrix,n,r),o=sn(this.tmpVec3,t.x,t.y,0);dn(this.tmpVec3,this.tmpVec3,i);var a=this.canvasConfig;return new ba((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},e.setPickHandler=function(t){this.pickHandler=t},e.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}))},e.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)}},e.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emitter.emit(e||t.type,t)},e.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}}},e.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++)xs.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=function(){var t=ue(ae().mark((function t(e){var n,r,i,o,a;return ae().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)}}(),e.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},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=ge(this.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},e.pickTarget=function(){var t=ue(ae().mark((function t(e){return ae().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)}}(),e.createPointerEvent=function(){var t=ue(ae().mark((function t(e,n,r){var i,o;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(Us),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)}}(),e.createWheelEvent=function(){var t=ue(ae().mark((function t(e){var n,r;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Gs),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)}}(),e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(Gs);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=e.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(Us);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},e.copyPointerData=function(t,e){t instanceof Us&&e instanceof Us&&(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)},e.copyMouseData=function(t,e){t instanceof Bs&&e instanceof Bs&&(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))},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.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)},e.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},e.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)},e.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)},e.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)},e.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||xs.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=Ds.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=xs.isNode(e)&&e.parentNode}},t}(),t.EventService=jn([ct(),Fn(0,lt(du)),Fn(1,lt(ys)),Fn(2,lt(_o)),Fn(3,lt(t.DisplayObjectPool))],t.EventService);var vu,yu,gu,mu=t.Syringe.defineToken(""),Tu=t.Syringe.defineToken("",{multiple:!1});(vu=t.CameraType||(t.CameraType={}))[vu.ORBITING=0]="ORBITING",vu[vu.EXPLORING=1]="EXPLORING",vu[vu.TRACKING=2]="TRACKING",(yu=t.CameraTrackingMode||(t.CameraTrackingMode={}))[yu.DEFAULT=0]="DEFAULT",yu[yu.ROTATIONAL=1]="ROTATIONAL",yu[yu.TRANSLATIONAL=2]="TRANSLATIONAL",yu[yu.CINEMATIC=3]="CINEMATIC",(gu=t.CameraProjectionMode||(t.CameraProjectionMode={}))[gu.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",gu[gu.PERSPECTIVE=1]="PERSPECTIVE";var Eu={UPDATED:"updated"},bu=2e-4;t.Camera=function(){function e(){this.canvas=void 0,this.eventEmitter=new gs.EventEmitter,this.matrix=Ae(),this.right=on(1,0,0),this.up=on(0,1,0),this.forward=on(0,0,1),this.position=on(0,0,1),this.focalPoint=on(0,0,0),this.distanceVector=on(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=Ae(),this.projectionMatrixInverse=Ae(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new Ea,this.orthoMatrix=Ae()}var n=e.prototype;return n.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},n.getProjectionMode=function(){return this.projectionMode},n.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},n.getPerspectiveInverse=function(){return this.projectionMatrixInverse},n.getFrustum=function(){return this.frustum},n.getPosition=function(){return this.position},n.getFocalPoint=function(){return this.focalPoint},n.getDollyingStep=function(){return this.dollyingStep},n.getNear=function(){return this.near},n.getFar=function(){return this.far},n.getZoom=function(){return this.zoom},n.getOrthoMatrix=function(){return this.orthoMatrix},n.getView=function(){return this.view},n.setEnableUpdate=function(t){this.enableUpdate=t},n.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},n.setProjectionMode=function(t){return this.projectionMode=t,this},n.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},n.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},n.getViewTransform=function(){return De(Ae(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=Ye(Ae(),[t,e,0]);this.jitteredProjectionMatrix=Ue(Ae(),n,this.projectionMatrix)},n.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},n.setMatrix=function(t){return this.matrix=t,this._update(),this},n.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},n.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},n.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},n.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},n.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},n.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},n.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},n.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(po(.5*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 function(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);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}(this.projectionMatrix,c,c+u,a,a-s,e,this.far),je(this.projectionMatrix,this.projectionMatrix,on(1,-1,1)),De(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},n.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,f=l-u,p=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;p=(f+=y*this.view.offsetX)+y*this.view.width,v=(d-=g*this.view.offsetY)-g*this.view.height}return Qe(this.projectionMatrix,f,p,v,d,o,a),je(this.projectionMatrix,this.projectionMatrix,on(1,-1,1)),De(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},n.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=fo(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},n.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=on(0,1,0);if(this.focalPoint=fo(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=cn(nn(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=rn(o),s=vo(Math.asin(n/a)),u=90+vo(Math.atan2(r,e)),c=Ae();Ve(c,c,po(u)),Fe(c,c,po(s)),i=dn(nn(),[0,1,0],c)}return De(this.matrix,$e(Ae(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},n.getDistance=function(){return this.distance},n.getDistanceVector=function(){return this.distanceVector},n.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,bu>this.distance&&(this.distance=bu),this.dollyingStep=this.distance/100;var e=nn(),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},n.setMaxDistance=function(t){return this.maxDistance=t,this},n.setMinDistance=function(t){return this.minDistance=t,this},n.setAzimuth=function(e){return this.azimuth=ho(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},n.getAzimuth=function(){return this.azimuth},n.setElevation=function(e){return this.elevation=ho(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},n.getElevation=function(){return this.elevation},n.setRoll=function(e){return this.roll=ho(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},n.getRoll=function(){return this.roll},n._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},n.computeMatrix=function(){var e=xn(bn(),[0,0,1],po(this.roll));Re(this.matrix);var n=xn(bn(),[1,0,0],po((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=xn(bn(),[0,1,0],po((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=wn(bn(),r,n);i=wn(bn(),i,e);var o=Ke(Ae(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(Ge(this.matrix,this.matrix,this.focalPoint),Ue(this.matrix,this.matrix,o),Ge(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(Ge(this.matrix,this.matrix,this.position),Ue(this.matrix,this.matrix,o))},n._setPosition=function(t,e,n){this.position=fo(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()},n._getAxes=function(){an(this.right,fo(En(Tn(),[1,0,0,0],this.matrix))),an(this.up,fo(En(Tn(),[0,1,0,0],this.matrix))),an(this.forward,fo(En(Tn(),[0,0,1,0],this.matrix))),hn(this.right,this.right),hn(this.up,this.up),hn(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=rn(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=vo(Math.asin(n/i)),this.azimuth=vo(Math.atan2(-e,-r))):(this.elevation=-vo(Math.asin(n/i)),this.azimuth=-vo(Math.atan2(-e,-r)))},n._getPosition=function(){an(this.position,fo(En(Tn(),[0,0,0,1],this.matrix))),this._getDistance()},n._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=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)),un(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=cn(nn(),this.focalPoint,this.position),this.distance=rn(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=xn(bn(),[0,0,1],-this.roll*Math.PI/180);ze(this.orthoMatrix,n,on((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),on(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=Ue(Ae(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Eu.UPDATED)}},n.rotate=function(t,e,n){throw new Error(uo)},n.pan=function(t,e){throw new Error(uo)},n.dolly=function(t){throw new Error(uo)},n.createLandmark=function(t,e){throw new Error(uo)},n.gotoLandmark=function(t,e){throw new Error(uo)},e}(),t.Camera=jn([ut({token:Tu})],t.Camera);var xu=t.Syringe.defineToken("");t.RenderingService=function(){function e(e,n,r,i,o,a){this.renderingPluginProvider=void 0,this.canvasConfig=void 0,this.renderingContext=void 0,this.sceneGraphService=void 0,this.styleValueRegistry=void 0,this.camera=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new Es(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new Vo,dirtycheck:new ia(["object"]),cull:new ia(["object","camera"]),beginFrame:new Qo([]),beforeRender:new Qo(["objectToRender"]),render:new Qo(["objectToRender"]),afterRender:new Qo(["objectToRender"]),endFrame:new Qo([]),destroy:new Qo([]),pick:new qo(["result"]),pickSync:new ia(["result"]),pointerDown:new Qo(["event"]),pointerUp:new Qo(["event"]),pointerMove:new Qo(["event"]),pointerOut:new Qo(["event"]),pointerOver:new Qo(["event"]),pointerWheel:new Qo(["event"]),pointerCancel:new Qo(["event"])},this.renderingPluginProvider=e,this.canvasConfig=n,this.renderingContext=r,this.sceneGraphService=i,this.styleValueRegistry=o,this.camera=a}var n=e.prototype;return n.init=function(){var t=ue(ae().mark((function t(){var e=this;return ae().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.disableDirtyRectangleRendering=function(){return!this.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering||this.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},n.render=function(t){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.sceneGraphService.triggerPendingEvents(),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root,t),this.hooks.beginFrame.call(),this.renderingContext.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),this.renderingContext.renderListCurrentFrame=[],this.renderingContext.renderReasons.clear())},n.renderDisplayObject=function(t,e){var n=this,r=e.renderer.getConfig(),i=r.enableDirtyCheck,o=r.enableCulling;this.styleValueRegistry.recalc(t);var a=i?this.hooks.dirtycheck.call(t):t;if(a){var s=o?this.hooks.cull.call(a,this.camera):a;s&&(this.stats.rendered++,this.renderingContext.renderListCurrentFrame.push(s))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var u=t.sortable,c=!1;u.dirty&&(u.sorted=t.childNodes.slice().sort(oo),c=!0,u.dirty=!1),(u.sorted||t.childNodes).forEach((function(t){n.renderDisplayObject(t,e)})),c&&t.forEach((function(t){n.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.dispatchEvent(n.renderOrderChangedEvent)}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),t.RenderingService=jn([ct(),Fn(0,Ft(xu)),Fn(1,lt(_o)),Fn(2,lt(du)),Fn(3,lt(ks)),Fn(4,lt(fi)),Fn(5,lt(mu))],t.RenderingService);var wu=t.Syringe.defineToken(""),Su=t.Syringe.defineToken("",{multiple:!1}),Nu=/\[\s*(.*)=(.*)\s*\]/;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((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));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&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));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(Nu),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 Mr(n)?"":n.toString?n.toString():""},t}(),t.DefaultSceneGraphSelector=jn([ct({token:Su})],t.DefaultSceneGraphSelector),t.DefaultSceneGraphService=function(){function e(e){var n,r,i,o,a,s,u,c,l=this;this.sceneGraphSelectorFactory=void 0,this.pendingEvents=[],this.boundsChangedEvent=new Es(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=bn(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=on(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=bn();Mn(a,e[0],e[1],e[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);Rn(n,u),Nn(n,n),wn(a,n,a),wn(o.localRotation,a,s),Dn(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,e)}),this.rotateLocal=(r=bn(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=on(e,n,i));var o=t.transformable;Mn(r,e[0],e[1],e[2]),Ln(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}),this.setEulerAngles=(i=bn(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=on(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Mn(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);Rn(i,Nn(bn(),a)),Ln(o.localRotation,o.localRotation,i),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=on(e,n,r));var i=t.transformable;vn(e,nn())||(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,f=i*h-o*l,p=o*c-r*h,d=r*l-i*c,v=2*n[3];l*=v,h*=v,p*=2,d*=2,t[0]=a+(c*=v)+(f*=2),t[1]=s+l+p,t[2]=u+h+d}(e,e,i.localRotation),un(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(o=Ae(),a=nn(),function(t,e){var n=t.transformable;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,vn(l.getPosition(t),a)||(an(n.position,a),null!==t.parentNode&&t.parentNode.transformable?(Oe(o,t.parentNode.transformable.worldTransform),De(o,o),dn(n.localPosition,a,o)):an(n.localPosition,a),l.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=nn();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,vn(r.localPosition,t)||(an(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(s=nn(),u=nn(),c=nn(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=sn(u,e,n,r)),vn(e,s)||(un(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=bn();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=In(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);Rn(t,s),Nn(t,t),wn(a.localRotation,t,n),Dn(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.calcLocalTransform=function(){var t=Ae(),e=nn(),n=In(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(ze(r.localTransform,r.localRotation,r.localPosition,on(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=Re(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),Ue(r.localTransform,r.localTransform,i)}var o=ze(t,n,e,r.localScale,r.origin);Ue(r.localTransform,r.localTransform,o)}else ze(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.sceneGraphSelectorFactory=e}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){var r,i;t.parentNode&&this.detach(t),t.parentNode=e,Mr(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var o=e.sortable;((null==o||null===(r=o.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(o.dirty=!0);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;((null==i||null===(e=i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(i.dirty=!0);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),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=on(e,n,r));var i=t.transformable;if(!vn(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=on(e,n,r));var i=t.transformable;Mn(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=on(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},n.setLocalScale=function(t,e){var n=t.transformable,r=on(e[0],e[1],e[2]||n.localScale[2]);vn(r,n.localScale)||(an(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=In(e,n,r,i));var o=t.transformable;Rn(o.localRotation,e),this.dirtifyLocal(t,o)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=Bn(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],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),this.dirtifyToRoot(t,!0)},n.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){e.has(n.entity)||(t.boundsChangedEvent.detail=r,n.dispatchEvent(t.boundsChangedEvent),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=t[0],r=t[1];r.affectChildren?e.forEach((function(t){n(t,r)})):n(e,r)})),this.pendingEvents=[]},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;){var r=n.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0),n=n.parentNode}this.pendingEvents.push([t,{affectChildren:e}])},n.getPosition=function(t){var e=t.transformable;return We(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return Xe(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return qe(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.getLocalSkew=function(t){return t.transformable.localSkew},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=We(nn(),e),r=Xe(bn(),e),i=qe(nn(),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]),this.setLocalSkew(t,[0,0])},n.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(ma.isEmpty(r))return null;var i=n||new ma;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new ma},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=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new ma).update(r.center,r.halfExtents))})),e){var a=ao(t);if(a){var s,u=this.getTransformedGeometryBounds(a.style.clipPath,!0);u&&(s=new ma).setFromTransformedAABB(u,this.getWorldTransform(a)),o?s&&(o=s.intersection(o)):o=s}}return o||(o=new ma),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},n.getLocalBounds=function(t){if(t.parentNode){var e=Ae();t.parentNode.transformable&&(e=De(Ae(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!ma.isEmpty(n)){var r=new ma;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);ma.isEmpty(i)||(r=new ma).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 xa(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new xa((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},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&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?Ue(e.worldTransform,r.worldTransform,e.localTransform):Oe(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}(),t.DefaultSceneGraphService=jn([ct({token:ks}),Fn(0,lt(wu))],t.DefaultSceneGraphService);var Mu=function(){function t(t){this.sceneGraphService=void 0,this.sceneGraphService=t}return t.prototype.calculator=function(t,e,n,r){var i=this;if(n instanceof ke&&(n=null),e&&e!==n&&e.parsedStyle.clipPathTargets){var o=e.parsedStyle.clipPathTargets.indexOf(r);e.parsedStyle.clipPathTargets.splice(o,1)}return n&&(n.parsedStyle.clipPathTargets||(n.parsedStyle.clipPathTargets=[]),n.parsedStyle.clipPathTargets.push(r)),r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}();Mu=jn([ct({token:{token:yi,named:t.PropertySyntax.CLIP_PATH}}),Fn(0,lt(ks))],Mu);var ku=function(){function t(){this.parser=va,this.mixer=ya}return t.prototype.calculator=function(t,e,n,r){return n instanceof ke?"none"===n.value?xi:wi:n},t}();ku=jn([ct({token:[{token:yi,named:t.PropertySyntax.PAINT},{token:yi,named:t.PropertySyntax.COLOR}]})],ku);var Pu=function(){function t(){this.parser=Oa}return t.prototype.calculator=function(t,e,n){return n instanceof ke?[]:n},t}();function _u(t){var e=t.parsedStyle.fontSize;return Mr(e)?null:e}Pu=jn([ct({token:{token:yi,named:t.PropertySyntax.FILTER}})],Pu);var Cu=function(){function e(){this.parser=Na,this.mixer=La}return e.prototype.calculator=function(e,n,r,i,o){if(!Qr.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=_u(i.parentNode);if(a)return a*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=_u(i.ownerDocument.documentElement);if(u)return u*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}},e}();Cu=jn([ct({token:[{token:yi,named:t.PropertySyntax.LENGTH_PERCENTAGE},{token:yi,named:t.PropertySyntax.LENGTH}]})],Cu);var Au=function(){function t(){this.mixer=Ba}var e=t.prototype;return e.parser=function(t){var e=_a(Cr(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}();Au=jn([ct({token:{token:yi,named:t.PropertySyntax.LENGTH_PERCENTAGE_12}})],Au);var Ou=function(){function t(){this.mixer=Ba}var e=t.prototype;return e.parser=function(t){var e=_a(Cr(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]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}();Ou=jn([ct({token:{token:yi,named:t.PropertySyntax.LENGTH_PERCENTAGE_14}})],Ou);var Iu=function(e){function n(){return e.apply(this,arguments)||this}return fe(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;Mr(a)||(n=a),Mr(s)||(r=s);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1,u.x2),r=Math.min(c,l),i=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:Mr(e.parsedStyle.x)||(n=e.parsedStyle.x),Mr(e.parsedStyle.y)||(r=e.parsedStyle.y)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0),!Mr(n)||!Mr(r)||!Mr(i)){var h=e.getLocalPosition(),f=h[0],p=h[1],d=h[2];e.setLocalPosition(Mr(n)?f:n,Mr(r)?p:r,Mr(i)?d:i)}},n}(Cu);Iu=jn([ct({token:{token:yi,named:t.PropertySyntax.COORDINATE}})],Iu);var Ru=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof ke&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o},t}();Ru=jn([ct({token:{token:yi,named:t.PropertySyntax.MARKER}})],Ru);var Lu=function(){function t(){this.mixer=La,this.parser=Ra}return t.prototype.calculator=function(t,e,n){return n.value},t}();Lu=jn([ct({token:{token:yi,named:t.PropertySyntax.NUMBER}})],Lu);var Du=function(){function e(){this.parser=Ra,this.mixer=Da(0,1)}var n=e.prototype;return n.calculator=function(t,e,n){return n.value},n.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);r&&e.setLocalPosition(r.x,r.y)}}},e}();Du=jn([ct({token:{token:yi,named:t.PropertySyntax.OFFSET_DISTANCE}})],Du);var Bu=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}();Bu=jn([ct({token:{token:yi,named:t.PropertySyntax.OFFSET_PATH}})],Bu);var Uu=function(){function t(){this.parser=Ra,this.mixer=Da(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}();Uu=jn([ct({token:{token:yi,named:t.PropertySyntax.OPACITY_VALUE}})],Uu);var Gu=function(){function e(){this.parser=ja,this.mixer=Fa}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof ke&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,zCommandIndexes:[],rect:new xa(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}();Gu=jn([ct({token:{token:yi,named:t.PropertySyntax.PATH}})],Gu);var ju=function(){function e(){this.parser=qa}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}();ju=jn([ct({token:{token:yi,named:t.PropertySyntax.LIST_OF_POINTS}})],ju);var Fu=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=Da(0,1/0),e}return fe(e,t),e}(Cu);Fu=jn([ct({token:{token:yi,named:t.PropertySyntax.SHADOW_BLUR}})],Fu);var Vu=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof ke?"unset"===n.value?"":n.value:n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}();Vu=jn([ct({token:{token:yi,named:t.PropertySyntax.TEXT}})],Vu);var Yu=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.value},t}();Yu=jn([ct({token:{token:yi,named:t.PropertySyntax.TEXT_TRANSFORM}})],Yu);var Hu=function(){function t(){this.tmpMat4=Ae(),this.parser=Za,this.mixer=as}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof ke?[]:n},e.postProcessor=function(t){var e=this,n=t.parsedStyle,r=n.transform,i=n.defX,o=n.defY;r&&r.length&&(t.resetLocalTransform(),t.setLocalPosition(i,o),r.forEach((function(n){var r=n.t,a=n.d;if("scale"===r){var s=(null==a?void 0:a.map((function(t){return t.value})))||[1,1];t.scaleLocal(s[0],s[1],1)}else if("scalex"===r){var u=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(u[0],1,1)}else if("scaley"===r){var c=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(1,c[0],1)}else if("scalez"===r){var l=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(1,1,l[0])}else if("scale3d"===r){var h=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];t.scaleLocal(h[0],h[1],h[2])}else if("translate"===r){var f=a||[ci,ci];t.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===r){t.translateLocal((a||[ci])[0].value,0,0)}else if("translatey"===r){t.translateLocal(0,(a||[ci])[0].value,0)}else if("translatez"===r){t.translateLocal(0,0,(a||[ci])[0].value)}else if("translate3d"===r){var p=a||[ci,ci,ci];t.translateLocal(p[0].value,p[1].value,p[2].value)}else if("rotate"===r){t.rotateLocal(0,0,(a||[li])[0].value)}else if("rotatex"===r){t.rotateLocal((a||[li])[0].value,0,0)}else if("rotatey"===r){t.rotateLocal(0,(a||[li])[0].value,0)}else if("rotatez"===r){t.rotateLocal(0,0,(a||[li])[0].value)}else if("rotate3d"===r);else if("skew"===r){var d=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];t.setLocalSkew(po(d[0]),po(d[1]))}else if("skewx"===r){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0];t.setLocalSkew(po(v[0]),t.getLocalSkew()[1])}else if("skewy"===r){var y=(null==a?void 0:a.map((function(t){return t.value})))||[0];t.setLocalSkew(t.getLocalSkew()[0],po(y[0]))}else if("matrix"===r){var g=a.map((function(t){return t.value}));t.setLocalTransform(Ie(e.tmpMat4,g[0],g[1],0,0,g[2],g[3],0,0,0,0,1,0,g[4]+i,g[5]+o,0,1))}else"matrix3d"===r&&(Ie.apply(en,[e.tmpMat4].concat(a.map((function(t){return t.value})))),e.tmpMat4[12]+=i,e.tmpMat4[13]+=o,t.setLocalTransform(e.tmpMat4))})))},t}();Hu=jn([ct({token:{token:yi,named:t.PropertySyntax.TRANSFORM}})],Hu);var Wu=function(){this.parser=ss};Wu=jn([ct({token:{token:yi,named:t.PropertySyntax.TRANSFORM_ORIGIN}})],Wu);var qu=function(){function t(){this.parser=Ra}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.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}();qu=jn([ct({token:{token:yi,named:t.PropertySyntax.Z_INDEX}})],qu);var Xu=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.OFFSET_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.CLIP_PATH},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],zu={},Ku={},Ju={},Zu=Ir((function(t){return t.sort((function(t,e){return Ju[t]-Ju[e]}))})),Qu=nn(),$u=nn(),tc=nn(),ec=function(){function e(t,e,n){var r=this;this.sceneGraphService=void 0,this.propertySyntaxFactory=void 0,this.geometryUpdaterFactory=void 0,this.sceneGraphService=t,this.propertySyntaxFactory=e,this.geometryUpdaterFactory=n,Xu.forEach((function(t){r.registerMetadata(t)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){zu[e]=t,Ju[e]=t.p||0}))},n.unregisterMetadata=function(t){delete zu[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,forceUpdateGeometry:!1,usedAttributes:[]});var i=n.skipUpdateAttribute,o=n.skipParse,a=n.usedAttributes,s=n.forceUpdateGeometry,u=Object.keys(e);u.forEach((function(n){var r,o=Vr(n,e[n]),a=o[0];i||(t.attributes[a]=o[1]),!s&&(null===(r=zu[a])||void 0===r?void 0:r.l)&&(s=!0)})),o||u.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(u=Zu((null==a?void 0:a.length)?Array.from(new Set(u.concat(a))):u)).forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),s&&this.updateGeometry(t),u.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t)})),t.children.length&&u.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=zu[t],i=e;if((""===e||Mr(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=bi(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=bi(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=zu[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof ke){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)Mr(a)||(e=this.parseProperty(t,Br(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return Mr(u)?void this.addUnresolveProperty(n,t):u}}var c=o&&this.getPropertySyntax(o);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof ke?e.value:e}return i},n.postProcessProperty=function(t,e){var n=zu[t];if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}},n.addUnresolveProperty=function(t,e){Ku[t.entity]||(Ku[t.entity]=[]),-1===Ku[t.entity].indexOf(e)&&Ku[t.entity].push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){return!Ku[t.entity]||0===Ku[t.entity].length||Ku[t.entity].includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},n.recalc=function(t){var e=Ku[t.entity];if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),delete Ku[t.entity]}},n.updateGeometry=function(e){var n=this.geometryUpdaterFactory(e.nodeName);if(n){var r=e.geometry;r.contentBounds||(r.contentBounds=new ma),r.renderBounds||(r.renderBounds=new ma);var i=e.parsedStyle,o=n.update(i,e),a=o.width,s=o.height,u=o.depth,c=void 0===u?0:u,l=o.offsetX,h=void 0===l?0:l,f=o.offsetY,p=void 0===f?0:f,d=o.offsetZ,v=void 0===d?0:d,y=0>a,g=0>s,m=sn(Qu,Math.abs(a)/2,Math.abs(s)/2,c/2),T=i.stroke,E=i.lineWidth,b=i.increasedLineWidthForHitTesting,x=i.shadowType,w=i.shadowColor,S=i.filter,N=void 0===S?[]:S,M=i.transformOrigin,k=i.anchor;e.nodeName===t.Shape.TEXT&&delete i.anchor;var P=sn($u,(1-2*(k&&k[0]||0))*a/2+h,(1-2*(k&&k[1]||0))*s/2+p,(1-2*(k&&k[2]||0))*m[2]+v);r.contentBounds.update(P,m);var _=e.nodeName===t.Shape.POLYLINE||e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.PATH?Math.SQRT2:.5;if(T&&!T.isNone){var C=((E||0)+(b||0))*_;un(m,m,sn(tc,C,C,0))}if(r.renderBounds.update(P,m),w&&x&&"inner"!==x){var A=r.renderBounds,O=A.min,I=A.max,R=i.shadowBlur||0,L=i.shadowOffsetX||0,D=i.shadowOffsetY||0,B=I[0]+R+L,U=O[1]-R+D,G=I[1]+R+D;O[0]=Math.min(O[0],O[0]-R+L),I[0]=Math.max(I[0],B),O[1]=Math.min(O[1],U),I[1]=Math.max(I[1],G),r.renderBounds.setMinMax(O,I)}N.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,un(r.renderBounds.halfExtents,r.renderBounds.halfExtents,on(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,f=c[1]-s+a,p=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],f),l[1]=Math.max(l[1],p),r.renderBounds.setMinMax(c,l)}})),k=i.anchor;var j=(y?-1:1)*Ca(M[0],0,e),F=(g?-1:1)*Ca(M[1],1,e);e.setOrigin(j-=(y?-1:1)*(k&&k[0]||0)*r.contentBounds.halfExtents[0]*2,F-=(g?-1:1)*(k&&k[1]||0)*r.contentBounds.halfExtents[1]*2),this.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=zu[t];return!!e&&e.inh},e}();ec=jn([ct({token:fi}),Fn(0,lt(ks)),Fn(1,lt(vi)),Fn(2,lt(ls))],ec);var nc=Ct((function(e){e(t.DisplayObjectPool),e(t.Camera),e(t.DefaultSceneGraphSelector),e({token:wu,useFactory:function(t){return function(){return t.container.get(Su)}}}),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:ls,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(hs,n)&&(e[n]=t.container.getNamed(hs,n)),e[n]}}}),e(Lu),e(cs),e(Mu),e(ku),e(Pu),e(Cu),e(Au),e(Ou),e(Iu),e(Du),e(Bu),e(Uu),e(Gu),e(ju),e(Fu),e(Vu),e(Yu),e(Hu),e(Wu),e(qu),e(Ru),e({token:vi,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(yi,n)&&(e[n]=t.container.getNamed(yi,n)),e[n]}}}),e(ec)})),rc=function(){function t(t){this.plugins=[],this.config=void 0,this.config=he({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===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 ic=1;const oc="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},ac=Date.now();let sc={},uc=Date.now();const cc=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-uc,r=n>16?0:16-n,i=ic++;return sc[i]=t,Object.keys(sc).length>1||setTimeout((()=>{uc=e;const t=sc;sc={},Object.keys(t).forEach((e=>t[e](oc.performance&&"function"==typeof oc.performance.now?oc.performance.now():Date.now()-ac)))}),r),i},lc=t=>{delete sc[t]},hc=t=>"string"!=typeof t?cc:""===t?oc.requestAnimationFrame:oc[t+"RequestAnimationFrame"],fc=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!hc(t))),pc=hc(fc),dc="string"!=typeof(vc=fc)?lc:""===vc?oc.cancelAnimationFrame:oc[vc+"CancelAnimationFrame"]||oc[vc+"CancelRequestAnimationFrame"];var vc,yc,gc;oc.requestAnimationFrame=pc,oc.cancelAnimationFrame=dc,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:pc,cancelAnimationFrame:dc});var mc,Tc,Ec=t.Syringe.defineToken(""),bc=(yc=function(){function e(t,e){this.strategyProvider=void 0,this.renderingContext=void 0,this.strategyProvider=t,this.renderingContext=e}return e.prototype.apply=function(e){var n=this,r=this.strategyProvider.getContributions();e.hooks.cull.tap(gc.tag,(function(e){if(e){var i=e.cullable;return i.visible=0===r.length?n.renderingContext.unculledEntities.indexOf(e.entity)>-1:r.every((function(t){return t.isVisible(e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new Es(t.ElementEvent.CULLED)),null)}return e})),e.hooks.afterRender.tap(gc.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}(),yc.tag="Culling",gc=yc);bc=gc=jn([ct({contrib:xu}),Fn(0,Ft(Ec)),Fn(1,lt(du))],bc);var xc,wc,Sc=(mc=function(){function t(){}return t.prototype.apply=function(t){t.hooks.dirtycheck.tap(Tc.tag,(function(e){return e?e.renderable.dirty||t.disableDirtyRectangleRendering()?e:null:e}))},t}(),mc.tag="DirtyCheck",Tc=mc);Sc=Tc=jn([ct({contrib:xu})],Sc);var Nc=(xc=function(){function t(t,e,n,r,i){var o=this;this.canvasConfig=void 0,this.contextService=void 0,this.renderingService=void 0,this.renderingContext=void 0,this.eventService=void 0,this.autoPreventDefault=!1,this.rootPointerEvent=new Us(null),this.rootWheelEvent=new Gs(null),this.onPointerMove=function(t){var e,n,r=null===(e=o.renderingContext.root)||void 0===e||null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){for(var i,a=ge(o.normalizeToPointerEvent(t,r));!(i=a()).done;){var s=o.bootstrapEvent(o.rootPointerEvent,i.value,r);o.eventService.mapEvent(s)}o.setCursor(o.eventService.cursor)}},this.canvasConfig=t,this.contextService=e,this.renderingService=n,this.renderingContext=r,this.eventService=i}var e=t.prototype;return e.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView;this.eventService.setPickHandler(function(){var t=ue(ae().mark((function t(n){return ae().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(wc.tag,(function(t){var n=e.normalizeWheelEvent(t);e.eventService.mapEvent(n)})),t.hooks.pointerDown.tap(wc.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=ge(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(wc.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=ge(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(wc.tag,this.onPointerMove),t.hooks.pointerOver.tap(wc.tag,this.onPointerMove),t.hooks.pointerOut.tap(wc.tag,this.onPointerMove)},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.canvasConfig.supportsCSSTransform||Mr(r)||Mr(i)){var s=this.eventService.client2Viewport(new ba(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=function(t,e,n){t.view=n,t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var r=this.getViewportXY(e),i=r.y;t.viewport.x=r.x,t.viewport.y=i;var o=this.eventService.viewport2Canvas(t.viewport),a=o.y;return t.canvas.x=o.x,t.canvas.y=a,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=lo[t.type]||t.type),t},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.getViewportXY(t),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.srcElement=e.srcElement,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];Or(i.button)&&(i.button=0),Or(i.buttons)&&(i.buttons=1),Or(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Or(i.width)&&(i.width=i.radiusX||1),Or(i.height)&&(i.height=i.radiusY||1),Or(i.tiltX)&&(i.tiltX=0),Or(i.tiltY)&&(i.tiltY=0),Or(i.pointerType)&&(i.pointerType="touch"),Or(i.pointerId)&&(i.pointerId=i.identifier||0),Or(i.pressure)&&(i.pressure=i.force||.5),Or(i.twist)&&(i.twist=0),Or(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Or(o.isPrimary)&&(o.isPrimary=!0),Or(o.width)&&(o.width=1),Or(o.height)&&(o.height=1),Or(o.tiltX)&&(o.tiltX=0),Or(o.tiltY)&&(o.tiltY=0),Or(o.pointerType)&&(o.pointerType="mouse"),Or(o.pointerId)&&(o.pointerId=1),Or(o.pressure)&&(o.pressure=.5),Or(o.twist)&&(o.twist=0),Or(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}(),xc.tag="Event",wc=xc);Nc=wc=jn([ct({contrib:xu}),Fn(0,lt(_o)),Fn(1,lt(ys)),Fn(2,lt(t.RenderingService)),Fn(3,lt(du)),Fn(4,lt(t.EventService))],Nc);var Mc,kc,Pc=[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],_c=function(){function e(t){this.camera=void 0,this.camera=t}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(ma.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=Pc.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,f=l.distance;if(0>fn(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>fn(h,n.getNegativeFarPoint(i[s]))+f&&(o|=c)}}return o},e}();_c=jn([ct({contrib:Ec}),Fn(0,lt(mu))],_c);var Cc=(Mc=function(){function e(t,e,n,r){this.renderingContext=void 0,this.styleValueRegistry=void 0,this.sceneGraphService=void 0,this.rBush=void 0,this.toSync=new Set,this.renderingContext=t,this.styleValueRegistry=e,this.sceneGraphService=n,this.rBush=r}var n=e.prototype;return n.pushToSync=function(t){var e=this;t.forEach((function(t){e.toSync.add(t)}))},n.apply=function(e){var n=this,r=function(t){t.target.renderable.dirty=!0,e.dirtify()},i=function(t){t.detail.affectChildren&&t.target.forEach((function(t){n.pushToSync([t])})),n.pushToSync(t.composedPath().slice(0,-2)),e.dirtify()},o=function(t){var r=t.target;n.pushToSync(t.composedPath().slice(0,-2)),n.styleValueRegistry.recalc(r),n.sceneGraphService.dirtifyToRoot(r),e.dirtify()},a=function(t){var r=t.target,i=r.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(r),n.sceneGraphService.dirtifyToRoot(t.target),e.dirtify()};e.hooks.init.tapPromise(kc.tag,ue(ae().mark((function e(){return ae().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(kc.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.hooks.endFrame.tap(kc.tag,(function(){n.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],s=o[1],u=i.getMax(),c=u[0],l=u[1];r.aabb||(r.aabb={}),r.aabb.id=n.entity,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=l}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e}(),Mc.tag="Prepare",kc=Mc);Cc=kc=jn([ct({contrib:xu}),Fn(0,lt(du)),Fn(1,lt(fi)),Fn(2,lt(ks)),Fn(3,lt(Ms))],Cc);var Ac,Oc=Ct((function(e){Ot.register(e,xu,{cache:!1}),Ot.register(e,Ec,{cache:!1}),e({token:Ms,useValue:new qt}),e(t.RenderingService),e(t.EventService),e(Nc),e(Cc),e(Sc),e(bc),e(_c)}));(Ac=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Ac.BEFORE_RENDER="beforerender",Ac.AFTER_RENDER="afterrender",Ac.BEFORE_DESTROY="beforedestroy",Ac.AFTER_DESTROY="afterdestroy",Ac.RESIZE="resize",Ac.DIRTY_RECTANGLE="dirtyrectangle";var Ic=function(e){function n(n){var r;(r=e.call(this)||this).container=jt.createChild(),r.document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=Ys,r.frameId=void 0,r.eventService=void 0,r.renderingService=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.mountEvent=new Es(t.ElementEvent.MOUNTED),r.unmountEvent=new Es(t.ElementEvent.UNMOUNTED),r.beforeRenderEvent=new Es(t.CanvasEvent.BEFORE_RENDER),r.afterRenderEvent=new Es(t.CanvasEvent.AFTER_RENDER),r.document=new Ss,r.document.defaultView=ve(r),r.customElements=new ms;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,f=n.cursor,p=n.document,d=n.requestAnimationFrame,v=n.cancelAnimationFrame,y=n.createImage,g=n.supportsPointerEvents,m=n.supportsTouchEvents,T=n.supportsCSSTransform,E=n.isTouchEvent,b=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||ro++;no[n]&&no[n].destroy(),no[n]=e}}(i,ve(r));var x=s,w=u,S=c;return o&&(S=1>(S=c||io&&window.devicePixelRatio||1)?1:Math.ceil(S),x=s||function(t){var e=so(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(o)||o.width/S,w=u||function(t){var e=so(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(o)||o.height/S),r.devicePixelRatio=S,r.requestAnimationFrame=null!=d?d:pc.bind(globalThis),r.cancelAnimationFrame=null!=v?v:dc.bind(globalThis),r.supportsTouchEvents=null!=m?m:"ontouchstart"in globalThis,r.supportsPointerEvents=null!=g?g:!!globalThis.PointerEvent,r.isTouchEvent=null!=E?E:function(t){return r.supportsTouchEvents&&t instanceof globalThis.TouchEvent},r.isMouseEvent=null!=b?b:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:x,height:w,renderer:l,offscreenCanvas:a,devicePixelRatio:S,cursor:f||"default",background:h||"transparent",createImage:y,document:p,supportsCSSTransform:T}),r.initDefaultCamera(x,w),ue(ae().mark((function e(){return ae().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new Es(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}fe(n,e);var r=n.prototype;return r.initRenderingContext=function(e){var n=this;this.container.register({token:_o,useValue:e}),this.container.register({token:du,useValue:{root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],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=jt.get(Tu);r.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).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(du);r.eventEmitter.on(Eu.UPDATED,(function(){i.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.container.register({token:mu,useValue:r})},r.getConfig=function(){return this.container.get(_o)},r.getContainer=function(){return this.container},r.getRoot=function(){return this.document.documentElement},r.getCamera=function(){return this.container.get(mu)},r.getContextService=function(){return this.container.get(ys)},r.getEventService=function(){return this.eventService},r.getRenderingService=function(){return this.renderingService},r.getRenderingContext=function(){return this.container.get(du)},r.getRBushRoot=function(){return this.container.get(Ms)},r.getStats=function(){return this.getRenderingService().getStats()},r.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new Es(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),n||this.dispatchEvent(new Es(t.CanvasEvent.AFTER_DESTROY))},r.changeSize=function(t,e){this.resize(t,e)},r.resize=function(e,n){var r=this.container.get(_o);r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.container.get(mu),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.dispatchEvent(new Es(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){return this.document.documentElement.removeChild(t)},r.removeChildren=function(){this.document.documentElement.removeChildren()},r.render=function(){(this.dispatchEvent(this.beforeRenderEvent),this.container.isBound(t.RenderingService))&&this.container.get(t.RenderingService).render(this.getConfig());this.dispatchEvent(this.afterRenderEvent)},r.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},r.initRenderer=function(){var e=ue(ae().mark((function e(n){var r;return ae().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(ys),this.renderingService=this.container.get(t.RenderingService),this.eventService=this.container.get(t.EventService),this.eventService.init(),e.next=12,r.init();case 12:return e.next=14,this.renderingService.init();case 14:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),n.getConfig().enableAutoRendering&&this.run();case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.loadCommonContainerModule=function(){this.container.unload(Oc),this.container.load(Oc,!0)},r.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.container=e.container,t.init()}))},r.setRenderer=function(){var t=ue(ae().mark((function t(e){var n,r;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy()})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.setCursor=function(t){this.container.get(_o).cursor=t,this.getContextService().applyCursorStyle(t)},r.unmountChildren=function(t){var e=this;if(this.inited){var n=[];t.forEach((function(t){t.isConnected&&n.push(t)})),n.reverse().forEach((function(t){t instanceof Xs&&t.disconnectedCallback&&t.disconnectedCallback(),t.dispatchEvent(e.unmountEvent),t!==e.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}))}},r.mountChildren=function(t){var e=this;this.inited?t.forEach((function(t){t.isConnected||(t.ownerDocument=e.document,t.isConnected=!0,t.dispatchEvent(e.mountEvent),t instanceof Xs&&t.connectedCallback&&t.connectedCallback())})):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName)},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})},le(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}(bs);jt.load(nc);var Rc=jt.get(fi);t.AABB=ma,t.AbstractRenderer=rc,t.AbstractRendererPlugin=function(){this.container=void 0},t.AnimationTimelineToken=Co,t.BUILT_IN_PROPERTIES=Xu,t.CSS=di,t.CSSGradientValue=Me,t.CSSKeywordValue=ke,t.CSSRGB=hi,t.CSSStyleValue=Se,t.CSSUnitValue=Qr,t.CameraContribution=Tu,t.CameraEvent=Eu,t.Canvas=Ic,t.CanvasConfig=_o,t.Circle=Ws,t.ContextService=ys,t.CustomElement=Xs,t.CustomElementRegistry=ms,t.CustomEvent=Es,t.DefaultCamera=mu,t.DisplayObject=Ys,t.Document=Ss,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=uo,t.Element=Ds,t.Ellipse=Ks,t.EventTarget=bs,t.FederatedEvent=Ts,t.FederatedMouseEvent=Bs,t.FederatedPointerEvent=Us,t.FederatedWheelEvent=Gs,t.Frustum=Ea,t.GeometryAABBUpdater=hs,t.GeometryUpdaterFactory=ls,t.GlobalContainer=jt,t.Group=Zs,t.HTML=$s,t.Image=eu,t.LayoutRegistry=pi,t.Line=ru,t.Module=Ct,t.MutationEvent=Ps,t.Node=xs,t.ParseEasingFunction=Ao,t.Path=ou,t.Plane=Ta,t.Point=ba,t.Polygon=su,t.Polyline=cu,t.RBush=qt,t.RBushRoot=Ms,t.Rect=hu,t.Rectangle=xa,t.RenderingContext=du,t.RenderingPluginContribution=xu,t.SceneGraphSelector=Su,t.SceneGraphSelectorFactory=wu,t.SceneGraphService=ks,t.StyleValueRegistry=fi,t.Text=pu,t.computeLinearGradient=function(t,e,n){var r=po(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(e,n,r,i,o){var a=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(a=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(ur([0,0],[a,s]),ur([0,n],[a,s]),ur([e,n],[a,s]),ur([e,0],[a,s]));return o&&(o instanceof Qr?u=o.value:o instanceof ke&&("closest-side"===o.value?u=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?u=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(u=Math.min(ur([0,0],[a,s]),ur([0,n],[a,s]),ur([e,n],[a,s]),ur([e,0],[a,s]))))),{x:a,y:s,r:u}},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,i.y1,i.x2,i.y2);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=Io(a,a,o.cx,o.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=Io(s.rx,s.ry,s.cx,s.cy);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,f=u.y,p=u.radius,d=p&&p.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3],c=t>0?1:-1,l=e>0?1:-1,h=c+l!==0?1:0;return[["M",c*o+n,r],["L",t-c*a+n,r],a?["A",a,a,0,0,h,t+n,l*a+r]:null,["L",t+n,e-l*s+r],s?["A",s,s,0,0,h,t+n-c*s,e+r]:null,["L",n+c*u,e+r],u?["A",u,u,0,0,h,n,e+r-l*u]:null,["L",n,l*o+r],o?["A",o,o,0,0,h,c*o+n,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,l,h,f,d&&p.map((function(t){return _r(t,0,Math.min(Math.abs(c)/2,Math.abs(l)/2))})));break;case t.Shape.PATH:var v=e.parsedStyle.path,y=v.zCommandIndexes;r=[].concat(v.curve),y.forEach((function(t,e){r.splice(t+e+1,0,["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=on(e[1]-a,e[2]-u,0);n&&dn(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=on(e[1]-a,e[2]-u,0),c=on(e[3]-a,e[4]-u,0),l=on(e[5]-a,e[6]-u,0);n&&(dn(s,s,r),dn(c,c,r),dn(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=on(e[6]-a,e[7]-u,0);n&&dn(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=fo,t.decompose=To,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=po,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=ao,t.getAngle=ho,t.getEuler=go,t.getOrCalculatePathTotalLength=Oo,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.inject=lt,t.injectable=ut,t.isBrowser=io,t.isFillOrStrokeAffected=function(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=da,t.mergeColors=ya,t.parseColor=va,t.parseLength=Sa,t.parsePath=ja,t.propertyMetadataCache=zu,t.rad2deg=vo,t.resetEntityCounter=function(){_s=0},t.setDOMSize=function(t,e,n){io&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.singleton=ct,t.styleValueRegistry=Rc,t.translatePathToString=function(t,e,n,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=t.map((function(s,u){var c="Z"===t[t.length-1][0],l=u===t.length-(c?2:1)?o:0,h=u===t.length-(c?2:1)?a:0;switch(s[0]){case"M":return"M "+(s[1]-e+r)+","+(s[2]-n+i);case"L":return"L "+(s[1]-e+l)+","+(s[2]-n+h);case"Q":return"Q "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e+l)+" "+(s[4]-n+h);case"C":return"C "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+","+(s[5]-e+l)+" "+(s[6]-n+h);case"A":return"A "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]+" "+s[5]+" "+(s[6]-e+l)+" "+(s[7]-n+h);case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=yo,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
17
|
+
ae=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 N()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(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 f(){}function p(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(S([])));y&&y!==e&&n.call(y,i)&&(d=y);var g=p.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 E(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,E(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 b(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 x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(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:N}}function N(){return{value:void 0,done:!0}}return f.prototype=p,s(g,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,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=S,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(x),!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),x(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;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function se(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 ue(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){se(o,r,i,a,s,"next",t)}function s(t){se(o,r,i,a,s,"throw",t)}a(void 0)}))}}function ce(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 le(t,e,n){return e&&ce(t.prototype,e),n&&ce(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function he(){return he=Object.assign?Object.assign.bind():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},he.apply(this,arguments)}function fe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,pe(t,e)}function pe(t,e){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pe(t,e)}function de(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 ve(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ye(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 ge(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 ye(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)?ye(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.")}(It=t.UnitType||(t.UnitType={}))[It.kUnknown=0]="kUnknown",It[It.kNumber=1]="kNumber",It[It.kPercentage=2]="kPercentage",It[It.kEms=3]="kEms",It[It.kPixels=4]="kPixels",It[It.kRems=5]="kRems",It[It.kDegrees=6]="kDegrees",It[It.kRadians=7]="kRadians",It[It.kGradians=8]="kGradians",It[It.kTurns=9]="kTurns",It[It.kMilliseconds=10]="kMilliseconds",It[It.kSeconds=11]="kSeconds",It[It.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(Rt||(Rt={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Lt||(Lt={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Dt||(Dt={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Bt||(Bt={}));var me,Te=[{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}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(me||(me={}));var Ee,be=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Te.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},xe=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},we=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms: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""},Se=function(){function e(){}e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds};var n=e.prototype;return n.toString=function(){return this.buildCSSText(Dt.kNo,Bt.kNo,"")},n.isNumericValue=function(){return this.getType()>=me.kUnitType&&this.getType()<=me.kClampType},e}(),Ne=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}fe(e,t);var n=e.prototype;return n.getType=function(){return me.kColorType},n.to=function(t){return this},e}(Se);(Ee=t.GradientType||(t.GradientType={}))[Ee.Constant=0]="Constant",Ee[Ee.LinearGradient=1]="LinearGradient",Ee[Ee.RadialGradient=2]="RadialGradient";var Me=function(t){function e(e,n){var r;return(r=t.call(this)||this).type=void 0,r.value=void 0,r.type=e,r.value=n,r}fe(e,t);var n=e.prototype;return n.clone=function(){return new e(this.type,this.value)},n.buildCSSText=function(t,e,n){return n},n.getType=function(){return me.kColorType},e}(Se),ke=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}fe(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return me.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(Se),Pe=1e-6,_e="undefined"!=typeof Float32Array?Float32Array:Array;function Ce(){var t=new _e(9);return _e!=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 Ae(){var t=new _e(16);return _e!=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 Oe(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 Ie(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,v,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=p,t[13]=d,t[14]=v,t[15]=y,t}function Re(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 Le(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function De(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],f=e[10],p=e[11],d=e[12],v=e[13],y=e[14],g=e[15],m=n*s-r*a,T=n*u-i*a,E=n*c-o*a,b=r*u-i*s,x=r*c-o*s,w=i*c-o*u,S=l*v-h*d,N=l*y-f*d,M=l*g-p*d,k=h*y-f*v,P=h*g-p*v,_=f*g-p*y,C=m*_-T*P+E*k+b*M-x*N+w*S;return C?(t[0]=(s*_-u*P+c*k)*(C=1/C),t[1]=(i*P-r*_-o*k)*C,t[2]=(v*w-y*x+g*b)*C,t[3]=(f*x-h*w-p*b)*C,t[4]=(u*M-a*_-c*N)*C,t[5]=(n*_-i*M+o*N)*C,t[6]=(y*E-d*w-g*T)*C,t[7]=(l*w-f*E+p*T)*C,t[8]=(a*P-s*M+c*S)*C,t[9]=(r*M-n*P-o*S)*C,t[10]=(d*x-v*E+g*m)*C,t[11]=(h*E-l*x-p*m)*C,t[12]=(s*N-a*k-u*S)*C,t[13]=(n*k-r*N+i*S)*C,t[14]=(v*T-d*b-y*m)*C,t[15]=(l*b-h*T+f*m)*C,t):null}function Be(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],f=t[11],p=t[12],d=t[13],v=t[14],y=t[15];return(e*a-n*o)*(h*y-f*v)-(e*s-r*o)*(l*y-f*d)+(e*u-i*o)*(l*v-h*d)+(n*s-r*a)*(c*y-f*p)-(n*u-i*a)*(c*v-h*p)+(r*u-i*s)*(c*d-l*p)}function Ue(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],f=e[9],p=e[10],d=e[11],v=e[12],y=e[13],g=e[14],m=e[15],T=n[0],E=n[1],b=n[2],x=n[3];return t[0]=T*r+E*s+b*h+x*v,t[1]=T*i+E*u+b*f+x*y,t[2]=T*o+E*c+b*p+x*g,t[3]=T*a+E*l+b*d+x*m,t[4]=(T=n[4])*r+(E=n[5])*s+(b=n[6])*h+(x=n[7])*v,t[5]=T*i+E*u+b*f+x*y,t[6]=T*o+E*c+b*p+x*g,t[7]=T*a+E*l+b*d+x*m,t[8]=(T=n[8])*r+(E=n[9])*s+(b=n[10])*h+(x=n[11])*v,t[9]=T*i+E*u+b*f+x*y,t[10]=T*o+E*c+b*p+x*g,t[11]=T*a+E*l+b*d+x*m,t[12]=(T=n[12])*r+(E=n[13])*s+(b=n[14])*h+(x=n[15])*v,t[13]=T*i+E*u+b*f+x*y,t[14]=T*o+E*c+b*p+x*g,t[15]=T*a+E*l+b*d+x*m,t}function Ge(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,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]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=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]=f,t[10]=p,t[11]=d,t[12]=r*v+s*y+h*g+e[12],t[13]=i*v+u*y+f*g+e[13],t[14]=o*v+c*y+p*g+e[14],t[15]=a*v+l*y+d*g+e[15]),t}function je(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 Fe(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],f=e[11];return 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+f*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function Ve(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function Ye(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function He(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,f=r*c,p=i*u,d=i*c,v=o*c,y=a*s,g=a*u,m=a*c;return t[0]=1-(p+v),t[1]=h+m,t[2]=f-g,t[3]=0,t[4]=h-m,t[5]=1-(l+v),t[6]=d+y,t[7]=0,t[8]=f+g,t[9]=d-y,t[10]=1-(l+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function We(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function qe(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 Xe(t,e){var n=new _e(3);qe(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,f=e[8]*r,p=e[9]*i,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-p)/y,t[1]=(f-u)/y,t[2]=(s-c)/y):a>l&&a>d?(y=2*Math.sqrt(1+a-l-d),t[3]=(h-p)/y,t[0]=.25*y,t[1]=(s+c)/y,t[2]=(f+u)/y):l>d?(y=2*Math.sqrt(1+l-a-d),t[3]=(f-u)/y,t[0]=(s+c)/y,t[1]=.25*y,t[2]=(h+p)/y):(y=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/y,t[0]=(f+u)/y,t[1]=(h+p)/y,t[2]=.25*y),t}function ze(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,f=o*c,p=o*l,d=o*h,v=a*l,y=a*h,g=s*h,m=u*c,T=u*l,E=u*h,b=r[0],x=r[1],w=r[2],S=i[0],N=i[1],M=i[2],k=(1-(v+g))*b,P=(p+E)*b,_=(d-T)*b,C=(p-E)*x,A=(1-(f+g))*x,O=(y+m)*x,I=(d+T)*w,R=(y-m)*w,L=(1-(f+v))*w;return t[0]=k,t[1]=P,t[2]=_,t[3]=0,t[4]=C,t[5]=A,t[6]=O,t[7]=0,t[8]=I,t[9]=R,t[10]=L,t[11]=0,t[12]=n[0]+S-(k*S+C*N+I*M),t[13]=n[1]+N-(P*S+A*N+R*M),t[14]=n[2]+M-(_*S+O*N+L*M),t[15]=1,t}function Ke(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,f=i*a,p=i*s,d=i*u,v=o*a,y=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=f-y,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=p+v,t[7]=0,t[8]=f+y,t[9]=p-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ze(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function Je(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}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Qe=Je;function $e(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d=e[0],v=e[1],y=e[2],g=r[0],m=r[1],T=r[2],E=n[0],b=n[1],x=n[2];return Math.abs(d-E)<Pe&&Math.abs(v-b)<Pe&&Math.abs(y-x)<Pe?Re(t):(l=d-E,h=v-b,f=y-x,i=m*(f*=p=1/Math.hypot(l,h,f))-T*(h*=p),o=T*(l*=p)-g*f,a=g*h-m*l,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-f*o,u=f*i-l*a,c=l*o-h*i,(p=Math.hypot(s,u,c))?(s*=p=1/p,u*=p,c*=p):(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]=f,t[11]=0,t[12]=-(i*d+o*v+a*y),t[13]=-(s*d+u*v+c*y),t[14]=-(l*d+h*v+f*y),t[15]=1,t)}function tn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var en=Object.freeze({__proto__:null,create:Ae,clone:function(t){var e=new _e(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:Oe,fromValues:function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,v){var y=new _e(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=o,y[6]=a,y[7]=s,y[8]=u,y[9]=c,y[10]=l,y[11]=h,y[12]=f,y[13]=p,y[14]=d,y[15]=v,y},set:Ie,identity:Re,transpose:Le,invert:De,adjoint:function(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],f=e[10],p=e[11],d=e[12],v=e[13],y=e[14],g=e[15];return t[0]=s*(f*g-p*y)-h*(u*g-c*y)+v*(u*p-c*f),t[1]=-(r*(f*g-p*y)-h*(i*g-o*y)+v*(i*p-o*f)),t[2]=r*(u*g-c*y)-s*(i*g-o*y)+v*(i*c-o*u),t[3]=-(r*(u*p-c*f)-s*(i*p-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*g-p*y)-l*(u*g-c*y)+d*(u*p-c*f)),t[5]=n*(f*g-p*y)-l*(i*g-o*y)+d*(i*p-o*f),t[6]=-(n*(u*g-c*y)-a*(i*g-o*y)+d*(i*c-o*u)),t[7]=n*(u*p-c*f)-a*(i*p-o*f)+l*(i*c-o*u),t[8]=a*(h*g-p*v)-l*(s*g-c*v)+d*(s*p-c*h),t[9]=-(n*(h*g-p*v)-l*(r*g-o*v)+d*(r*p-o*h)),t[10]=n*(s*g-c*v)-a*(r*g-o*v)+d*(r*c-o*s),t[11]=-(n*(s*p-c*h)-a*(r*p-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*y-f*v)-l*(s*y-u*v)+d*(s*f-u*h)),t[13]=n*(h*y-f*v)-l*(r*y-i*v)+d*(r*f-i*h),t[14]=-(n*(s*y-u*v)-a*(r*y-i*v)+d*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t},determinant:Be,multiply:Ue,translate:Ge,scale:je,rotate:function(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d,v,y,g,m,T,E,b,x,w,S,N,M,k,P=r[0],_=r[1],C=r[2],A=Math.hypot(P,_,C);return Pe>A?null:(P*=A=1/A,_*=A,C*=A,i=Math.sin(n),o=Math.cos(n),u=e[1],c=e[2],l=e[3],f=e[5],p=e[6],d=e[7],y=e[9],g=e[10],m=e[11],x=P*_*(a=1-o)-C*i,w=_*_*a+o,S=C*_*a+P*i,N=P*C*a+_*i,M=_*C*a-P*i,k=C*C*a+o,t[0]=(s=e[0])*(T=P*P*a+o)+(h=e[4])*(E=_*P*a+C*i)+(v=e[8])*(b=C*P*a-_*i),t[1]=u*T+f*E+y*b,t[2]=c*T+p*E+g*b,t[3]=l*T+d*E+m*b,t[4]=s*x+h*w+v*S,t[5]=u*x+f*w+y*S,t[6]=c*x+p*w+g*S,t[7]=l*x+d*w+m*S,t[8]=s*N+h*M+v*k,t[9]=u*N+f*M+y*k,t[10]=c*N+p*M+g*k,t[11]=l*N+d*M+m*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:Fe,rotateY:Ve,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7];return e!==t&&(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[0]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:Ye,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return Pe>c?null:(a*=c=1/c,s*=c,u*=c,r=Math.sin(e),i=Math.cos(e),t[0]=a*a*(o=1-i)+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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},fromRotationTranslation:He,fromQuat2:function(t,e){var n=new _e(3),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=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+l*r+u*o-c*i)/h,n[1]=2*(u*a+l*i+c*r-s*o)/h,n[2]=2*(c*a+l*o+s*i-u*r)/h):(n[0]=2*(s*a+l*r+u*o-c*i),n[1]=2*(u*a+l*i+c*r-s*o),n[2]=2*(c*a+l*o+s*i-u*r)),He(t,e,n),t},getTranslation:We,getScaling:qe,getRotation:Xe,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,p=i*l,d=o*c,v=o*l,y=a*l,g=s*u,m=s*c,T=s*l,E=r[0],b=r[1],x=r[2];return t[0]=(1-(d+y))*E,t[1]=(f+T)*E,t[2]=(p-m)*E,t[3]=0,t[4]=(f-T)*b,t[5]=(1-(h+y))*b,t[6]=(v+g)*b,t[7]=0,t[8]=(p+m)*x,t[9]=(v-g)*x,t[10]=(1-(h+d))*x,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:ze,fromQuat:Ke,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},perspectiveNO:Ze,perspective:Ze,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Je,ortho:Qe,orthoZO: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]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t},lookAt:$e,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],f=a-n[2],p=l*l+h*h+f*f;p>0&&(l*=p=1/Math.sqrt(p),h*=p,f*=p);var d=u*f-c*h,v=c*l-s*f,y=s*h-u*l;return(p=d*d+v*v+y*y)>0&&(d*=p=1/Math.sqrt(p),v*=p,y*=p),t[0]=d,t[1]=v,t[2]=y,t[3]=0,t[4]=h*y-f*v,t[5]=f*d-l*y,t[6]=l*v-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:tn,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(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[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(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]},equals:function(t,e){var n=t[0],r=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],f=t[10],p=t[11],d=t[12],v=t[13],y=t[14],g=t[15],m=e[0],T=e[1],E=e[2],b=e[3],x=e[4],w=e[5],S=e[6],N=e[7],M=e[8],k=e[9],P=e[10],_=e[11],C=e[12],A=e[13],O=e[14],I=e[15];return!(Math.abs(n-m)>Pe*Math.max(1,Math.abs(n),Math.abs(m))||Math.abs(r-T)>Pe*Math.max(1,Math.abs(r),Math.abs(T))||Math.abs(i-E)>Pe*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(o-b)>Pe*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(a-x)>Pe*Math.max(1,Math.abs(a),Math.abs(x))||Math.abs(s-w)>Pe*Math.max(1,Math.abs(s),Math.abs(w))||Math.abs(u-S)>Pe*Math.max(1,Math.abs(u),Math.abs(S))||Math.abs(c-N)>Pe*Math.max(1,Math.abs(c),Math.abs(N))||Math.abs(l-M)>Pe*Math.max(1,Math.abs(l),Math.abs(M))||Math.abs(h-k)>Pe*Math.max(1,Math.abs(h),Math.abs(k))||Math.abs(f-P)>Pe*Math.max(1,Math.abs(f),Math.abs(P))||Math.abs(p-_)>Pe*Math.max(1,Math.abs(p),Math.abs(_))||Math.abs(d-C)>Pe*Math.max(1,Math.abs(d),Math.abs(C))||Math.abs(v-A)>Pe*Math.max(1,Math.abs(v),Math.abs(A))||Math.abs(y-O)>Pe*Math.max(1,Math.abs(y),Math.abs(O))||Math.abs(g-I)>Pe*Math.max(1,Math.abs(g),Math.abs(I)))},mul:Ue,sub:tn});function nn(){var t=new _e(3);return _e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function rn(t){return Math.hypot(t[0],t[1],t[2])}function on(t,e,n){var r=new _e(3);return r[0]=t,r[1]=e,r[2]=n,r}function an(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function sn(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function un(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function cn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ln(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function hn(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 fn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pn(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 dn(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 vn(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)<=Pe*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=Pe*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=Pe*Math.max(1,Math.abs(i),Math.abs(s))}var yn,gn=cn,mn=rn;yn=nn();function Tn(){var t=new _e(4);return _e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function En(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=Tn()}();function bn(){var t=new _e(4);return _e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function xn(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 wn(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 Sn(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],f=e[3],p=n[0],d=n[1],v=n[2],y=n[3];return 0>(o=c*p+l*d+h*v+f*y)&&(o=-o,p=-p,d=-d,v=-v,y=-y),1-o>Pe?(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*p,t[1]=s*l+u*d,t[2]=s*h+u*v,t[3]=s*f+u*y,t}function Nn(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 Mn(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 kn,Pn,_n,Cn,An,On,In=function(t,e,n,r){var i=new _e(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},Rn=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ln=wn,Dn=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};kn=nn(),Pn=on(1,0,0),_n=on(0,1,0),Cn=bn(),An=bn(),On=Ce();function Bn(t,e){var n=new _e(2);return n[0]=t,n[1]=e,n}!function(){var t,e=(t=new _e(2),_e!=Float32Array&&(t[0]=0,t[1]=0),t)}();function Un(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var Gn=function(){return Gn=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Gn.apply(this,arguments)};function jn(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 Fn(t,e){return function(n,r){e(n,r,t)}}var Vn={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Yn(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 Hn={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Wn(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Hn[e]===t.length-1&&"achlmqstvz".includes(e)}))}function qn(t){return Wn(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Xn(t){return qn(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function zn(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Hn[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Hn[n]))),Hn[n]););}function Kn(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Zn(t){return t>=48&&57>=t||43===t||45===t||46===t}function Jn(t){return t>=48&&57>=t}function Qn(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),Jn(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Jn(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&Jn(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;Jn(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Jn(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&Jn(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function $n(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function tr(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Hn[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,$n(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Qn(t):Kn(t),t.err.length)return;t.data.push(t.param),$n(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,$n(t))}if(t.index>=t.max)break;if(!Zn(n.charCodeAt(t.index)))break}zn(t)}else zn(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var er=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function nr(t){if(qn(t))return Un(t);var e=function(t){if(Wn(t))return Un(t);var e=new er(t);for($n(e);e.max>e.index&&!e.err.length;)tr(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function rr(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var p=s[1];e.qx=s[0],e.qy=p}return u}function ir(t){if(Xn(t))return Un(t);for(var e=nr(t),n=Gn({},Vn),r=0;e.length>r;r+=1){e[r]=rr(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function or(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function ar(t,e,n,r,i,o,a,s,u,c){var l,h,f,p,d,v=t,y=e,g=n,m=r,T=s,E=u,b=120*Math.PI/180,x=Math.PI/180*(+i||0),w=[];if(c)h=c[0],f=c[1],p=c[2],d=c[3];else{y=(l=or(v,y,-x)).y;var S=((v=l.x)-(T=(l=or(T,E,-x)).x))/2,N=(y-(E=l.y))/2,M=S*S/(g*g)+N*N/(m*m);M>1&&(g*=M=Math.sqrt(M),m*=M);var k=g*g,P=m*m,_=(o===a?-1:1)*Math.sqrt(Math.abs((k*P-k*N*N-P*S*S)/(k*N*N+P*S*S)));p=_*g*N/m+(v+T)/2,d=_*-m*S/g+(y+E)/2,h=Math.asin(((y-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),f=Math.asin(((E-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),h=p>v?Math.PI-h:h,f=p>T?Math.PI-f:f,0>h&&(h=2*Math.PI+h),0>f&&(f=2*Math.PI+f),a&&h>f&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var C=f-h;if(Math.abs(C)>b){var A=f,O=T,I=E;f=h+b*(a&&f>h?1:-1),w=ar(T=p+g*Math.cos(f),E=d+m*Math.sin(f),g,m,i,0,a,O,I,[f,A,p,d])}C=f-h;var R=Math.cos(h),L=Math.sin(h),D=Math.cos(f),B=Math.sin(f),U=Math.tan(C/4),G=4/3*g*U,j=4/3*m*U,F=[v,y],V=[v+G*L,y-j*R],Y=[T+G*B,E-j*D],H=[T,E];if(V[0]=2*F[0]-V[0],V[1]=2*F[1]-V[1],c)return V.concat(Y,H,w);for(var W=[],q=0,X=(w=V.concat(Y,H,w)).length;X>q;q+=1)W[q]=q%2?or(w[q-1],w[q],x).y:or(w[q],w[q+1],x).x;return W}function sr(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ur(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function cr(t,e,n,r,i){var o=ur([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=sr([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function lr(t,e,n,r){var i=.5,o=[t,e],a=[n,r],s=sr(o,a,i),u=sr(a,s,i),c=sr(s,u,i),l=sr(u,c,i),h=sr(c,l,i),f=cr(o[0],o[1],s[0],s[1],c[0]).point,p=cr(h[0],h[1],l[0],l[1],u[0]).point;return[f.x,f.y,p.x,p.y,n,r]}function hr(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],f=l[1],p=e.x1,d=e.y1,v=e.x,y=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=f,t;case"A":return n=[p,d].concat(l),["C"].concat(ar(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[p,d].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(lr(p,d,h,f));case"Z":return p===v&&d===y?["C",p,d,v,y,v,y]:["C"].concat(lr(p,d,v,y))}return t}function fr(t,e){if(void 0===e&&(e=!1),function(t){return Xn(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=Un(t);return e?[n,[]]:n}for(var r,i,o=ir(t),a=Gn({},Vn),s=[],u="",c=o.length,l=[],h=0;c>h;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var f=hr(o[h],a);o[h]=f,Yn(o,s,h),c=o.length,"Z"===u&&l.push(h),a.x1=+(r=o[h])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,l]:o}function pr(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(0>n*o-r*i?-1:1)*Math.acos(a/s)}function dr(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,p=Math.sqrt,d=Math.PI,v=l(n),y=l(r),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===y)return cr(t,e,s,u,c).point;var m=(t-s)/2,T=(e-u)/2,E={x:f(g)*m+h(g)*T,y:-h(g)*m+f(g)*T},b=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(y,2);b>1&&(v*=p(b),y*=p(b));var x=(Math.pow(v,2)*Math.pow(y,2)-Math.pow(v,2)*Math.pow(E.y,2)-Math.pow(y,2)*Math.pow(E.x,2))/(Math.pow(v,2)*Math.pow(E.y,2)+Math.pow(y,2)*Math.pow(E.x,2)),w=(o!==a?1:-1)*p(x=0>x?0:x),S=w*(v*E.y/y),N=w*(-y*E.x/v),M=f(g)*S-h(g)*N+(t+s)/2,k=h(g)*S+f(g)*N+(e+u)/2,P={x:(E.x-S)/v,y:(E.y-N)/y},_=pr({x:1,y:0},P),C=pr(P,{x:(-E.x-S)/v,y:(-E.y-N)/y});!a&&C>0?C-=2*d:a&&0>C&&(C+=2*d);var A=_+(C%=2*d)*c,O=v*f(A),I=y*h(A);return{x:f(g)*O-h(g)*I+M,y:h(g)*O+f(g)*I+k}}function vr(t,e,n,r,i,o,a,s,u,c,l){var h,f=l.bbox,p=void 0===f||f,d=l.length,v=void 0===d||d,y=l.sampleSize,g=void 0===y?30:y,m="number"==typeof c,T=t,E=e,b=0,x=[T,E,b],w=[T,E],S={x:0,y:0},N=[{x:T,y:E}];m&&0>=c&&(S={x:T,y:E});for(var M=0;g>=M;M+=1){if(T=(h=dr(t,e,n,r,i,o,a,s,u,M/g)).x,E=h.y,p&&N.push({x:T,y:E}),v&&(b+=ur(w,[T,E])),w=[T,E],m&&b>=c&&c>x[2]){var k=(b-c)/(b-x[2]);S={x:w[0]*(1-k)+x[0]*k,y:w[1]*(1-k)+x[1]*k}}x=[T,E,b]}return m&&c>=b&&(S={x:s,y:u}),{length:b,point:S,min:{x:Math.min.apply(null,N.map((function(t){return t.x}))),y:Math.min.apply(null,N.map((function(t){return t.y})))},max:{x:Math.max.apply(null,N.map((function(t){return t.x}))),y:Math.max.apply(null,N.map((function(t){return t.y})))}}}function yr(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function gr(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,f=void 0===h||h,p=c.length,d=void 0===p||p,v=c.sampleSize,y=void 0===v?10:v,g="number"==typeof u,m=t,T=e,E=0,b=[m,T,E],x=[m,T],w={x:0,y:0},S=[{x:m,y:T}];g&&0>=u&&(w={x:m,y:T});for(var N=0;y>=N;N+=1){if(m=(l=yr(t,e,n,r,i,o,a,s,N/y)).x,T=l.y,f&&S.push({x:m,y:T}),d&&(E+=ur(x,[m,T])),x=[m,T],g&&E>=u&&u>b[2]){var M=(E-u)/(E-b[2]);w={x:x[0]*(1-M)+b[0]*M,y:x[1]*(1-M)+b[1]*M}}b=[m,T,E]}return g&&u>=E&&(w={x:a,y:s}),{length:E,point:w,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function mr(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Tr(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,p=s.sampleSize,d=void 0===p?10:p,v="number"==typeof a,y=t,g=e,m=0,T=[y,g,m],E=[y,g],b={x:0,y:0},x=[{x:y,y:g}];v&&0>=a&&(b={x:y,y:g});for(var w=0;d>=w;w+=1){if(y=(u=mr(t,e,n,r,i,o,w/d)).x,g=u.y,l&&x.push({x:y,y:g}),f&&(m+=ur(E,[y,g])),E=[y,g],v&&m>=a&&a>T[2]){var S=(m-a)/(m-T[2]);b={x:E[0]*(1-S)+T[0]*S,y:E[1]*(1-S)+T[1]*S}}T=[y,g,m]}return v&&a>=m&&(b={x:i,y:o}),{length:m,point:b,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function Er(t,e,n){for(var r,i,o,a,s,u,c,l,h,f=ir(t),p="number"==typeof e,d=[],v=0,y=0,g=0,m=0,T=[],E=[],b=0,x={x:0,y:0},w=x,S=x,N=x,M=0,k=0,P=f.length;P>k;k+=1)d=(c="M"===(l=(h=f[k])[0]))?d:[v,y].concat(h.slice(1)),c?(w=x={x:g=h[1],y:m=h[2]},b=0,p&&.001>e&&(N=x)):"L"===l?(b=(r=cr(d[0],d[1],d[2],d[3],(e||0)-M)).length,x=r.min,w=r.max,S=r.point):"A"===l?(b=(i=vr(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-M,n||{})).length,x=i.min,w=i.max,S=i.point):"C"===l?(b=(o=gr(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-M,n||{})).length,x=o.min,w=o.max,S=o.point):"Q"===l?(b=(a=Tr(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-M,n||{})).length,x=a.min,w=a.max,S=a.point):"Z"===l&&(b=(s=cr((d=[v,y,g,m])[0],d[1],d[2],d[3],(e||0)-M)).length,x=s.min,w=s.max,S=s.point),p&&e>M&&M+b>=e&&(N=S),E.push(w),T.push(x),M+=b,v=(u="Z"!==l?h.slice(-2):[g,m])[0],y=u[1];return p&&e>=M&&(N={x:v,y:y}),{length:M,point:N,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function br(t){return function(t){var e=0,n=0,r=0;return fr(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,f,p=t.slice(1);return r=3*(((f=p[5])-(a=n))*((s=p[0])+(c=p[2]))-((h=p[4])-(o=e))*((u=p[1])+(l=p[3]))+u*(o-c)-s*(a-l)+f*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function xr(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?gr(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length: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=sr(n,r,e),s=sr(r,i,e),u=sr(i,o,e),c=sr(a,s,e),l=sr(s,u,e),h=sr(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function wr(t,e,n){var r=xr(t),i=xr(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),f=[c,l],p=[h-o,h-a],d=0,v=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return p[e]-=(d=n&&p[e]&&t.l>=f[e])?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:wr(v[0],v[1],h)}var Sr={}.toString,Nr=function(t,e){return Sr.call(t)==="[object "+e+"]"},Mr=function(t){return null==t},kr=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},Pr=function(t){return Nr(t,"String")},_r=function(t,e,n){return e>t?e:t>n?n:t},Cr=function(t){return Nr(t,"Number")},Ar=function(t){return Nr(t,"Boolean")},Or=function(t){return void 0===t},Ir=function(t,e){if(!Nr(t,"Function"))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n},Rr=Ir((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}));function Lr(t){if(!t)throw new Error}function Dr(t,e){if(t===e)throw new Error}function Br(t){return"function"==typeof t}var Ur,Gr,jr={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign",values:{middle:"center"}},src:{alias:"img"}},Fr=Ir((function(t){var e=Rr(t),n=jr[e];return[e=(null==n?void 0:n.alias)||e,n]}));function Vr(t,e){var n,r=Fr(t),i=r[1];return[r[0],Pr(e)&&(null==i||null===(n=i.values)||void 0===n?void 0:n[e])||e]}!function(t){t.kAdd="+",t.kSubtract="-",t.kMultiply="*",t.kDivide="/",t.kMin="min",t.kMax="max",t.kClamp="clamp",t.kInvalid=""}(Ur||(Ur={})),function(t){t[t.kLength=0]="kLength",t[t.kAngle=1]="kAngle",t[t.kTime=2]="kTime",t[t.kFrequency=3]="kFrequency",t[t.kResolution=4]="kResolution",t[t.kFlex=5]="kFlex",t[t.kPercent=6]="kPercent",t[t.kNumBaseTypes=7]="kNumBaseTypes"}(Gr||(Gr={}));var Yr=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=Gr.kPercent,this.hasPercentHint=!1,this.exponents=new Array(Gr.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(function(e){switch(Dr(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kPixels:case t.UnitType.kRems:return Gr.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Gr.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Gr.kAngle;case t.UnitType.kPercentage:return Gr.kPercent;default:return Gr.kLength}}(e),n)}var n=e.prototype;return n.applyPercentHint=function(t){Dr(t,Gr.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(Gr.kPercent)),this.setExponent(Gr.kPercent,0),this.percentHint=t,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return Dr(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(t){return Dr(t,Gr.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(Gr.kPercent,1)},n.matchesBaseTypePercentage=function(t){return Dr(t,Gr.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(Gr.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(Gr.kPercent,1)},e.add=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint),function(t,e){if(t!==e)throw new Error}(t.percentHint,e.percentHint);for(var r=0;Gr.kNumBaseTypes>r;++r){var i=r;if(t.exponents[r]!==e.exponents[r]&&(i!==Gr.kPercent&&(t.applyPercentHint(i),e.applyPercentHint(i)),t.exponents[r]!==e.exponents[r]))return t}return t},e.multiply=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);for(var r=0;Gr.kNumBaseTypes>r;++r){var i=r;t.setExponent(i,t.exponent(i)+e.exponent(i))}return t},e}(),Hr=function(e){return"number"==typeof e?new Qr(e,t.UnitType.kNumber):e},Wr=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}fe(n,e);var r=n.prototype;return r.getType=function(){return me.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=qr(n);return i.every((function(e){return t.equals(e)}))},r.add=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);Xr(me.kSumType,r,this);var i=Kr(r,Ur.kAdd);return i||si.create(r)},r.sub=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);r=r.map((function(t){return t.negate()})),Xr(me.kSumType,r,this);var i=Kr(r,Ur.kAdd);return i||si.create(r)},r.mul=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);Xr(me.kProductType,r,this);var i=Zr(r);return i||ui.create(r)},r.div=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);r=r.map((function(t){return t.invert()})),Xr(me.kProductType,r,this);var i=Zr(r);return i||ui.create(r)},r.min=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);Xr(me.kMinType,r,this);var i=Kr(r,Ur.kMin);return i||oi.create(r)},r.max=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=qr(e);Xr(me.kMaxType,r,this);var i=Kr(r,Ur.kMax);return i||ai.create(r)},r.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=zr(e[0]);return r?(n="string"==typeof t?be(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(be(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=ge(s);!(u=l()).done;){var h=u.value,f=zr(h);if(!f)return null;c.push(f)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var p=si.create(c);return Lr(!!p),p}for(var d=[],v=function(){var t=be(g[y]);Lr(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 Qr(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 si.create(d)},r.type=function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},e=this.type_.exponent(Gr.kLength);return e&&(t.length=e),(e=this.type_.exponent(Gr.kAngle))&&(t.angle=e),(e=this.type_.exponent(Gr.kTime))&&(t.time=e),(e=this.type_.exponent(Gr.kFrequency))&&(t.frequency=e),(e=this.type_.exponent(Gr.kResolution))&&(t.resolution=e),(e=this.type_.exponent(Gr.kFlex))&&(t.flex=e),(e=this.type_.exponent(Gr.kPercent))&&(t.percent=e),this.type_.hasPercentHint&&(t.percentHint=function(t){switch(t){case Gr.kLength:return"length";case Gr.kAngle:return"angle";case Gr.kTime:return"time";case Gr.kFrequency:return"frequency";case Gr.kResolution:return"resolution";case Gr.kFlex:return"flex";case Gr.kPercent:return"percent"}return""}(this.type_.percentHint)),t},n.isValidUnit=function(e){return!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e))},r.negate=function(){return ei.create(this)},r.invert=function(){return ti.create(this)},n}(Se);function qr(t){return t.map(Hr)}function Xr(t,e,n){Lr(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function zr(t){return 0===Object.keys(t.units).length?new Qr(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Qr(t.value,Number(Object.keys(t.units)[0])):null}function Kr(t,e){Lr(!!t.length);var n=t[0]instanceof Qr?t[0]:null;if(!n)return null;for(var r=n.value,i=1;t.length>i;i++){var o=t[i]instanceof Qr?t[i]:null;if(!o||o.unit!==n.unit)return null;e===Ur.kAdd?r+=o.value:e===Ur.kMax?r=Math.max(r,o.value):e===Ur.kMin&&(r=Math.min(r,o.value))}return new Qr(r,n.unit)}function Zr(e){Lr(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var o=e[i]instanceof Qr?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 Qr(r,n)}var Jr=function(e){return function(e){switch(e){case Rt.kUNumber:return t.UnitType.kNumber;case Rt.kULength:return t.UnitType.kPixels;case Rt.kUPercent:return t.UnitType.kPercentage;case Rt.kUTime:return t.UnitType.kSeconds;case Rt.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return Rt.kUNumber;case t.UnitType.kPercentage:return Rt.kUPercent;case t.UnitType.kPixels:return Rt.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Rt.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Rt.kUAngle;default:return Rt.kUOther}}(e))},Qr=function(e){function n(n,r){var i,o;return void 0===r&&(r=t.UnitType.kNumber),o="string"==typeof r?be(r):r,(i=e.call(this,new Yr(o))||this).unit=void 0,i.value=void 0,i.unit=o,i.value=n,i}fe(n,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=Jr(this.unit);if(r!==Jr(e)||r===t.UnitType.kUnknown)return null;var i=xe(this.unit)/xe(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 me.kUnitType},r.sumValue=function(){var e,n,r=[],i={};return this.unit!==t.UnitType.kNumber&&(i[(e=this.unit,n=Jr(e),n===t.UnitType.kUnknown?e:n)]=1),r.push({value:this.value*xe(this.unit),units:i}),r},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):ti.create(this)},r.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=we(this.unit);if(-999999>o||o>999999){var s=we(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(Lr(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e}(o,s):o+(s||"")}else i=""+o+a}return r+=i},n}(Wr),$r=function(t){function e(){return t.apply(this,arguments)||this}return fe(e,t),e.prototype.isUnitValue=function(){return!1},e}(Wr),ti=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="invert",r.value=e,r}fe(e,t),e.create=function(t){return new e(t,Yr.negateExponents(t.type_))};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return me.kInvertType},n.equals=function(t){return t.getType()===me.kInvertType&&this.value.equals(t.value)},n.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)},n.buildCSSText=function(t,e,n){return e==Bt.kNo&&(n+=t===Dt.kYes?"(":"calc("),n=this.value.buildCSSText(Dt.kYes,Bt.kNo,n+="1 / "),e===Bt.kNo&&(n+=")"),n},e}($r),ei=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="negate",r.value=e,r}fe(e,t),e.create=function(t){return new e(t,t.type_)};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return me.kNegateType},n.equals=function(t){return t.getType()===me.kNegateType&&this.value.equals(t.value)},n.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},n.buildCSSText=function(t,e,n){return e==Bt.kNo&&(n+=t===Dt.kYes?"(":"calc("),n=this.value.buildCSSText(Dt.kYes,Bt.kNo,n+="-"),e===Bt.kNo&&(n+=")"),n},e}($r);function ni(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 ri,ii=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).values=void 0,r.values=e,r}fe(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}($r),oi=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).operator="min",e}fe(e,t),e.create=function(t){return new e(t,ni(t,Yr.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return me.kMinType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=ge(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},n.buildCSSText=function(t,e,n){n+="min(";for(var r,i=!0,o=ge(this.numericValues());!(r=o()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(Dt.kYes,Bt.kYes,n)}return n+=")"},e}(ii),ai=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).operator="max",e}fe(e,t),e.create=function(t){return new e(t,ni(t,Yr.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return me.kMaxType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=ge(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},n.buildCSSText=function(t,e,n){n+="max(";for(var r,i=!0,o=ge(this.numericValues());!(r=o()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(Dt.kYes,Bt.kYes,n)}return n+=")"},e}(ii),si=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).operator="sum",e}fe(e,t),e.create=function(t){return new e(t,ni(t,Yr.add))},e.numericTypeFromUnitMap=function(t){var e=new Yr;return Object.keys(t).forEach((function(n){var r=t[n];e=Yr.multiply(e,new Yr(Number(n),r),false),Lr(!0)})),e},e.canCreateNumericTypeFromSumValue=function(t){var e=this;Lr(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return Yr.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return me.kSumType},n.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(he({},e)):t[n].value+=e.value}))})),e.canCreateNumericTypeFromSumValue(t)?t:null},n.buildCSSText=function(t,e,n){e==Bt.kNo&&(n+=t===Dt.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(Dt.kYes,Bt.kNo,n);for(var i=1;r.length>i;i++){var o=r[i];n=o.getType()===me.kNegateType?o.value.buildCSSText(Dt.kYes,Bt.kNo,n+=" - "):o.buildCSSText(Dt.kYes,Bt.kNo,n+=" + ")}return e===Bt.kNo&&(n+=")"),n},e}(ii),ui=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).operator="product",e}fe(e,t),e.create=function(t){return new e(t,ni(t,Yr.multiply))},e.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){Dr(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 n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return me.kProductType},n.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(n){var r=n.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(n){i.push({value:t.value*n.value,units:e.multiplyUnitMaps(t.units,n.units)})}))})),t=i})),t},n.buildCSSText=function(t,e,n){e==Bt.kNo&&(n+=t===Dt.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(Dt.kYes,Bt.kNo,n);for(var i=1;r.length>i;i++){var o=r[i];n=o.getType()===me.kInvertType?o.value.buildCSSText(Dt.kYes,Bt.kNo,n+=" / "):o.buildCSSText(Dt.kYes,Bt.kNo,n+=" * ")}return e===Bt.kNo&&(n+=")"),n},e}(ii),ci=new Qr(0,"px"),li=new Qr(0,"deg"),hi=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}fe(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}(Ne);(ri=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",ri.COLOR="<color>",ri.PAINT="<paint>",ri.NUMBER="<number>",ri.ANGLE="<angle>",ri.OPACITY_VALUE="<opacity-value>",ri.SHADOW_BLUR="<shadow-blur>",ri.LENGTH="<length>",ri.PERCENTAGE="<percentage>",ri.LENGTH_PERCENTAGE="<length> | <percentage>",ri.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",ri.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",ri.LIST_OF_POINTS="<list-of-points>",ri.PATH="<path>",ri.FILTER="<filter>",ri.Z_INDEX="<z-index>",ri.OFFSET_PATH="<offset-path>",ri.OFFSET_DISTANCE="<offset-distance>",ri.CLIP_PATH="<clip-path>",ri.MARKER="<marker>",ri.TRANSFORM="<transform>",ri.TRANSFORM_ORIGIN="<transform-origin>",ri.TEXT="<text>",ri.TEXT_TRANSFORM="<text-transform>";var fi=t.Syringe.defineToken(""),pi=t.Syringe.defineToken(""),di={number:function(t){return new Qr(t)},percent:function(t){return new Qr(t,"%")},px:function(t){return new Qr(t,"px")},em:function(t){return new Qr(t,"em")},rem:function(t){return new Qr(t,"rem")},deg:function(t){return new Qr(t,"deg")},grad:function(t){return new Qr(t,"grad")},rad:function(t){return new Qr(t,"rad")},turn:function(t){return new Qr(t,"turn")},s:function(t){return new Qr(t,"s")},ms:function(t){return new Qr(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;jt.get(fi).registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},registerLayout:function(t,e){jt.get(pi).registerLayout(t,e)}},vi=t.Syringe.defineToken(""),yi=t.Syringe.defineToken(""),gi=new ke("unset"),mi=new ke("initial"),Ti=new ke("inherit"),Ei={"":gi,unset:gi,initial:mi,inherit:Ti},bi=function(t){return Ei[t]||(Ei[t]=new ke(t)),Ei[t]},xi=new hi(0,0,0,0,!0),wi=new hi(0,0,0,0),Si=Ir((function(t,e,n,r){return new hi(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),Ni=Ir((function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Qr(e,n)}),(function(e,n){return void 0===n&&(n=t.UnitType.kNumber),""+e+n}));function Mi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ki(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pi(){}var _i=.7,Ci=1/_i,Ai="\\s*([+-]?\\d+)\\s*",Oi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ii="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ri=/^#([0-9a-f]{3,8})$/,Li=new RegExp("^rgb\\("+[Ai,Ai,Ai]+"\\)$"),Di=new RegExp("^rgb\\("+[Ii,Ii,Ii]+"\\)$"),Bi=new RegExp("^rgba\\("+[Ai,Ai,Ai,Oi]+"\\)$"),Ui=new RegExp("^rgba\\("+[Ii,Ii,Ii,Oi]+"\\)$"),Gi=new RegExp("^hsl\\("+[Oi,Ii,Ii]+"\\)$"),ji=new RegExp("^hsla\\("+[Oi,Ii,Ii,Oi]+"\\)$"),Fi={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 Vi(){return this.rgb().formatHex()}function Yi(){return this.rgb().formatRgb()}function Hi(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ri.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Wi(e):3===n?new zi(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?qi(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?qi(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=Li.exec(t))?new zi(e[1],e[2],e[3],1):(e=Di.exec(t))?new zi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Bi.exec(t))?qi(e[1],e[2],e[3],e[4]):(e=Ui.exec(t))?qi(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Gi.exec(t))?Qi(e[1],e[2]/100,e[3]/100,1):(e=ji.exec(t))?Qi(e[1],e[2]/100,e[3]/100,e[4]):Fi.hasOwnProperty(t)?Wi(Fi[t]):"transparent"===t?new zi(NaN,NaN,NaN,0):null}function Wi(t){return new zi(t>>16&255,t>>8&255,255&t,1)}function qi(t,e,n,r){return r>0||(t=e=n=NaN),new zi(t,e,n,r)}function Xi(t){return t instanceof Pi||(t=Hi(t)),t?new zi((t=t.rgb()).r,t.g,t.b,t.opacity):new zi}function zi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ki(){return"#"+Ji(this.r)+Ji(this.g)+Ji(this.b)}function Zi(){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 Ji(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Qi(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new to(t,e,n,r)}function $i(t){if(t instanceof to)return new to(t.h,t.s,t.l,t.opacity);if(t instanceof Pi||(t=Hi(t)),!t)return new to;if(t instanceof to)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 to(a,s,u,t.opacity)}function to(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function eo(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Mi(Pi,Hi,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Vi,formatHex:Vi,formatHsl:function(){return $i(this).formatHsl()},formatRgb:Yi,toString:Yi}),Mi(zi,(function(t,e,n,r){return 1===arguments.length?Xi(t):new zi(t,e,n,null==r?1:r)}),ki(Pi,{brighter:function(t){return t=null==t?Ci:Math.pow(Ci,t),new zi(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?_i:Math.pow(_i,t),new zi(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:Ki,formatHex:Ki,formatRgb:Zi,toString:Zi})),Mi(to,(function(t,e,n,r){return 1===arguments.length?$i(t):new to(t,e,n,null==r?1:r)}),ki(Pi,{brighter:function(t){return t=null==t?Ci:Math.pow(Ci,t),new to(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?_i:Math.pow(_i,t),new to(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 zi(eo(240>t?t+120:t-240,i,r),eo(t,i,r),eo(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 no={},ro=0;var io="undefined"!=typeof window&&void 0!==window.document;function oo(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 ao(t){var e=t;do{var n;if(null===(n=e.style)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function so(t,e){if(io)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var uo="Method not implemented.",co="Use document.documentElement instead.",lo={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function ho(t){return void 0===t?0:t>360||-360>t?t%360:t}function fo(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Cr(t)?on(t,e,n):Array.isArray(t)&&3===t.length?(r=t,(i=new _e(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):on(t[0],t[1]||e,t[2]||n);var r,i}function po(t){return t*(Math.PI/180)}function vo(t){return t*(180/Math.PI)}function yo(t){return 360*t}function go(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=qe(nn(),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 mo(t,e,n,r,i){var o,a,s,u,c,l,h,f,p,d,v=Math.cos(t),y=Math.sin(t);return o=r*v,a=i*y,s=0,u=-r*y,c=i*v,l=0,h=e,f=n,p=1,(d=new _e(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=f,d[8]=p,d}function To(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=vo(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Eo=Ae(),bo=Ae(),xo=Tn(),wo=[nn(),nn(),nn()],So=nn();function No(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}function Mo(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var ko,Po=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,p=/^\)/,d=/^,/,v=/^\#([0-9a-fA-F]+)/,y=/^([a-zA-Z]+)/,g=/^rgb/i,m=/^rgba/i,T=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function b(t){throw new Error(E+": "+t)}function x(){var t=O(w);return E.length>0&&b("Invalid input not EOF"),t}function w(){return S("linear-gradient",t,M)||S("repeating-linear-gradient",e,M)||S("radial-gradient",n,k)||S("repeating-radial-gradient",r,k)||S("conic-gradient",i,k)}function S(t,e,n){return N(e,(function(e){var r=n();return r&&(U(d)||b("Missing comma before color stops")),{type:t,orientation:r,colorStops:O(I)}}))}function N(t,e){var n=U(t);if(n){U(f)||b("Missing (");var r=e(n);return U(p)||b("Missing )"),r}}function M(){return B("directional",o,1)||B("angular",h,1)}function k(){var t,e,n=P();return n&&((t=[]).push(n),e=E,U(d)&&((n=P())?t.push(n):E=e)),t}function P(){var t=function(){var t=B("shape",/^(circle)/i,0);t&&(t.style=D()||_());return t}()||function(){var t=B("shape",/^(ellipse)/i,0);t&&(t.style=L()||_());return t}();if(t)t.at=C();else{var e=_();if(e){t=e;var n=C();n&&(t.at=n)}else{var r=A();r&&(t={type:"default-radial",at:r})}}return t}function _(){return B("extent-keyword",a,1)}function C(){if(B("position",/^at/,0)){var t=A();return t||b("Missing positioning value"),t}}function A(){var t={x:L(),y:L()};if(t.x||t.y)return{type:"position",value:t}}function O(t){var e=t(),n=[];if(e)for(n.push(e);U(d);)(e=t())?n.push(e):b("One extra comma");return n}function I(){var t=B("hex",v,1)||N(m,(function(){return{type:"rgba",value:O(R)}}))||N(g,(function(){return{type:"rgb",value:O(R)}}))||B("literal",y,0);return t||b("Expected color definition"),t.length=L(),t}function R(){return U(T)[1]}function L(){return B("%",c,1)||B("position-keyword",s,1)||D()}function D(){return B("px",u,1)||B("em",l,1)}function B(t,e,n){var r=U(e);if(r)return{type:t,value:r[n]}}function U(t){var e=/^[\n\r\t\s]+/.exec(E);e&&G(e[0].length);var n=t.exec(E);return n&&G(n[0].length),n}function G(t){E=E.substring(t)}return function(t){return E=t,x()}}();(ko=t.Shape||(t.Shape={})).GROUP="g",ko.CIRCLE="circle",ko.ELLIPSE="ellipse",ko.IMAGE="image",ko.RECT="rect",ko.LINE="line",ko.POLYLINE="polyline",ko.POLYGON="polygon",ko.TEXT="text",ko.PATH="path",ko.HTML="html",ko.MESH="mesh";var _o=t.Syringe.defineToken(""),Co=t.Syringe.defineToken(""),Ao=t.Syringe.defineToken("");function Oo(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Er(t.parsedStyle.path.absolutePath,void 0,Gn(Gn({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Io(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 Ro=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)},Do=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},Bo=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=Ro,this.call=Ro,this._callAsync=Lo,this.callAsync=Lo,this._promise=Do,this.promise=Do,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=ge(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}(),Uo=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=ge(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,f=0,p=function(t){var i=t;h!==o&&("sync"!==e.options.taps[i].type||f++>20)&&(f=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var a=h,p=function(t){return t?"":o()},d=e.callTap(i,{onError:function(t){return n(i,t,a,p)},onResult:r&&function(t){return r(i,t,a,p)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)p(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}(),Go=function(t){function e(){return t.apply(this,arguments)||this}return fe(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}(Uo),jo=new Go,Fo=function(t){return jo.setup(this,t),jo.create(t)},Vo=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=Fo,r._call=void 0,r.call=void 0,r}return fe(e,t),e}(Bo),Yo=function(t){function e(){return t.apply(this,arguments)||this}return fe(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}(Uo),Ho=new Yo,Wo=function(t){return Ho.setup(this,t),Ho.create(t)},qo=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=Wo,r._call=void 0,r.call=void 0,r}return fe(e,t),e}(Bo),Xo=function(t){function e(){return t.apply(this,arguments)||this}return fe(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}(Uo),zo=new Xo,Ko=function(){throw new Error("tapAsync is not supported on a SyncHook")},Zo=function(){throw new Error("tapPromise is not supported on a SyncHook")},Jo=function(t){return zo.setup(this,t),zo.create(t)},Qo=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=Zo,r.compile=Jo,r}return fe(e,t),e}(Bo),$o=function(t){function e(){return t.apply(this,arguments)||this}return fe(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}(Uo),ta=new $o,ea=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},na=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},ra=function(t){return ta.setup(this,t),ta.create(t)},ia=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=ea,r.tapPromise=na,r.compile=ra,r}return fe(e,t),e}(Qo),oa=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];var aa=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,sa=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ua=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ca=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var la={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},ha=Ir((function(t){var e;return e="angular"===t.type?Number(t.value):la[t.value]||0,Ni(e,"deg")})),fa=Ir((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Ni(e,r),cy:Ni(n,i)}})),pa=Ir((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Po(e).map((function(e){var n=e.type,r=e.orientation,i=e.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;r>a;a++){var s,u=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!Mr(u)&&!Mr(o)){for(var c=1;a-i>c;c++)t[i+c].length={type:"%",value:""+(o+(Number(u)-o)*c/(a-i))};i=a,o=Number(u)}}}(i);var o=i.map((function(t){return{offset:Ni(t.length.value,"%"),color:Mo(t)}}));if("linear-gradient"===n)return new Me(t.GradientType.LinearGradient,{angle:r?ha(r):li,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a,s=fa(r[0].at),u=s.cx,c=s.cy;if(r[0].style){var l=r[0].style,h=l.type,f=l.value;a="extent-keyword"===h?bi(f):Ni(f,h)}return new Me(t.GradientType.RadialGradient,{cx:u,cy:c,size:a,steps:o})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=aa.exec(e);if(r){var i,o=(null===(i=r[2].match(ca))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Me(t.GradientType.LinearGradient,{angle:Ni(parseFloat(r[1]),"deg"),steps:o.map((function(t){var e=t[1];return{offset:Ni(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var a=function(t){var e=sa.exec(t);if(e){var n,r=(null===(n=e[4].match(ca))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Ni(50,"%"),cy:Ni(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:Ni(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(a){if(!Pr(a))return[new Me(t.GradientType.RadialGradient,a)];e=a}}else if("p"===n)return function(t){var e=ua.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{image:r,repetition:n}}return null}(e)}));function da(t){return kr(t)&&!!t.image}var va=Ir((function(t){if(da(t))return he({repetition:"repeat"},t);if(Mr(t)&&(t=""),"transparent"===t)return wi;"currentColor"===t&&(t="black");var e=pa(t);if(e)return e;var n=Hi(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Si.apply(void 0,r)}));function ya(t,e){if(t instanceof hi&&e instanceof hi)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(_r(e[n],0,255));return e[3]=_r(e[3],0,1),"rgba("+e.join(",")+")"}]}var ga,ma=function(){function t(t,e){this.center=nn(),this.halfExtents=nn(),this.min=nn(),this.max=nn(),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){t&&an(this.center,t),e&&an(this.halfExtents,e||on(0,0,0)),this.min=gn(this.min,this.center,this.halfExtents),this.max=un(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){un(this.center,e,t),ln(this.center,this.center,.5),gn(this.halfExtents,e,t),ln(this.halfExtents,this.halfExtents,.5),an(this.min,t),an(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,f=i-u,p=i+u,d=o-c,v=o+c,y=e.center,g=y[0],m=y[1],T=y[2],E=e.halfExtents,b=E[0],x=E[1],w=E[2],S=g-b,N=g+b,M=m-x,k=m+x,P=T-w,_=T+w;l>S&&(l=S),N>h&&(h=N),f>M&&(f=M),k>p&&(p=k),d>P&&(d=P),_>v&&(v=_),n[0]=.5*(l+h),n[1]=.5*(f+p),n[2]=.5*(d+v),a[0]=.5*(h-l),a[1]=.5*(p-f),a[2]=.5*(v-d),this.min[0]=l,this.min[1]=f,this.min[2]=d,this.max[0]=h,this.max[1]=p,this.max[2]=v}},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],f=e[2],p=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),E=Math.abs(h),b=Math.abs(f),x=Math.abs(p),w=Math.abs(d);sn(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]+f*i[0]+p*i[1]+d*i[2]),sn(r,v*o[0]+y*o[1]+g*o[2],m*o[0]+T*o[1]+E*o[2],b*o[0]+x*o[1]+w*o[2]),this.min=gn(this.min,n,r),this.max=un(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=nn(),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}(nn(),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?an(nn(),this.min):272===t.pnVertexFlag?on(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?on(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?on(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?on(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?on(this.max[0],this.min[1],this.max[2]):on(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?an(nn(),this.max):272===t.pnVertexFlag?on(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?on(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?on(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?on(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?on(this.min[0],this.max[1],this.min[2]):on(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),Ta=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||on(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 fn(t,this.normal)-this.distance},e.normalize=function(){var t=1/mn(this.normal);ln(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&&function(t,e,n,r){var i=e[0],o=e[1],a=e[2];t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a)}(n,t,e,i),o},t}();(ga=t.Mask||(t.Mask={}))[ga.OUTSIDE=4294967295]="OUTSIDE",ga[ga.INSIDE=0]="INSIDE",ga[ga.INDETERMINATE=2147483647]="INDETERMINATE";var Ea=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Ta)}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],f=t[11],p=t[12],d=t[13],v=t[14],y=t[15];sn(this.planes[0].normal,i-e,u-o,f-c),this.planes[0].distance=y-p,sn(this.planes[1].normal,i+e,u+o,f+c),this.planes[1].distance=y+p,sn(this.planes[2].normal,i+n,u+a,f+l),this.planes[2].distance=y+d,sn(this.planes[3].normal,i-n,u-a,f-l),this.planes[3].distance=y-d,sn(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=y-v,sn(this.planes[5].normal,i+r,u+s,f+h),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),ba=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}(),xa=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 wa(t,e){if(Mr(e))return Ni(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Ni(Number(e),"px");if("deg".search(t)>=0)return Ni(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 Ni(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var Sa=Ir((function(t){return wa(new RegExp("px","g"),t)})),Na=(Ir((function(t){return wa(new RegExp("%","g"),t)})),Ir((function(t){return Cr(t)||isFinite(Number(t))?Ni(Number(t),"px"):wa(new RegExp("px|%|em|rem","g"),t)}))),Ma=Ir((function(t){return wa(new RegExp("deg|rad|grad|turn","g"),t)}));function ka(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=Jr(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=we(t.unit)):(Qr.isLength(t.unit)||Qr.isLength(e.unit))&&(a=Ca(t,i,n),s=Ca(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Pa(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=vo(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=yo(Number(e.value))),n}function _a(t){return Pr(t)?t.split(" ").map((function(t){return Na(t)})):t.map((function(t){return Na(t.toString())}))}function Ca(e,n,r){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds(),o=0;return ma.isEmpty(i)||(o=2*i.halfExtents[n]),Number(e.value)/100*o}return 0}var Aa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Oa(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,Aa.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return wa(/deg|rad|grad|turn|px|%/g,t)||va(t)}))}),n.lastIndex===t.length)return r}return[]}function Ia(t){return t.toString()}var Ra=Ir((function(t){return"number"==typeof t?Ni(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ni(Number(t)):Ni(0)}));Ir((function(t){return Pr(t)?t.split(" ").map(Ra):t.map(Ra)}));function La(t,e){return[t,e,Ia]}function Da(t,e){return function(n,r){return[n,r,function(n){return Ia(_r(n,t,e))}]}}function Ba(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var Ua=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,zCommandIndexes:[],rect:{x:0,y:0,width:0,height:0}};var e;try{e=ir(t)}catch(n){e=ir(""),console.error("[g]: Invalid SVG Path definition: "+t)}var n=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}(e),r=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]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=fr(e,!0),s=a[0],u=a[1],c=function(t){for(var e,n,r=[],i=null,o=null,a=0,s=t.length,u=0;s>u;u++){var c=t[u];o=t[u+1];var l=c[0],h={command:l,prePoint:i,params:c,startTangent:null,endTangent:null};"M"===l&&(a=u);var f=c.length;h.currentPoint=i=[c[f-2],c[f-1]],r[a]&&(e=i)[0]===(n=r[a].currentPoint)[0]&&e[1]===n[1]&&(r[a].prePoint=h.prePoint),h.nextPoint=o?[o[o.length-2],o[o.length-1]]:null;var p=h.prePoint;if("C"===l){var d=[c[1],c[2]],v=[c[3],c[4]];h.startTangent=[p[0]-d[0],p[1]-d[1]],h.endTangent=[i[0]-v[0],i[1]-v[1]],0===h.startTangent[0]&&0===h.startTangent[1]&&(h.startTangent=[d[0]-v[0],d[1]-v[1]]),0===h.endTangent[0]&&0===h.endTangent[1]&&(h.endTangent=[v[0]-d[0],v[1]-d[1]])}r.push(h)}return r}(s),l=function(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var n=Er(t,void 0,Gn(Gn({},e),{length:!1})),r=n.min,i=r.x,o=r.y,a=n.max,s=a.x,u=a.y,c=s-i,l=u-o;return{width:c,height:l,x:i,y:o,x2:s,y2:u,cx:i+c/2,cy:o+l/2,cz:Math.max(c,l)+Math.min(c,l)/2}}(e),h=l.x,f=l.y,p=l.width,d=l.height;return{absolutePath:e,hasArc:n,segments:c,polygons:i,polylines:o,curve:s,totalLength:0,zCommandIndexes:u,rect:{x:Number.isFinite(h)?h:0,y:Number.isFinite(f)?f:0,width:Number.isFinite(p)?p:0,height:Number.isFinite(d)?d:0}}},Ga=Ir(Ua);function ja(t,e){var n=Pr(t)?Ga(t):Ua(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Fa(t,e,n){var r=t.curve,i=e.curve,o=[r,i];r.length!==i.length&&(o=wr(r,i));var a,s,u,c,l,h,f,p,d=br(o[0])!==br(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):Un(o[0]);return[d,(u=o[1],c=d,l=u.length-1,h=[],f=0,p=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])}))}))}(u),p.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=ur(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=f,f=0})),p[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Va(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Ya(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 Ha={box:function(t,e,n,r){return Ya([t,n],[e,r])},length:function(t,e,n,r){return Va(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?Va(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?Va(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)}};var Wa=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+=Va(r[0],r[1],i[0],i[1])}return e}(t)};function qa(t,e){var n;n=Pr(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=Wa(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Ha.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 Xa=null;function za(t){return function(e){var n=0;return t.map((function(t){return t===Xa?e[n++]:t}))}}function Ka(t){return t}var Za={matrix:["NNNNNN",[Xa,Xa,0,0,Xa,Xa,0,0,0,0,1,0,Xa,Xa,0,1],Ka],matrix3d:["NNNNNNNNNNNNNNNN",Ka],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",za([Xa,Xa,di.number(1)]),Ka],scalex:["N",za([Xa,di.number(1),di.number(1)]),za([Xa,di.number(1)])],scaley:["N",za([di.number(1),Xa,di.number(1)]),za([di.number(1),Xa])],scalez:["N",za([di.number(1),di.number(1),Xa])],scale3d:["NNN",Ka],skew:["Aa",null,Ka],skewx:["A",null,za([Xa,li])],skewy:["A",null,za([li,Xa])],translate:["Tt",za([Xa,Xa,ci]),Ka],translatex:["T",za([Xa,ci,ci]),za([Xa,ci])],translatey:["T",za([ci,Xa,ci]),za([ci,Xa])],translatez:["L",za([ci,ci,Xa])],translate3d:["TTL",Ka]};function Ja(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=Za[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],f=u[l],p=void 0;if(void 0===(p=h?{A:function(t){return"0"===t.trim()?li:Ma(t)},N:Ra,T:Na,L:Sa}[f.toUpperCase()](h):{a:li,n:c[0],t:ci}[f]))return[];c.push(p)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Qa(t){var e,n,r,i;switch(t.t){case"rotatex":return i=po(Pa(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=po(Pa(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=po(Pa(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=po(Pa(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var l=po(Pa(t.d[0])),h=po(Pa(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=po(Pa(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=po(Pa(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ca(t.d[0],0,null)||0,n=Ca(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ca(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Ca(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Ca(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ca(t.d[0],0,null)||0,n=Ca(t.d[1],0,null)||0,r=Ca(t.d[2],0,null)||0,1];case"perspective":var f=Ca(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function $a(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function ts(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Eo,t))return!1;if(Oe(bo,Eo),bo[3]=0,bo[7]=0,bo[11]=0,bo[15]=1,1e-8>Math.abs(Be(bo)))return!1;var a,s,u=Eo[3],c=Eo[7],l=Eo[11],h=Eo[12],f=Eo[13],p=Eo[14],d=Eo[15];if(0!==u||0!==c||0!==l){if(xo[0]=u,xo[1]=c,xo[2]=l,xo[3]=d,!De(bo,bo))return!1;Le(bo,bo),En(i,xo,bo)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=p,(a=wo)[0][0]=(s=Eo)[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=rn(wo[0]),hn(wo[0],wo[0]),r[0]=fn(wo[0],wo[1]),No(wo[1],wo[1],wo[0],1,-r[0]),n[1]=rn(wo[1]),hn(wo[1],wo[1]),r[0]/=n[1],r[1]=fn(wo[0],wo[2]),No(wo[2],wo[2],wo[0],1,-r[1]),r[2]=fn(wo[1],wo[2]),No(wo[2],wo[2],wo[1],1,-r[2]),n[2]=rn(wo[2]),hn(wo[2],wo[2]),r[1]/=n[2],r[2]/=n[2],pn(So,wo[1],wo[2]),0>fn(wo[0],So))for(var v=0;3>v;v++)n[v]*=-1,wo[v][0]*=-1,wo[v][1]*=-1,wo[v][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+wo[0][0]-wo[1][1]-wo[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-wo[0][0]+wo[1][1]-wo[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-wo[0][0]-wo[1][1]+wo[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+wo[0][0]+wo[1][1]+wo[2][2],0)),wo[2][1]>wo[1][2]&&(o[0]=-o[0]),wo[0][2]>wo[2][0]&&(o[1]=-o[1]),wo[1][0]>wo[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Qa).reduce($a)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var es=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(var u=0;3>u;u++)for(var c=0;3>c;c++)a[3][u]+=e[c]*a[c][u];var l=i[0],h=i[1],f=i[2],p=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(h*h+f*f),d[0][1]=2*(l*h-f*p),d[0][2]=2*(l*f+h*p),d[1][0]=2*(l*h+f*p),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(h*f-l*p),d[2][0]=2*(l*f-h*p),d[2][1]=2*(h*f+l*p),d[2][2]=1-2*(l*l+h*h),a=t(a,d);var v,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y));for(var g=0;3>g;g++)for(var m=0;3>m;m++)a[g][m]*=n[g];return 0==(v=a)[0][2]&&0==v[0][3]&&0==v[1][2]&&0==v[1][3]&&0==v[2][0]&&0==v[2][1]&&1==v[2][2]&&0==v[2][3]&&0==v[3][2]&&1==v[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function ns(t){return t.toFixed(6).replace(".000000","")}function rs(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=ts(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=ts(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=_r(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return es(t[0],t[1],t[2],e,t[4]).map(ns).join(",")}])}function is(t){return t.replace(/[xy]/,"")}function os(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function as(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?Ni(a):Ni(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length){var h=rs(t,e);u=[h[0]],c=[h[1]],l=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var p=t[f].t,d=e[f].t,v=t[f].d,y=e[f].d,g=Za[p],m=Za[d],T=void 0;if(s=d,"perspective"===(a=p)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var E=rs([t[f]],[e[f]]);u.push(E[0]),c.push(E[1]),l.push(["matrix",[E[2]]])}else{if(p===d)T=p;else if(g[2]&&m[2]&&is(p)===is(d))T=is(p),v=g[2](v),y=m[2](y);else{if(!g[1]||!m[1]||os(p)!==os(d)){var b=rs(t,e);u=[b[0]],c=[b[1]],l=[["matrix",[b[2]]]];break}T=os(p),v=g[1](v),y=m[1](y)}for(var x=[],w=[],S=[],N=0;v.length>N;N++){var M=ka(v[N],y[N],n,!1,N);x[N]=M[0],w[N]=M[1],S.push(M[2])}u.push(x),c.push(w),l.push([T,S])}}if(r){var k=u;u=c,c=k}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var ss=Ir((function(t){if(Pr(t)){if("text-anchor"===t)return[Ni(0,"px"),Ni(0,"px")];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:[Na(us(e[0])),Na(us(e[1]))]}return[Ni(t[0]||0,"px"),Ni(t[1]||0,"px")]}));function us(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var cs=function(){function t(){this.parser=Ma,this.mixer=La}return t.prototype.calculator=function(t,e,n,r){return Pa(n)},t}();cs=jn([ct({token:{token:yi,named:t.PropertySyntax.ANGLE}})],cs);var ls=t.Syringe.defineToken(""),hs=t.Syringe.defineToken("");t.CircleUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),t.CircleUpdater=jn([ct({token:{token:hs,named:t.Shape.CIRCLE}})],t.CircleUpdater),t.EllipseUpdater=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),t.EllipseUpdater=jn([ct({token:{token:hs,named:t.Shape.ELLIPSE}})],t.EllipseUpdater),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,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),t.LineUpdater=jn([ct({token:{token:hs,named:t.Shape.LINE}})],t.LineUpdater),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=jn([ct({token:{token:hs,named:t.Shape.PATH}})],t.PathUpdater),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=jn([ct({token:[{token:hs,named:t.Shape.POLYLINE},{token:hs,named:t.Shape.POLYGON}]})],t.PolylineUpdater),t.RectUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!Pr(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),t.RectUpdater=jn([ct({token:[{token:hs,named:t.Shape.RECT},{token:hs,named:t.Shape.IMAGE},{token:hs,named:t.Shape.GROUP}]})],t.RectUpdater),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=jn([ct()],t.OffscreenCanvasCreator);var fs={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]},ps=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ds=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),vs=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source);t.TextService=function(){function t(t){var e=this;this.offscreenCanvas=void 0,this.cache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!vs.exec(n)&&!ds.exec(t))},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},this.offscreenCanvas=t}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=fs.MetricsString+fs.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(fs.BaselineSymbol).width),u=fs.HeightMultiplier*s;s=s*fs.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,f=0,p=0,d=!1;for(f=0;s>f;++f){for(var v=0;h>v;v+=4)if(255!==c[p+v]){d=!0;break}if(d)break;p+=h}for(n.ascent=s-f,p=l-h,d=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==c[p+y]){d=!0;break}if(d)break;p-=h}return n.descent=f-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=e.lineWidth,s=e.textBaseline,u=e.textAlign,c=e.letterSpacing,l=e.leading,h=void 0===l?0:l,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Cr(e)&&e+"px"||"16px",s=Pr(n)?n.split(","):[n],u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&0>oa.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}(e),p=this.measureFont(f,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var d=this.offscreenCanvas.getOrCreateContext(n);d.font=f,e.isOverflowing=!1;for(var v=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(v.length),g=0,m=0;v.length>m;m++){var T=d.measureText(v[m]).width+(v[m].length-1)*c;y[m]=T,g=Math.max(g,T)}var E=g+a,b=o||p.fontSize+a,x=Math.max(b,p.fontSize+a)+(v.length-1)*(b+h),w=0;return"middle"===s?w=-x/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-x:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:E,height:x,lines:v,lineWidths:y,lineHeight:b+=h,maxLineWidth:g,fontProperties:p,lineMetrics:y.map((function(t,e){var n=0;return"center"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new xa(n-a/2,w+e*b,t+a,b)}))}},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,c=e.textOverflow,l=this.offscreenCanvas.getOrCreateContext(n),h=o+a,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);for(var p=[],d=0,v=0,y={},g=function(t){return r.getFromCache(t,a,y,l)},m=Array.from(f).reduce((function(t,e){return t+g(e)}),0),T=Array.from(t),E=0;T.length>E;E++){var b=T[E],x=t[E-1],w=t[E+1],S=g(b);if(this.isNewline(b))v=0,p[++d]="";else{if(v>0&&v+S>h){if(d+1>=u){if(e.isOverflowing=!0,m>0&&h>=m){for(var N=0,M=0,k=0;p[d].length>k;k++){var P=g(p[d][k]);if(N+P+m>h){M=k;break}N+=P}p[d]=(p[d]||"").slice(0,M)+f}break}if(v=0,p[++d]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(p=this.trimToBreakable(p),v=this.sumTextWidthByCache(p[d]||"",y)),this.shouldBreakByKinsokuShorui(b,w)&&(p=this.trimByKinsokuShorui(p),v+=g(x||""))}v+=S,p[d]=(p[d]||"")+b}}return p.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&fs.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&fs.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||!ps.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(!ps.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}(),t.TextService=jn([ct(),Fn(0,lt(t.OffscreenCanvasCreator))],t.TextService),t.TextUpdater=function(){function t(t){this.textService=void 0,this.textService=t}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&&!Mr(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 f=[h.width/2,h.height/2,0],p=[0,1],d=0;"center"===o?(d=a/2,p=[.5,1]):"right"!==o&&"end"!==o||(d=a,p=[1,1]);var v=0;return"middle"===s?v=f[1]:"top"===s||"hanging"===s?v=2*f[1]:"alphabetic"===s?v=h.lineHeight-h.fontProperties.ascent:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(d+=u),c&&(v+=c),t.anchor=[p[0],p[1],0],{width:2*f[0],height:2*f[1],offsetX:d,offsetY:v}},t}(),t.TextUpdater=jn([ct({token:{token:hs,named:t.Shape.TEXT}}),Fn(0,lt(t.TextService))],t.TextUpdater);var ys=t.Syringe.defineToken("",{multiple:!1}),gs=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 f,p=l.length;for(c=0;p>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(f=1,u=new Array(h-1);h>f;f++)u[f-1]=arguments[f];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})),ms=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,Ws),this.define(t.Shape.ELLIPSE,Ks),this.define(t.Shape.RECT,hu),this.define(t.Shape.IMAGE,eu),this.define(t.Shape.LINE,ru),this.define(t.Shape.GROUP,Js),this.define(t.Shape.PATH,ou),this.define(t.Shape.POLYGON,su),this.define(t.Shape.POLYLINE,cu),this.define(t.Shape.TEXT,pu),this.define(t.Shape.HTML,$s)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),Ts=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 ba,this.page=new ba,this.canvas=new ba,this.viewport=new ba,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(){},e.clone=function(){throw new Error(uo)},le(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}(),Es=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(ve(r),n),r}return fe(e,t),e}(Ts),bs=function(){function t(){this.emitter=new gs.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=Ar(n)&&n||kr(n)&&n.capture,i=kr(n)&&n.once,o=Br(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=Br(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=Ar(n)&&n||kr(n)&&n.capture,o=Br(e)?void 0:e;return t=i?t+"capture":t,e=Br(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 Es(t,e))},e.dispatchEvent=function(t){if(!(t instanceof Ts))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var e;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var n;e=null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView}if(e){var r;if(t.manager=e.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],t.target=this,null===(r=t.manager)||void 0===r||r.dispatchEvent(t)}return!t.defaultPrevented},t}(),xs=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}fe(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(uo)},r.lookupNamespaceURI=function(t){throw new Error(uo)},r.lookupPrefix=function(t){throw new Error(uo)},r.normalize=function(){throw new Error(uo)},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],f=s[c+l];if(f!==h){var p=h.parentNode.childNodes;return p.indexOf(h)<p.indexOf(f)?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)}))},le(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=ge(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)})),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}(bs);xs.DOCUMENT_POSITION_DISCONNECTED=1,xs.DOCUMENT_POSITION_PRECEDING=2,xs.DOCUMENT_POSITION_FOLLOWING=4,xs.DOCUMENT_POSITION_CONTAINS=8,xs.DOCUMENT_POSITION_CONTAINED_BY=16,xs.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ws,Ss=function(e){function n(){var n;(n=e.call(this)||this).defaultView=null,n.documentElement=void 0,n.timeline=void 0,n.ownerDocument=null,n.nodeName="document";try{n.timeline=jt.get(Co),n.timeline.attach(ve(n))}catch(t){}var r={};return Xu.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=Br(n)?n(t.Shape.GROUP):n)})),n.documentElement=new Js({id:"g-root",style:r}),n.documentElement.ownerDocument=ve(n),n.documentElement.parentNode=ve(n),n.childNodes=[n.documentElement],n}fe(n,e);var r=n.prototype;return r.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?pu:Js);var r=new n(e);return r.ownerDocument=this,r},r.createElementNS=function(t,e,n){return this.createElement(e,n)},r.cloneNode=function(t){throw new Error(uo)},r.destroy=function(){try{this.documentElement.destroy(),this.timeline.destroy()}catch(t){}},r.elementsFromBBox=function(e,n,r,i){var o=this.defaultView.getRBushRoot().search({minX:e,minY:n,maxX:r,maxY:i}),a=jt.get(t.DisplayObjectPool),s=[];return o.forEach((function(t){var e=a.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&s.push(e)})),s.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),s},r.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},r.elementFromPoint=function(){var t=ue(ae().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return ae().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",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},r.elementsFromPoint=function(){var t=ue(ae().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return ae().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(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.appendChild=function(t,e){throw new Error(co)},r.insertBefore=function(t,e){throw new Error(co)},r.removeChild=function(t,e){throw new Error(co)},r.replaceChild=function(t,e,n){throw new Error(co)},r.append=function(){throw new Error(co)},r.prepend=function(){throw new Error(co)},r.getElementById=function(t){return this.documentElement.getElementById(t)},r.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},r.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},r.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},r.querySelector=function(t){return this.documentElement.querySelector(t)},r.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},r.find=function(t){return this.documentElement.find(t)},r.findAll=function(t){return this.documentElement.findAll(t)},le(n,[{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}}]),n}(xs);(ws=t.Strategy||(t.Strategy={}))[ws.Standard=0]="Standard";var Ns,Ms=t.Syringe.defineToken(""),ks=t.Syringe.defineToken("");(Ns=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",Ns.ATTR_MODIFIED="DOMAttrModified",Ns.INSERTED="DOMNodeInserted",Ns.CHILD_INSERTED="child-inserted",Ns.REMOVED="removed",Ns.CHILD_REMOVED="child-removed",Ns.MOUNTED="DOMNodeInsertedIntoDocument",Ns.UNMOUNTED="DOMNodeRemovedFromDocument",Ns.BOUNDS_CHANGED="bounds-changed",Ns.RENDER_ORDER_CHANGED="render-order-changed",Ns.CULLED="culled";var Ps=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 fe(e,t),e}(Ts);Ps.ADDITION=2,Ps.MODIFICATION=1,Ps.REMOVAL=3;var _s=0;var Cs,As=new Es(t.ElementEvent.CHILD_INSERTED,{child:null}),Os=new Ps(t.ElementEvent.INSERTED,null,"","","",0,"",""),Is=new Ps(t.ElementEvent.REMOVED,null,"","","",0,"",""),Rs=new Es(t.ElementEvent.DESTROY),Ls=new Es(t.ElementEvent.CHILD_REMOVED,{child:null}),Ds=function(e){function n(){for(var n,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];return(n=e.call.apply(e,[this].concat(i))||this).sceneGraphService=jt.get(ks),n.entity=_s++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:on(0,0,0),localRotation:In(0,0,0,1),localScale:on(1,1,1),localTransform:Ae(),localSkew:Bn(0,0),position:on(0,0,0),rotation:In(0,0,0,1),scaling:on(1,1,1),worldTransform:Ae(),origin:on(0,0,0)},n.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.id=void 0,n.name=void 0,n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle={anchor:gi,opacity:gi,fillOpacity:gi,strokeOpacity:gi,fill:gi,stroke:gi,transform:gi,transformOrigin:gi,visibility:gi,pointerEvents:gi,lineWidth:gi,lineCap:gi,lineJoin:gi,increasedLineWidthForHitTesting:gi,fontSize:gi,fontFamily:gi,fontStyle:gi,fontWeight:gi,fontVariant:gi,textAlign:gi,textBaseline:gi,textTransform:gi,zIndex:gi,filter:gi,shadowType:gi},n.parsedStyle={},n.attributes={},n}fe(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw new Error(uo)},r.appendChild=function(t,e){return this.sceneGraphService.attach(t,this,e),As.detail.child=t,this.dispatchEvent(As),Os.relatedNode=this,t.dispatchEvent(Os),t},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){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},r.removeChild=function(t){return Is.relatedNode=this,t.dispatchEvent(Is),Ls.detail.child=t,this.dispatchEvent(Ls),this.sceneGraphService.detach(t),t},r.removeChildren=function(){var t=this;this.childNodes.slice().forEach((function(e){t.removeChild(e),e.destroy()}))},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(){return this.parentNode?this.parentNode.removeChild(this):this},r.destroy=function(){this.dispatchEvent(Rs),this.remove(),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=this.attributes[t];if(void 0===e){var n=Vr(t.toString(),"");e=this.attributes[n[0]]}return Mr(e)?null:e},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(uo)},r.getAttributeNode=function(t){throw new Error(uo)},r.getAttributeNodeNS=function(t,e){throw new Error(uo)},r.hasAttributeNS=function(t,e){throw new Error(uo)},r.removeAttributeNS=function(t,e){throw new Error(uo)},r.removeAttributeNode=function(t){throw new Error(uo)},r.setAttributeNS=function(t,e,n){throw new Error(uo)},r.setAttributeNode=function(t){throw new Error(uo)},r.setAttributeNodeNS=function(t){throw new Error(uo)},r.toggleAttribute=function(t,e){throw new Error(uo)},le(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}(xs),Bs=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 ba,e.movement=new ba,e.offset=new ba,e.global=new ba,e.screen=new ba,e}fe(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(uo)},le(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}(Ts),Us=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}fe(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!")},n.clone=function(){return this.manager.clonePointerEvent(this)},e}(Bs),Gs=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 fe(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Bs),js={},Fs=[];t.DisplayObjectPool=function(){function e(){}var n=e.prototype;return n.getByEntity=function(t){return js[t]},n.getAll=function(){return Object.keys(js).map((function(t){return js[t]}))},n.add=function(e,n){js[e]=n,n.nodeName===t.Shape.HTML&&Fs.push(n)},n.remove=function(e){var n=js[e];if(n&&(delete js[e],n.nodeName===t.Shape.HTML)){var r=Fs.indexOf(n);Fs.splice(r,1)}},n.getHTMLs=function(){return Fs},e}(),t.DisplayObjectPool=jn([ct()],t.DisplayObjectPool);var Vs,Ys=function(e){function n(n){var r,i;return(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.activeAnimations=[],i.displayObjectPool=jt.get(t.DisplayObjectPool),i.styleValueRegistry=jt.get(fi),i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=he({},i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,{anchor:[0,0],fill:xi,stroke:xi,transform:[],zIndex:0,filter:[],shadowType:"outer"},i.config.initialParsedStyle),Object.assign(i.attributes,{anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""}),i.initAttributes(i.config.style),i.style=new Proxy({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}}),i.displayObjectPool.add(i.entity,ve(i)),i}fe(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),this.displayObjectPool.remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var r=he({},this.attributes);for(var i in r){var o=r[i];o instanceof n&&(r[i]=o.cloneNode(t)),e&&(r[i]=e(i,o))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;this.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0,usedAttributes:["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]}),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Vr(t,n),o=i[0],a=i[1];Or(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.parsedStyle.clipPathTargets&&this.parsedStyle.clipPathTargets.length&&this.parsedStyle.clipPathTargets.forEach((function(e){o.sceneGraphService.dirtifyToRoot(e),e.dispatchEvent(new Ps(t.ElementEvent.ATTR_MODIFIED,e,o,o,"clipPath",Ps.MODIFICATION,o,o)),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback("clipPath",o,o)})),a.dirty=!0;var c=this.parsedStyle[e];this.isConnected&&(Cs||(Cs=new Ps(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Ps.MODIFICATION,null,null)),Cs.relatedNode=this,Cs.prevValue=s,Cs.newValue=n,Cs.attrName=e,Cs.prevParsedValue=u,Cs.newParsedValue=c,this.dispatchEvent(Cs)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(e,s,n,u,c)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new xa(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,fo(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,fo(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,fo(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,fo(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,fo(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=fo(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=fo(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=go(nn(),this.sceneGraphService.getWorldTransform(this));return vo(t[2])},r.getLocalEulerAngles=function(){var t=go(nn(),this.sceneGraphService.getLocalRotation(this));return vo(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 Mr(e)&&Mr(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return Mr(e)&&Mr(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.setLocalSkew=function(t,e){return this.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return this.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return this.sceneGraphService.getLocalSkew(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.parsedStyle.clipPathTargets&&this.parsedStyle.clipPathTargets.length&&(i=null===(r=this.parsedStyle.clipPathTargets[0].ownerDocument)||void 0===r?void 0:r.timeline);return i?i.play(this,t,e):null},r.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},r.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},r.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},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.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?kr(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.getMatrix=function(t){var e=t||this.getWorldTransform(),n=We(nn(),e),r=n[0],i=n[1],o=qe(nn(),e),a=o[0],s=o[1],u=Xe(bn(),e),c=go(nn(),u);return mo(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=To(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=To(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},r.show=function(){this.style.visibility="visible"},r.hide=function(){this.style.visibility="hidden"},le(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(Ds),Hs=["style"],Ws=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,Hs);return e.call(this,he({type:t.Shape.CIRCLE,style:he({cx:"",cy:"",r:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))||this}return fe(n,e),n}(Ys),qs=["style"],Xs=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=de(r,qs);return(n=t.call(this,he({style:he({x:"",y:""},i)},o))||this).isCustomElement=!0,n}return fe(e,t),e}(Ys),zs=["style"],Ks=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,zs);return e.call(this,he({type:t.Shape.ELLIPSE,style:he({cx:"",cy:"",rx:"",ry:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))||this}return fe(n,e),n}(Ys),Zs=["style"],Js=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,Zs);return e.call(this,he({type:t.Shape.GROUP,style:he({x:"",y:"",width:"",height:""},i)},o))||this}return fe(n,e),n}(Ys),Qs=["style"],$s=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=de(i,Qs);return(r=e.call(this,he({type:t.Shape.HTML,style:he({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,r}fe(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 ma;return a.setMinMax(on(i,o,0),on(i+n.width,o+n.height,0)),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=De(Ae(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!ma.isEmpty(e)){var n=new ma;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(Ys),tu=["style"],eu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,tu);return e.call(this,he({type:t.Shape.IMAGE,style:he({x:"",y:"",img:"",width:"",height:""},i)},o))||this}return fe(n,e),n}(Ys),nu=["style"],ru=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=de(i,nu);(r=e.call(this,he({type:t.Shape.LINE,style:he({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0;var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&u instanceof Ys&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&c instanceof Ys&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}fe(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Ys&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&r instanceof Ys&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=function(t){var e=this.parsedStyle,n=e.x1,r=e.x2,i=e.y1,o=e.y2,a=e.defX,s=e.defY,u=t?e.markerStart:e.markerEnd;if(u&&u instanceof Ys){var c,l,h,f,p,d,v;t?(f=n-a,p=i-s,l=r-n,h=o-i,d=e.markerStartOffset||0,v=this.markerStartAngle):(f=r-a,p=o-s,l=n-r,h=i-o,d=e.markerEndOffset||0,v=this.markerEndAngle),c=Math.atan2(h,l),u.setLocalEulerAngles(180*c/Math.PI+v),u.setLocalPosition(f+Math.cos(c)*d,p+Math.sin(c)*d)}},r.getPoint=function(t){var e=this.parsedStyle,n=e.defX,r=e.defY,i=Ha.pointAt(e.x1,e.y1,e.x2,e.y2,t),o=i.x,a=i.y,s=dn(nn(),on(o-n,a-r,0),this.getLocalTransform());return new ba(s[0],s[1])},r.getPointAtLength=function(t){return this.getPoint(t/this.getTotalLength())},r.getTotalLength=function(){var t=this.parsedStyle;return Ha.length(t.x1,t.y1,t.x2,t.y2)},n}(Ys),iu=["style"],ou=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=de(i,iu);(r=e.call(this,he({type:t.Shape.PATH,style:he({path:"",miterLimit:""},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof Ys&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof Ys&&r.placeMarkerMid(l),c&&c instanceof Ys&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}fe(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Ys&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof Ys&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&a instanceof Ys){var s,u,c,l,h,f,p;if(t){var d=this.getStartTangent(),v=d[0],y=d[1];l=y[0]-i,h=y[1]-o,u=v[0]-y[0],c=v[1]-y[1],f=n||0,p=this.markerStartAngle}else{var g=this.getEndTangent(),m=g[0],T=g[1];l=T[0]-i,h=T[1]-o,u=m[0]-T[0],c=m[1]-T[1],f=r||0,p=this.markerEndAngle}s=Math.atan2(c,u),a.setLocalEulerAngles(180*s/Math.PI+p),a.setLocalPosition(l+Math.cos(s)*f,h+Math.sin(s)*f)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&t instanceof Ys)for(var o=1;n.length-1>o;o++){var a=n[o].currentPoint,s=a[0],u=a[1],c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return Oo(this)},r.getPointAtLength=function(t){var e=this.parsedStyle,n=e.defX,r=e.defY,i=function(t,e,n){return Er(t,e,Gn(Gn({},n),{bbox:!1,length:!0})).point}(e.path.absolutePath,t),o=i.x,a=i.y,s=dn(nn(),on(o-n,a-r,0),this.getLocalTransform());return new ba(s[0],s[1])},r.getPoint=function(t){return this.getPointAtLength(t*Oo(this))},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}(Ys),au=["style"],su=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=de(i,au);(r=e.call(this,he({type:t.Shape.POLYGON,style:he({points:"",miterLimit:"",isClosed:!0},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof Ys&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof Ys&&r.placeMarkerMid(l),c&&c instanceof Ys&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}fe(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Ys&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof Ys&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ys&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY,o=t?e.markerStart:e.markerEnd;if(o&&o instanceof Ys){var a,s,u,c,l,h,f;if(c=n[0][0]-r,l=n[0][1]-i,t)s=n[1][0]-n[0][0],u=n[1][1]-n[0][1],h=e.markerStartOffset||0,f=this.markerStartAngle;else{var p=n.length;this.style.isClosed?(s=n[p-1][0]-n[0][0],u=n[p-1][1]-n[0][1]):(c=n[p-1][0]-r,l=n[p-1][1]-i,s=n[p-2][0]-n[p-1][0],u=n[p-2][1]-n[p-1][1]),h=e.markerEndOffset||0,f=this.markerEndAngle}a=Math.atan2(u,s),o.setLocalEulerAngles(180*a/Math.PI+f),o.setLocalPosition(c+Math.cos(a)*h,l+Math.sin(a)*h)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&t instanceof Ys)for(var o=1;(this.style.isClosed?n.length:n.length-1)>o;o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},n}(Ys),uu=["style"],cu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,uu);return e.call(this,he({type:t.Shape.POLYLINE,style:he({points:"",miterLimit:"",isClosed:!1},i)},o))||this}fe(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPointAtLength=function(t){return this.getPoint(t/this.getTotalLength())},r.getPoint=function(t){var e=this.parsedStyle,n=e.defX,r=e.defY,i=e.points,o=i.points,a=0,s=0;i.segments.forEach((function(e,n){e[0]>t||t>e[1]||(a=(t-e[0])/(e[1]-e[0]),s=n)}));var u=Ha.pointAt(o[s][0],o[s][1],o[s+1][0],o[s+1][1],a),c=u.x,l=u.y,h=dn(nn(),on(c-n,l-r,0),this.getLocalTransform());return new ba(h[0],h[1])},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}(su),lu=["style"],hu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,lu);return e.call(this,he({type:t.Shape.RECT,style:he({x:"",y:"",width:"",height:"",radius:""},i)},o))||this}return fe(n,e),n}(Ys),fu=["style"],pu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=de(r,fu);return e.call(this,he({type:t.Shape.TEXT,style:he({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},i)},o))||this}fe(n,e);var r=n.prototype;return r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},r.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},n}(Ys);(Vs=t.RenderReason||(t.RenderReason={}))[Vs.CAMERA_CHANGED=0]="CAMERA_CHANGED",Vs[Vs.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Vs[Vs.NONE=2]="NONE";var du=t.Syringe.defineToken("");t.EventService=function(){function t(t,e,n,r){var i=this;this.renderingContext=void 0,this.contextService=void 0,this.canvasConfig=void 0,this.displayObjectPool=void 0,this.rootTarget=void 0,this.emitter=new gs.EventEmitter,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=Ae(),this.tmpVec3=nn(),this.onPointerDown=function(){var t=ue(ae().mark((function t(e){var n;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,i.createPointerEvent(e);case 4:i.dispatchEvent(n=t.sent,"pointerdown"),"touch"===n.pointerType?i.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||i.dispatchEvent(n,2===n.button?"rightdown":"mousedown"),i.trackingData(e.pointerId).pressTargetsByButton[e.button]=n.composedPath(),i.freeEvent(n);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUp=function(){var t=ue(ae().mark((function t(e){var n,r,o,a,s,u,c,l,h;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return n=performance.now(),t.next=5,i.createPointerEvent(e);case 5:if(i.dispatchEvent(r=t.sent,"pointerup"),"touch"===r.pointerType?i.dispatchEvent(r,"touchend"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||i.dispatchEvent(r,2===r.button?"rightup":"mouseup"),o=i.trackingData(e.pointerId),a=i.findMountedTarget(o.pressTargetsByButton[e.button]),s=a,a&&!r.composedPath().includes(a)){for(u=a;u&&!r.composedPath().includes(u);)r.currentTarget=u,i.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?i.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||i.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),xs.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[e.button],s=u}s&&((l=i.clonePointerEvent(r,"click")).target=s,l.path=[],o.clicksByButton[e.button]||(o.clicksByButton[e.button]={clickCount:0,target:l.target,timeStamp:n}),(h=o.clicksByButton[e.button]).target===l.target&&200>n-h.timeStamp?++h.clickCount:h.clickCount=1,h.target=l.target,h.timeStamp=n,l.detail=h.clickCount,(null===(c=r.detail)||void 0===c?void 0:c.preventClick)||("mouse"!==l.pointerType&&"touch"!==l.pointerType||i.dispatchEvent(l,"click"),i.dispatchEvent(l,"pointertap")),i.freeEvent(l)),i.freeEvent(r);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerMove=function(){var t=ue(ae().mark((function t(e){var n,r,o,a,s,u,c,l,h,f;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,i.createPointerEvent(e);case 4:if(r="mouse"===(n=t.sent).pointerType||"pen"===n.pointerType,o=i.trackingData(e.pointerId),a=i.findMountedTarget(o.overTargets),!o.overTargets||a===n.target){t.next=23;break}return s="mousemove"===e.type?"mouseout":"pointerout",t.next=12,i.createPointerEvent(e,s,a||void 0);case 12:if(i.dispatchEvent(u=t.sent,"pointerout"),r&&i.dispatchEvent(u,"mouseout"),n.composedPath().includes(a)){t.next=22;break}return t.next=18,i.createPointerEvent(e,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!n.composedPath().includes(c.target);)c.currentTarget=c.target,i.notifyTarget(c),r&&i.notifyTarget(c,"mouseleave"),xs.isNode(c.target)&&(c.target=c.target.parentNode);i.freeEvent(c);case 22:i.freeEvent(u);case 23:if(a===n.target){t.next=38;break}l=i.clonePointerEvent(n,"mousemove"===e.type?"mouseover":"pointerover"),i.dispatchEvent(l,"pointerover"),r&&i.dispatchEvent(l,"mouseover"),h=a&&xs.isNode(a)&&a.parentNode;case 29:if(!h||h===(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode)){t.next=35;break}if(h!==n.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode)){for((f=i.clonePointerEvent(n,"pointerenter")).eventPhase=f.AT_TARGET;f.target&&f.target!==a&&f.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)f.currentTarget=f.target,i.notifyTarget(f),r&&i.notifyTarget(f,"mouseenter"),xs.isNode(f.target)&&(f.target=f.target.parentNode);i.freeEvent(f)}i.freeEvent(l);case 38:i.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&i.dispatchEvent(n,"touchmove"),r&&(i.dispatchEvent(n,"mousemove"),i.cursor=i.getCursor(n.target)),o.overTargets=n.composedPath(),i.freeEvent(n);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOut=function(){var t=ue(ae().mark((function t(e){var n,r,o,a,s;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:if(!(n=i.trackingData(e.pointerId)).overTargets){t.next=19;break}return r="mouse"===e.pointerType||"pen"===e.pointerType,o=i.findMountedTarget(n.overTargets),t.next=8,i.createPointerEvent(e,"pointerout",o||void 0);case 8:return i.dispatchEvent(a=t.sent),r&&i.dispatchEvent(a,"mouseout"),t.next=13,i.createPointerEvent(e,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)s.currentTarget=s.target,i.notifyTarget(s),r&&i.notifyTarget(s,"mouseleave"),xs.isNode(s.target)&&(s.target=s.target.parentNode);n.overTargets=null,i.freeEvent(a),i.freeEvent(s);case 19:i.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOver=function(){var t=ue(ae().mark((function t(e){var n,r,o,a;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return n=i.trackingData(e.pointerId),t.next=5,i.createPointerEvent(e);case 5:for(o="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,i.dispatchEvent(r,"pointerover"),o&&i.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(i.cursor=i.getCursor(r.target)),(a=i.clonePointerEvent(r,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)a.currentTarget=a.target,i.notifyTarget(a),o&&i.notifyTarget(a,"mouseenter"),xs.isNode(a.target)&&(a.target=a.target.parentNode);n.overTargets=r.composedPath(),i.freeEvent(r),i.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var t=ue(ae().mark((function t(e){var n,r,o,a;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Us){t.next=2;break}return t.abrupt("return");case 2:return n=i.trackingData(e.pointerId),r=i.findMountedTarget(n.pressTargetsByButton[e.button]),t.next=6,i.createPointerEvent(e);case 6:if(o=t.sent,r){for(a=r;a;)o.currentTarget=a,i.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||i.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),xs.isNode(a)&&(a=a.parentNode);delete n.pressTargetsByButton[e.button]}i.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onWheel=function(){var t=ue(ae().mark((function t(e){var n;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Gs){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,i.createWheelEvent(e);case 4:i.dispatchEvent(n=t.sent),i.freeEvent(n);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.renderingContext=t,this.contextService=e,this.canvasConfig=n,this.displayObjectPool=r}var e=t.prototype;return e.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)},e.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new ba(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new ba(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.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=Ue(this.tmpMatrix,u,s),l=sn(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return dn(l,l,c),new ba(l[0],l[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=Ue(this.tmpMatrix,n,r),o=sn(this.tmpVec3,t.x,t.y,0);dn(this.tmpVec3,this.tmpVec3,i);var a=this.canvasConfig;return new ba((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},e.setPickHandler=function(t){this.pickHandler=t},e.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}))},e.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)}},e.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emitter.emit(e||t.type,t)},e.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}}},e.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++)xs.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=function(){var t=ue(ae().mark((function t(e){var n,r,i,o,a;return ae().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)}}(),e.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},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=ge(this.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},e.pickTarget=function(){var t=ue(ae().mark((function t(e){return ae().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)}}(),e.createPointerEvent=function(){var t=ue(ae().mark((function t(e,n,r){var i,o;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(Us),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)}}(),e.createWheelEvent=function(){var t=ue(ae().mark((function t(e){var n,r;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Gs),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)}}(),e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(Gs);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=e.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(Us);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},e.copyPointerData=function(t,e){t instanceof Us&&e instanceof Us&&(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)},e.copyMouseData=function(t,e){t instanceof Bs&&e instanceof Bs&&(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))},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.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)},e.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},e.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)},e.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)},e.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)},e.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||xs.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=Ds.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=xs.isNode(e)&&e.parentNode}},t}(),t.EventService=jn([ct(),Fn(0,lt(du)),Fn(1,lt(ys)),Fn(2,lt(_o)),Fn(3,lt(t.DisplayObjectPool))],t.EventService);var vu,yu,gu,mu=t.Syringe.defineToken(""),Tu=t.Syringe.defineToken("",{multiple:!1});(vu=t.CameraType||(t.CameraType={}))[vu.ORBITING=0]="ORBITING",vu[vu.EXPLORING=1]="EXPLORING",vu[vu.TRACKING=2]="TRACKING",(yu=t.CameraTrackingMode||(t.CameraTrackingMode={}))[yu.DEFAULT=0]="DEFAULT",yu[yu.ROTATIONAL=1]="ROTATIONAL",yu[yu.TRANSLATIONAL=2]="TRANSLATIONAL",yu[yu.CINEMATIC=3]="CINEMATIC",(gu=t.CameraProjectionMode||(t.CameraProjectionMode={}))[gu.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",gu[gu.PERSPECTIVE=1]="PERSPECTIVE";var Eu={UPDATED:"updated"},bu=2e-4;t.Camera=function(){function e(){this.canvas=void 0,this.eventEmitter=new gs.EventEmitter,this.matrix=Ae(),this.right=on(1,0,0),this.up=on(0,1,0),this.forward=on(0,0,1),this.position=on(0,0,1),this.focalPoint=on(0,0,0),this.distanceVector=on(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=Ae(),this.projectionMatrixInverse=Ae(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new Ea,this.orthoMatrix=Ae()}var n=e.prototype;return n.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},n.getProjectionMode=function(){return this.projectionMode},n.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},n.getPerspectiveInverse=function(){return this.projectionMatrixInverse},n.getFrustum=function(){return this.frustum},n.getPosition=function(){return this.position},n.getFocalPoint=function(){return this.focalPoint},n.getDollyingStep=function(){return this.dollyingStep},n.getNear=function(){return this.near},n.getFar=function(){return this.far},n.getZoom=function(){return this.zoom},n.getOrthoMatrix=function(){return this.orthoMatrix},n.getView=function(){return this.view},n.setEnableUpdate=function(t){this.enableUpdate=t},n.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},n.setProjectionMode=function(t){return this.projectionMode=t,this},n.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},n.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},n.getViewTransform=function(){return De(Ae(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=Ye(Ae(),[t,e,0]);this.jitteredProjectionMatrix=Ue(Ae(),n,this.projectionMatrix)},n.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},n.setMatrix=function(t){return this.matrix=t,this._update(),this},n.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},n.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},n.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},n.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},n.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},n.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},n.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},n.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y;this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]});return this.pan(r-o.x,i-o.y),this},n.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(po(.5*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 function(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);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}(this.projectionMatrix,c,c+u,a,a-s,e,this.far),je(this.projectionMatrix,this.projectionMatrix,on(1,-1,1)),De(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},n.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,f=l-u,p=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;p=(f+=y*this.view.offsetX)+y*this.view.width,v=(d-=g*this.view.offsetY)-g*this.view.height}return Qe(this.projectionMatrix,f,p,v,d,o,a),je(this.projectionMatrix,this.projectionMatrix,on(1,-1,1)),De(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},n.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=fo(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},n.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=on(0,1,0);if(this.focalPoint=fo(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=cn(nn(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=rn(o),s=vo(Math.asin(n/a)),u=90+vo(Math.atan2(r,e)),c=Ae();Ve(c,c,po(u)),Fe(c,c,po(s)),i=dn(nn(),[0,1,0],c)}return De(this.matrix,$e(Ae(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},n.getDistance=function(){return this.distance},n.getDistanceVector=function(){return this.distanceVector},n.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,bu>this.distance&&(this.distance=bu),this.dollyingStep=this.distance/100;var e=nn(),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},n.setMaxDistance=function(t){return this.maxDistance=t,this},n.setMinDistance=function(t){return this.minDistance=t,this},n.setAzimuth=function(e){return this.azimuth=ho(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},n.getAzimuth=function(){return this.azimuth},n.setElevation=function(e){return this.elevation=ho(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},n.getElevation=function(){return this.elevation},n.setRoll=function(e){return this.roll=ho(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},n.getRoll=function(){return this.roll},n._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},n.computeMatrix=function(){var e=xn(bn(),[0,0,1],po(this.roll));Re(this.matrix);var n=xn(bn(),[1,0,0],po((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=xn(bn(),[0,1,0],po((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=wn(bn(),r,n);i=wn(bn(),i,e);var o=Ke(Ae(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(Ge(this.matrix,this.matrix,this.focalPoint),Ue(this.matrix,this.matrix,o),Ge(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(Ge(this.matrix,this.matrix,this.position),Ue(this.matrix,this.matrix,o))},n._setPosition=function(t,e,n){this.position=fo(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()},n._getAxes=function(){an(this.right,fo(En(Tn(),[1,0,0,0],this.matrix))),an(this.up,fo(En(Tn(),[0,1,0,0],this.matrix))),an(this.forward,fo(En(Tn(),[0,0,1,0],this.matrix))),hn(this.right,this.right),hn(this.up,this.up),hn(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=rn(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=vo(Math.asin(n/i)),this.azimuth=vo(Math.atan2(-e,-r))):(this.elevation=-vo(Math.asin(n/i)),this.azimuth=-vo(Math.atan2(-e,-r)))},n._getPosition=function(){an(this.position,fo(En(Tn(),[0,0,0,1],this.matrix))),this._getDistance()},n._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=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)),un(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=cn(nn(),this.focalPoint,this.position),this.distance=rn(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=xn(bn(),[0,0,1],-this.roll*Math.PI/180);ze(this.orthoMatrix,n,on((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),on(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=Ue(Ae(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Eu.UPDATED)}},n.rotate=function(t,e,n){throw new Error(uo)},n.pan=function(t,e){throw new Error(uo)},n.dolly=function(t){throw new Error(uo)},n.createLandmark=function(t,e){throw new Error(uo)},n.gotoLandmark=function(t,e){throw new Error(uo)},e}(),t.Camera=jn([ut({token:Tu})],t.Camera);var xu=t.Syringe.defineToken("");t.RenderingService=function(){function e(e,n,r,i,o,a){this.renderingPluginProvider=void 0,this.canvasConfig=void 0,this.renderingContext=void 0,this.sceneGraphService=void 0,this.styleValueRegistry=void 0,this.camera=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new Es(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new Vo,dirtycheck:new ia(["object"]),cull:new ia(["object","camera"]),beginFrame:new Qo([]),beforeRender:new Qo(["objectToRender"]),render:new Qo(["objectToRender"]),afterRender:new Qo(["objectToRender"]),endFrame:new Qo([]),destroy:new Qo([]),pick:new qo(["result"]),pickSync:new ia(["result"]),pointerDown:new Qo(["event"]),pointerUp:new Qo(["event"]),pointerMove:new Qo(["event"]),pointerOut:new Qo(["event"]),pointerOver:new Qo(["event"]),pointerWheel:new Qo(["event"]),pointerCancel:new Qo(["event"])},this.renderingPluginProvider=e,this.canvasConfig=n,this.renderingContext=r,this.sceneGraphService=i,this.styleValueRegistry=o,this.camera=a}var n=e.prototype;return n.init=function(){var t=ue(ae().mark((function t(){var e=this;return ae().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.disableDirtyRectangleRendering=function(){return!this.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering||this.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},n.render=function(t){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.sceneGraphService.triggerPendingEvents(),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root,t),this.hooks.beginFrame.call(),this.renderingContext.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),this.renderingContext.renderListCurrentFrame=[],this.renderingContext.renderReasons.clear())},n.renderDisplayObject=function(t,e){var n=this,r=e.renderer.getConfig(),i=r.enableDirtyCheck,o=r.enableCulling;this.styleValueRegistry.recalc(t);var a=i?this.hooks.dirtycheck.call(t):t;if(a){var s=o?this.hooks.cull.call(a,this.camera):a;s&&(this.stats.rendered++,this.renderingContext.renderListCurrentFrame.push(s))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var u=t.sortable,c=!1;u.dirty&&(u.sorted=t.childNodes.slice().sort(oo),c=!0,u.dirty=!1),(u.sorted||t.childNodes).forEach((function(t){n.renderDisplayObject(t,e)})),c&&t.forEach((function(t){n.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.dispatchEvent(n.renderOrderChangedEvent)}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),t.RenderingService=jn([ct(),Fn(0,Ft(xu)),Fn(1,lt(_o)),Fn(2,lt(du)),Fn(3,lt(ks)),Fn(4,lt(fi)),Fn(5,lt(mu))],t.RenderingService);var wu=t.Syringe.defineToken(""),Su=t.Syringe.defineToken("",{multiple:!1}),Nu=/\[\s*(.*)=(.*)\s*\]/;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((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));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&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));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(Nu),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 Mr(n)?"":n.toString?n.toString():""},t}(),t.DefaultSceneGraphSelector=jn([ct({token:Su})],t.DefaultSceneGraphSelector),t.DefaultSceneGraphService=function(){function e(e){var n,r,i,o,a,s,u,c,l=this;this.sceneGraphSelectorFactory=void 0,this.pendingEvents=[],this.boundsChangedEvent=new Es(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=bn(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=on(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=bn();Mn(a,e[0],e[1],e[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);Rn(n,u),Nn(n,n),wn(a,n,a),wn(o.localRotation,a,s),Dn(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,e)}),this.rotateLocal=(r=bn(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=on(e,n,i));var o=t.transformable;Mn(r,e[0],e[1],e[2]),Ln(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}),this.setEulerAngles=(i=bn(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=on(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Mn(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);Rn(i,Nn(bn(),a)),Ln(o.localRotation,o.localRotation,i),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=on(e,n,r));var i=t.transformable;vn(e,nn())||(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,f=i*h-o*l,p=o*c-r*h,d=r*l-i*c,v=2*n[3];l*=v,h*=v,p*=2,d*=2,t[0]=a+(c*=v)+(f*=2),t[1]=s+l+p,t[2]=u+h+d}(e,e,i.localRotation),un(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(o=Ae(),a=nn(),function(t,e){var n=t.transformable;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,vn(l.getPosition(t),a)||(an(n.position,a),null!==t.parentNode&&t.parentNode.transformable?(Oe(o,t.parentNode.transformable.worldTransform),De(o,o),dn(n.localPosition,a,o)):an(n.localPosition,a),l.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=nn();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,vn(r.localPosition,t)||(an(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(s=nn(),u=nn(),c=nn(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=sn(u,e,n,r)),vn(e,s)||(un(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=bn();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=In(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);Rn(t,s),Nn(t,t),wn(a.localRotation,t,n),Dn(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.calcLocalTransform=function(){var t=Ae(),e=nn(),n=In(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(ze(r.localTransform,r.localRotation,r.localPosition,on(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=Re(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),Ue(r.localTransform,r.localTransform,i)}var o=ze(t,n,e,r.localScale,r.origin);Ue(r.localTransform,r.localTransform,o)}else ze(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.sceneGraphSelectorFactory=e}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){var r,i;t.parentNode&&this.detach(t),t.parentNode=e,Mr(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var o=e.sortable;((null==o||null===(r=o.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(o.dirty=!0);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;((null==i||null===(e=i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(i.dirty=!0);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),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=on(e,n,r));var i=t.transformable;if(!vn(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=on(e,n,r));var i=t.transformable;Mn(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=on(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},n.setLocalScale=function(t,e){var n=t.transformable,r=on(e[0],e[1],e[2]||n.localScale[2]);vn(r,n.localScale)||(an(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=In(e,n,r,i));var o=t.transformable;Rn(o.localRotation,e),this.dirtifyLocal(t,o)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=Bn(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],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),this.dirtifyToRoot(t,!0)},n.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){e.has(n.entity)||(t.boundsChangedEvent.detail=r,n.dispatchEvent(t.boundsChangedEvent),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=t[0],r=t[1];r.affectChildren?e.forEach((function(t){n(t,r)})):n(e,r)})),this.pendingEvents=[]},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;){var r=n.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0),n=n.parentNode}this.pendingEvents.push([t,{affectChildren:e}])},n.getPosition=function(t){var e=t.transformable;return We(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return Xe(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return qe(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.getLocalSkew=function(t){return t.transformable.localSkew},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=We(nn(),e),r=Xe(bn(),e),i=qe(nn(),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]),this.setLocalSkew(t,[0,0])},n.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(ma.isEmpty(r))return null;var i=n||new ma;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new ma},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=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new ma).update(r.center,r.halfExtents))})),e){var a=ao(t);if(a){var s,u=this.getTransformedGeometryBounds(a.style.clipPath,!0);u&&(s=new ma).setFromTransformedAABB(u,this.getWorldTransform(a)),o?s&&(o=s.intersection(o)):o=s}}return o||(o=new ma),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},n.getLocalBounds=function(t){if(t.parentNode){var e=Ae();t.parentNode.transformable&&(e=De(Ae(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!ma.isEmpty(n)){var r=new ma;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);ma.isEmpty(i)||(r=new ma).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 xa(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new xa((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},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&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?Ue(e.worldTransform,r.worldTransform,e.localTransform):Oe(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}(),t.DefaultSceneGraphService=jn([ct({token:ks}),Fn(0,lt(wu))],t.DefaultSceneGraphService);var Mu=function(){function t(t){this.sceneGraphService=void 0,this.sceneGraphService=t}return t.prototype.calculator=function(t,e,n,r){var i=this;if(n instanceof ke&&(n=null),e&&e!==n&&e.parsedStyle.clipPathTargets){var o=e.parsedStyle.clipPathTargets.indexOf(r);e.parsedStyle.clipPathTargets.splice(o,1)}return n&&(n.parsedStyle.clipPathTargets||(n.parsedStyle.clipPathTargets=[]),n.parsedStyle.clipPathTargets.push(r)),r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}();Mu=jn([ct({token:{token:yi,named:t.PropertySyntax.CLIP_PATH}}),Fn(0,lt(ks))],Mu);var ku=function(){function t(){this.parser=va,this.mixer=ya}return t.prototype.calculator=function(t,e,n,r){return n instanceof ke?"none"===n.value?xi:wi:n},t}();ku=jn([ct({token:[{token:yi,named:t.PropertySyntax.PAINT},{token:yi,named:t.PropertySyntax.COLOR}]})],ku);var Pu=function(){function t(){this.parser=Oa}return t.prototype.calculator=function(t,e,n){return n instanceof ke?[]:n},t}();function _u(t){var e=t.parsedStyle.fontSize;return Mr(e)?null:e}Pu=jn([ct({token:{token:yi,named:t.PropertySyntax.FILTER}})],Pu);var Cu=function(){function e(){this.parser=Na,this.mixer=La}return e.prototype.calculator=function(e,n,r,i,o){if(!Qr.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=_u(i.parentNode);if(a)return a*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=_u(i.ownerDocument.documentElement);if(u)return u*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}},e}();Cu=jn([ct({token:[{token:yi,named:t.PropertySyntax.LENGTH_PERCENTAGE},{token:yi,named:t.PropertySyntax.LENGTH}]})],Cu);var Au=function(){function t(){this.mixer=Ba}var e=t.prototype;return e.parser=function(t){var e=_a(Cr(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}();Au=jn([ct({token:{token:yi,named:t.PropertySyntax.LENGTH_PERCENTAGE_12}})],Au);var Ou=function(){function t(){this.mixer=Ba}var e=t.prototype;return e.parser=function(t){var e=_a(Cr(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]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}();Ou=jn([ct({token:{token:yi,named:t.PropertySyntax.LENGTH_PERCENTAGE_14}})],Ou);var Iu=function(e){function n(){return e.apply(this,arguments)||this}return fe(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;Mr(a)||(n=a),Mr(s)||(r=s);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1,u.x2),r=Math.min(c,l),i=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:Mr(e.parsedStyle.x)||(n=e.parsedStyle.x),Mr(e.parsedStyle.y)||(r=e.parsedStyle.y)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0),!Mr(n)||!Mr(r)||!Mr(i)){var h=e.getLocalPosition(),f=h[0],p=h[1],d=h[2];e.setLocalPosition(Mr(n)?f:n,Mr(r)?p:r,Mr(i)?d:i)}},n}(Cu);Iu=jn([ct({token:{token:yi,named:t.PropertySyntax.COORDINATE}})],Iu);var Ru=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof ke&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o},t}();Ru=jn([ct({token:{token:yi,named:t.PropertySyntax.MARKER}})],Ru);var Lu=function(){function t(){this.mixer=La,this.parser=Ra}return t.prototype.calculator=function(t,e,n){return n.value},t}();Lu=jn([ct({token:{token:yi,named:t.PropertySyntax.NUMBER}})],Lu);var Du=function(){function e(){this.parser=Ra,this.mixer=Da(0,1)}var n=e.prototype;return n.calculator=function(t,e,n){return n.value},n.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);r&&e.setLocalPosition(r.x,r.y)}}},e}();Du=jn([ct({token:{token:yi,named:t.PropertySyntax.OFFSET_DISTANCE}})],Du);var Bu=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}();Bu=jn([ct({token:{token:yi,named:t.PropertySyntax.OFFSET_PATH}})],Bu);var Uu=function(){function t(){this.parser=Ra,this.mixer=Da(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}();Uu=jn([ct({token:{token:yi,named:t.PropertySyntax.OPACITY_VALUE}})],Uu);var Gu=function(){function e(){this.parser=ja,this.mixer=Fa}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof ke&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,zCommandIndexes:[],rect:new xa(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}();Gu=jn([ct({token:{token:yi,named:t.PropertySyntax.PATH}})],Gu);var ju=function(){function e(){this.parser=qa}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}();ju=jn([ct({token:{token:yi,named:t.PropertySyntax.LIST_OF_POINTS}})],ju);var Fu=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=Da(0,1/0),e}return fe(e,t),e}(Cu);Fu=jn([ct({token:{token:yi,named:t.PropertySyntax.SHADOW_BLUR}})],Fu);var Vu=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof ke?"unset"===n.value?"":n.value:n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}();Vu=jn([ct({token:{token:yi,named:t.PropertySyntax.TEXT}})],Vu);var Yu=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.value},t}();Yu=jn([ct({token:{token:yi,named:t.PropertySyntax.TEXT_TRANSFORM}})],Yu);var Hu=function(){function t(){this.tmpMat4=Ae(),this.parser=Ja,this.mixer=as}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof ke?[]:n},e.postProcessor=function(t){var e=this,n=t.parsedStyle,r=n.transform,i=n.defX,o=n.defY;r&&r.length&&(t.resetLocalTransform(),t.setLocalPosition(i,o),r.forEach((function(n){var r=n.t,a=n.d;if("scale"===r){var s=(null==a?void 0:a.map((function(t){return t.value})))||[1,1];t.scaleLocal(s[0],s[1],1)}else if("scalex"===r){var u=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(u[0],1,1)}else if("scaley"===r){var c=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(1,c[0],1)}else if("scalez"===r){var l=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(1,1,l[0])}else if("scale3d"===r){var h=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];t.scaleLocal(h[0],h[1],h[2])}else if("translate"===r){var f=a||[ci,ci];t.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===r){t.translateLocal((a||[ci])[0].value,0,0)}else if("translatey"===r){t.translateLocal(0,(a||[ci])[0].value,0)}else if("translatez"===r){t.translateLocal(0,0,(a||[ci])[0].value)}else if("translate3d"===r){var p=a||[ci,ci,ci];t.translateLocal(p[0].value,p[1].value,p[2].value)}else if("rotate"===r){t.rotateLocal(0,0,(a||[li])[0].value)}else if("rotatex"===r){t.rotateLocal((a||[li])[0].value,0,0)}else if("rotatey"===r){t.rotateLocal(0,(a||[li])[0].value,0)}else if("rotatez"===r){t.rotateLocal(0,0,(a||[li])[0].value)}else if("rotate3d"===r);else if("skew"===r){var d=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];t.setLocalSkew(po(d[0]),po(d[1]))}else if("skewx"===r){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0];t.setLocalSkew(po(v[0]),t.getLocalSkew()[1])}else if("skewy"===r){var y=(null==a?void 0:a.map((function(t){return t.value})))||[0];t.setLocalSkew(t.getLocalSkew()[0],po(y[0]))}else if("matrix"===r){var g=a.map((function(t){return t.value}));t.setLocalTransform(Ie(e.tmpMat4,g[0],g[1],0,0,g[2],g[3],0,0,0,0,1,0,g[4]+i,g[5]+o,0,1))}else"matrix3d"===r&&(Ie.apply(en,[e.tmpMat4].concat(a.map((function(t){return t.value})))),e.tmpMat4[12]+=i,e.tmpMat4[13]+=o,t.setLocalTransform(e.tmpMat4))})))},t}();Hu=jn([ct({token:{token:yi,named:t.PropertySyntax.TRANSFORM}})],Hu);var Wu=function(){this.parser=ss};Wu=jn([ct({token:{token:yi,named:t.PropertySyntax.TRANSFORM_ORIGIN}})],Wu);var qu=function(){function t(){this.parser=Ra}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.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}();qu=jn([ct({token:{token:yi,named:t.PropertySyntax.Z_INDEX}})],qu);var Xu=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.OFFSET_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.CLIP_PATH},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],zu={},Ku={},Zu={},Ju=Ir((function(t){return t.sort((function(t,e){return Zu[t]-Zu[e]}))})),Qu=nn(),$u=nn(),tc=nn(),ec=function(){function e(t,e,n){var r=this;this.sceneGraphService=void 0,this.propertySyntaxFactory=void 0,this.geometryUpdaterFactory=void 0,this.sceneGraphService=t,this.propertySyntaxFactory=e,this.geometryUpdaterFactory=n,Xu.forEach((function(t){r.registerMetadata(t)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){zu[e]=t,Zu[e]=t.p||0}))},n.unregisterMetadata=function(t){delete zu[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,forceUpdateGeometry:!1,usedAttributes:[]});var i=n.skipUpdateAttribute,o=n.skipParse,a=n.usedAttributes,s=n.forceUpdateGeometry,u=Object.keys(e);u.forEach((function(n){var r,o=Vr(n,e[n]),a=o[0];i||(t.attributes[a]=o[1]),!s&&(null===(r=zu[a])||void 0===r?void 0:r.l)&&(s=!0)})),o||u.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(u=Ju((null==a?void 0:a.length)?Array.from(new Set(u.concat(a))):u)).forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),s&&this.updateGeometry(t),u.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t)})),t.children.length&&u.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=zu[t],i=e;if((""===e||Mr(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=bi(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=bi(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=zu[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof ke){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)Mr(a)||(e=this.parseProperty(t,Br(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return Mr(u)?void this.addUnresolveProperty(n,t):u}}var c=o&&this.getPropertySyntax(o);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof ke?e.value:e}return i},n.postProcessProperty=function(t,e){var n=zu[t];if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}},n.addUnresolveProperty=function(t,e){Ku[t.entity]||(Ku[t.entity]=[]),-1===Ku[t.entity].indexOf(e)&&Ku[t.entity].push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){return!Ku[t.entity]||0===Ku[t.entity].length||Ku[t.entity].includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},n.recalc=function(t){var e=Ku[t.entity];if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),delete Ku[t.entity]}},n.updateGeometry=function(e){var n=this.geometryUpdaterFactory(e.nodeName);if(n){var r=e.geometry;r.contentBounds||(r.contentBounds=new ma),r.renderBounds||(r.renderBounds=new ma);var i=e.parsedStyle,o=n.update(i,e),a=o.width,s=o.height,u=o.depth,c=void 0===u?0:u,l=o.offsetX,h=void 0===l?0:l,f=o.offsetY,p=void 0===f?0:f,d=o.offsetZ,v=void 0===d?0:d,y=0>a,g=0>s,m=sn(Qu,Math.abs(a)/2,Math.abs(s)/2,c/2),T=i.stroke,E=i.lineWidth,b=i.increasedLineWidthForHitTesting,x=i.shadowType,w=i.shadowColor,S=i.filter,N=void 0===S?[]:S,M=i.transformOrigin,k=i.anchor;e.nodeName===t.Shape.TEXT&&delete i.anchor;var P=sn($u,(1-2*(k&&k[0]||0))*a/2+h,(1-2*(k&&k[1]||0))*s/2+p,(1-2*(k&&k[2]||0))*m[2]+v);r.contentBounds.update(P,m);var _=e.nodeName===t.Shape.POLYLINE||e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.PATH?Math.SQRT2:.5;if(T&&!T.isNone){var C=((E||0)+(b||0))*_;un(m,m,sn(tc,C,C,0))}if(r.renderBounds.update(P,m),w&&x&&"inner"!==x){var A=r.renderBounds,O=A.min,I=A.max,R=i.shadowBlur||0,L=i.shadowOffsetX||0,D=i.shadowOffsetY||0,B=I[0]+R+L,U=O[1]-R+D,G=I[1]+R+D;O[0]=Math.min(O[0],O[0]-R+L),I[0]=Math.max(I[0],B),O[1]=Math.min(O[1],U),I[1]=Math.max(I[1],G),r.renderBounds.setMinMax(O,I)}N.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,un(r.renderBounds.halfExtents,r.renderBounds.halfExtents,on(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,f=c[1]-s+a,p=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],f),l[1]=Math.max(l[1],p),r.renderBounds.setMinMax(c,l)}})),k=i.anchor;var j=(y?-1:1)*Ca(M[0],0,e),F=(g?-1:1)*Ca(M[1],1,e);e.setOrigin(j-=(y?-1:1)*(k&&k[0]||0)*r.contentBounds.halfExtents[0]*2,F-=(g?-1:1)*(k&&k[1]||0)*r.contentBounds.halfExtents[1]*2),this.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=zu[t];return!!e&&e.inh},e}();ec=jn([ct({token:fi}),Fn(0,lt(ks)),Fn(1,lt(vi)),Fn(2,lt(ls))],ec);var nc=Ct((function(e){e(t.DisplayObjectPool),e(t.Camera),e(t.DefaultSceneGraphSelector),e({token:wu,useFactory:function(t){return function(){return t.container.get(Su)}}}),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:ls,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(hs,n)&&(e[n]=t.container.getNamed(hs,n)),e[n]}}}),e(Lu),e(cs),e(Mu),e(ku),e(Pu),e(Cu),e(Au),e(Ou),e(Iu),e(Du),e(Bu),e(Uu),e(Gu),e(ju),e(Fu),e(Vu),e(Yu),e(Hu),e(Wu),e(qu),e(Ru),e({token:vi,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(yi,n)&&(e[n]=t.container.getNamed(yi,n)),e[n]}}}),e(ec)})),rc=function(){function t(t){this.plugins=[],this.config=void 0,this.config=he({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===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 ic=1;const oc="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},ac=Date.now();let sc={},uc=Date.now();const cc=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-uc,r=n>16?0:16-n,i=ic++;return sc[i]=t,Object.keys(sc).length>1||setTimeout((()=>{uc=e;const t=sc;sc={},Object.keys(t).forEach((e=>t[e](oc.performance&&"function"==typeof oc.performance.now?oc.performance.now():Date.now()-ac)))}),r),i},lc=t=>{delete sc[t]},hc=t=>"string"!=typeof t?cc:""===t?oc.requestAnimationFrame:oc[t+"RequestAnimationFrame"],fc=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!hc(t))),pc=hc(fc),dc="string"!=typeof(vc=fc)?lc:""===vc?oc.cancelAnimationFrame:oc[vc+"CancelAnimationFrame"]||oc[vc+"CancelRequestAnimationFrame"];var vc,yc,gc;oc.requestAnimationFrame=pc,oc.cancelAnimationFrame=dc,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:pc,cancelAnimationFrame:dc});var mc,Tc,Ec=t.Syringe.defineToken(""),bc=(yc=function(){function e(t,e){this.strategyProvider=void 0,this.renderingContext=void 0,this.strategyProvider=t,this.renderingContext=e}return e.prototype.apply=function(e){var n=this,r=this.strategyProvider.getContributions();e.hooks.cull.tap(gc.tag,(function(e){if(e){var i=e.cullable;return i.visible=0===r.length?n.renderingContext.unculledEntities.indexOf(e.entity)>-1:r.every((function(t){return t.isVisible(e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new Es(t.ElementEvent.CULLED)),null)}return e})),e.hooks.afterRender.tap(gc.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}(),yc.tag="Culling",gc=yc);bc=gc=jn([ct({contrib:xu}),Fn(0,Ft(Ec)),Fn(1,lt(du))],bc);var xc,wc,Sc=(mc=function(){function t(){}return t.prototype.apply=function(t){t.hooks.dirtycheck.tap(Tc.tag,(function(e){return e?e.renderable.dirty||t.disableDirtyRectangleRendering()?e:null:e}))},t}(),mc.tag="DirtyCheck",Tc=mc);Sc=Tc=jn([ct({contrib:xu})],Sc);var Nc=(xc=function(){function t(t,e,n,r,i){var o=this;this.canvasConfig=void 0,this.contextService=void 0,this.renderingService=void 0,this.renderingContext=void 0,this.eventService=void 0,this.autoPreventDefault=!1,this.rootPointerEvent=new Us(null),this.rootWheelEvent=new Gs(null),this.onPointerMove=function(t){var e,n,r=null===(e=o.renderingContext.root)||void 0===e||null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){for(var i,a=ge(o.normalizeToPointerEvent(t,r));!(i=a()).done;){var s=o.bootstrapEvent(o.rootPointerEvent,i.value,r);o.eventService.mapEvent(s)}o.setCursor(o.eventService.cursor)}},this.canvasConfig=t,this.contextService=e,this.renderingService=n,this.renderingContext=r,this.eventService=i}var e=t.prototype;return e.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView;this.eventService.setPickHandler(function(){var t=ue(ae().mark((function t(n){return ae().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(wc.tag,(function(t){var n=e.normalizeWheelEvent(t);e.eventService.mapEvent(n)})),t.hooks.pointerDown.tap(wc.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=ge(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(wc.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=ge(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(wc.tag,this.onPointerMove),t.hooks.pointerOver.tap(wc.tag,this.onPointerMove),t.hooks.pointerOut.tap(wc.tag,this.onPointerMove)},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.canvasConfig.supportsCSSTransform||Mr(r)||Mr(i)){var s=this.eventService.client2Viewport(new ba(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=function(t,e,n){t.view=n,t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var r=this.getViewportXY(e),i=r.y;t.viewport.x=r.x,t.viewport.y=i;var o=this.eventService.viewport2Canvas(t.viewport),a=o.y;return t.canvas.x=o.x,t.canvas.y=a,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=lo[t.type]||t.type),t},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.getViewportXY(t),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.srcElement=e.srcElement,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];Or(i.button)&&(i.button=0),Or(i.buttons)&&(i.buttons=1),Or(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Or(i.width)&&(i.width=i.radiusX||1),Or(i.height)&&(i.height=i.radiusY||1),Or(i.tiltX)&&(i.tiltX=0),Or(i.tiltY)&&(i.tiltY=0),Or(i.pointerType)&&(i.pointerType="touch"),Or(i.pointerId)&&(i.pointerId=i.identifier||0),Or(i.pressure)&&(i.pressure=i.force||.5),Or(i.twist)&&(i.twist=0),Or(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Or(o.isPrimary)&&(o.isPrimary=!0),Or(o.width)&&(o.width=1),Or(o.height)&&(o.height=1),Or(o.tiltX)&&(o.tiltX=0),Or(o.tiltY)&&(o.tiltY=0),Or(o.pointerType)&&(o.pointerType="mouse"),Or(o.pointerId)&&(o.pointerId=1),Or(o.pressure)&&(o.pressure=.5),Or(o.twist)&&(o.twist=0),Or(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}(),xc.tag="Event",wc=xc);Nc=wc=jn([ct({contrib:xu}),Fn(0,lt(_o)),Fn(1,lt(ys)),Fn(2,lt(t.RenderingService)),Fn(3,lt(du)),Fn(4,lt(t.EventService))],Nc);var Mc,kc,Pc=[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],_c=function(){function e(t){this.camera=void 0,this.camera=t}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(ma.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=Pc.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,f=l.distance;if(0>fn(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>fn(h,n.getNegativeFarPoint(i[s]))+f&&(o|=c)}}return o},e}();_c=jn([ct({contrib:Ec}),Fn(0,lt(mu))],_c);var Cc=(Mc=function(){function e(t,e,n,r){this.renderingContext=void 0,this.styleValueRegistry=void 0,this.sceneGraphService=void 0,this.rBush=void 0,this.toSync=new Set,this.renderingContext=t,this.styleValueRegistry=e,this.sceneGraphService=n,this.rBush=r}var n=e.prototype;return n.pushToSync=function(t){var e=this;t.forEach((function(t){e.toSync.add(t)}))},n.apply=function(e){var n=this,r=function(t){t.target.renderable.dirty=!0,e.dirtify()},i=function(t){t.detail.affectChildren&&t.target.forEach((function(t){n.pushToSync([t])})),n.pushToSync(t.composedPath().slice(0,-2)),e.dirtify()},o=function(t){var r=t.target;n.pushToSync(t.composedPath().slice(0,-2)),n.styleValueRegistry.recalc(r),n.sceneGraphService.dirtifyToRoot(r),e.dirtify()},a=function(t){var r=t.target,i=r.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(r),n.sceneGraphService.dirtifyToRoot(t.target),e.dirtify()};e.hooks.init.tapPromise(kc.tag,ue(ae().mark((function e(){return ae().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(kc.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.hooks.endFrame.tap(kc.tag,(function(){n.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],s=o[1],u=i.getMax(),c=u[0],l=u[1];r.aabb||(r.aabb={}),r.aabb.id=n.entity,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=l}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e}(),Mc.tag="Prepare",kc=Mc);Cc=kc=jn([ct({contrib:xu}),Fn(0,lt(du)),Fn(1,lt(fi)),Fn(2,lt(ks)),Fn(3,lt(Ms))],Cc);var Ac,Oc=Ct((function(e){Ot.register(e,xu,{cache:!1}),Ot.register(e,Ec,{cache:!1}),e({token:Ms,useValue:new qt}),e(t.RenderingService),e(t.EventService),e(Nc),e(Cc),e(Sc),e(bc),e(_c)}));(Ac=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Ac.BEFORE_RENDER="beforerender",Ac.AFTER_RENDER="afterrender",Ac.BEFORE_DESTROY="beforedestroy",Ac.AFTER_DESTROY="afterdestroy",Ac.RESIZE="resize",Ac.DIRTY_RECTANGLE="dirtyrectangle";var Ic=function(e){function n(n){var r;(r=e.call(this)||this).container=jt.createChild(),r.document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=Ys,r.frameId=void 0,r.eventService=void 0,r.renderingService=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.mountEvent=new Es(t.ElementEvent.MOUNTED),r.unmountEvent=new Es(t.ElementEvent.UNMOUNTED),r.beforeRenderEvent=new Es(t.CanvasEvent.BEFORE_RENDER),r.afterRenderEvent=new Es(t.CanvasEvent.AFTER_RENDER),r.document=new Ss,r.document.defaultView=ve(r),r.customElements=new ms;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,f=n.cursor,p=n.document,d=n.requestAnimationFrame,v=n.cancelAnimationFrame,y=n.createImage,g=n.supportsPointerEvents,m=n.supportsTouchEvents,T=n.supportsCSSTransform,E=n.isTouchEvent,b=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||ro++;no[n]&&no[n].destroy(),no[n]=e}}(i,ve(r));var x=s,w=u,S=c;return o&&(S=1>(S=c||io&&window.devicePixelRatio||1)?1:Math.ceil(S),x=s||function(t){var e=so(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(o)||o.width/S,w=u||function(t){var e=so(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(o)||o.height/S),r.devicePixelRatio=S,r.requestAnimationFrame=null!=d?d:pc.bind(globalThis),r.cancelAnimationFrame=null!=v?v:dc.bind(globalThis),r.supportsTouchEvents=null!=m?m:"ontouchstart"in globalThis,r.supportsPointerEvents=null!=g?g:!!globalThis.PointerEvent,r.isTouchEvent=null!=E?E:function(t){return r.supportsTouchEvents&&t instanceof globalThis.TouchEvent},r.isMouseEvent=null!=b?b:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:x,height:w,renderer:l,offscreenCanvas:a,devicePixelRatio:S,cursor:f||"default",background:h||"transparent",createImage:y,document:p,supportsCSSTransform:T}),r.initDefaultCamera(x,w),ue(ae().mark((function e(){return ae().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new Es(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}fe(n,e);var r=n.prototype;return r.initRenderingContext=function(e){var n=this;this.container.register({token:_o,useValue:e}),this.container.register({token:du,useValue:{root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],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=jt.get(Tu);r.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).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(du);r.eventEmitter.on(Eu.UPDATED,(function(){i.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.container.register({token:mu,useValue:r})},r.getConfig=function(){return this.container.get(_o)},r.getContainer=function(){return this.container},r.getRoot=function(){return this.document.documentElement},r.getCamera=function(){return this.container.get(mu)},r.getContextService=function(){return this.container.get(ys)},r.getEventService=function(){return this.eventService},r.getRenderingService=function(){return this.renderingService},r.getRenderingContext=function(){return this.container.get(du)},r.getRBushRoot=function(){return this.container.get(Ms)},r.getStats=function(){return this.getRenderingService().getStats()},r.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new Es(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),n||this.dispatchEvent(new Es(t.CanvasEvent.AFTER_DESTROY))},r.changeSize=function(t,e){this.resize(t,e)},r.resize=function(e,n){var r=this.container.get(_o);r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.container.get(mu),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.dispatchEvent(new Es(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){return this.document.documentElement.removeChild(t)},r.removeChildren=function(){this.document.documentElement.removeChildren()},r.render=function(){(this.dispatchEvent(this.beforeRenderEvent),this.container.isBound(t.RenderingService))&&this.container.get(t.RenderingService).render(this.getConfig());this.dispatchEvent(this.afterRenderEvent)},r.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},r.initRenderer=function(){var e=ue(ae().mark((function e(n){var r;return ae().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(ys),this.renderingService=this.container.get(t.RenderingService),this.eventService=this.container.get(t.EventService),this.eventService.init(),e.next=12,r.init();case 12:return e.next=14,this.renderingService.init();case 14:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),n.getConfig().enableAutoRendering&&this.run();case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.loadCommonContainerModule=function(){this.container.unload(Oc),this.container.load(Oc,!0)},r.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.container=e.container,t.init()}))},r.setRenderer=function(){var t=ue(ae().mark((function t(e){var n,r;return ae().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy()})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.setCursor=function(t){this.container.get(_o).cursor=t,this.getContextService().applyCursorStyle(t)},r.unmountChildren=function(t){var e=this;if(this.inited){var n=[];t.forEach((function(t){t.isConnected&&n.push(t)})),n.reverse().forEach((function(t){t instanceof Xs&&t.disconnectedCallback&&t.disconnectedCallback(),t.dispatchEvent(e.unmountEvent),t!==e.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}))}},r.mountChildren=function(t){var e=this;this.inited?t.forEach((function(t){t.isConnected||(t.ownerDocument=e.document,t.isConnected=!0,t.dispatchEvent(e.mountEvent),t instanceof Xs&&t.connectedCallback&&t.connectedCallback())})):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName)},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})},le(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}(bs);jt.load(nc);var Rc=jt.get(fi);t.AABB=ma,t.AbstractRenderer=rc,t.AbstractRendererPlugin=function(){this.container=void 0},t.AnimationTimelineToken=Co,t.BUILT_IN_PROPERTIES=Xu,t.CSS=di,t.CSSGradientValue=Me,t.CSSKeywordValue=ke,t.CSSRGB=hi,t.CSSStyleValue=Se,t.CSSUnitValue=Qr,t.CameraContribution=Tu,t.CameraEvent=Eu,t.Canvas=Ic,t.CanvasConfig=_o,t.Circle=Ws,t.ContextService=ys,t.CustomElement=Xs,t.CustomElementRegistry=ms,t.CustomEvent=Es,t.DefaultCamera=mu,t.DisplayObject=Ys,t.Document=Ss,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=uo,t.Element=Ds,t.Ellipse=Ks,t.EventTarget=bs,t.FederatedEvent=Ts,t.FederatedMouseEvent=Bs,t.FederatedPointerEvent=Us,t.FederatedWheelEvent=Gs,t.Frustum=Ea,t.GeometryAABBUpdater=hs,t.GeometryUpdaterFactory=ls,t.GlobalContainer=jt,t.Group=Js,t.HTML=$s,t.Image=eu,t.LayoutRegistry=pi,t.Line=ru,t.Module=Ct,t.MutationEvent=Ps,t.Node=xs,t.ParseEasingFunction=Ao,t.Path=ou,t.Plane=Ta,t.Point=ba,t.Polygon=su,t.Polyline=cu,t.RBush=qt,t.RBushRoot=Ms,t.Rect=hu,t.Rectangle=xa,t.RenderingContext=du,t.RenderingPluginContribution=xu,t.SceneGraphSelector=Su,t.SceneGraphSelectorFactory=wu,t.SceneGraphService=ks,t.StyleValueRegistry=fi,t.Text=pu,t.computeLinearGradient=function(t,e,n){var r=po(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(e,n,r,i,o){var a=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(a=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(ur([0,0],[a,s]),ur([0,n],[a,s]),ur([e,n],[a,s]),ur([e,0],[a,s]));return o&&(o instanceof Qr?u=o.value:o instanceof ke&&("closest-side"===o.value?u=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?u=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(u=Math.min(ur([0,0],[a,s]),ur([0,n],[a,s]),ur([e,n],[a,s]),ur([e,0],[a,s]))))),{x:a,y:s,r:u}},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,i.y1,i.x2,i.y2);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=Io(a,a,o.cx,o.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=Io(s.rx,s.ry,s.cx,s.cy);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,f=u.y,p=u.radius,d=p&&p.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3],c=t>0?1:-1,l=e>0?1:-1,h=c+l!==0?1:0;return[["M",c*o+n,r],["L",t-c*a+n,r],a?["A",a,a,0,0,h,t+n,l*a+r]:null,["L",t+n,e-l*s+r],s?["A",s,s,0,0,h,t+n-c*s,e+r]:null,["L",n+c*u,e+r],u?["A",u,u,0,0,h,n,e+r-l*u]:null,["L",n,l*o+r],o?["A",o,o,0,0,h,c*o+n,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,l,h,f,d&&p.map((function(t){return _r(t,0,Math.min(Math.abs(c)/2,Math.abs(l)/2))})));break;case t.Shape.PATH:var v=e.parsedStyle.path,y=v.zCommandIndexes;r=[].concat(v.curve),y.forEach((function(t,e){r.splice(t+e+1,0,["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=on(e[1]-a,e[2]-u,0);n&&dn(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=on(e[1]-a,e[2]-u,0),c=on(e[3]-a,e[4]-u,0),l=on(e[5]-a,e[6]-u,0);n&&(dn(s,s,r),dn(c,c,r),dn(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=on(e[6]-a,e[7]-u,0);n&&dn(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=fo,t.decompose=To,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=po,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=ao,t.getAngle=ho,t.getEuler=go,t.getOrCalculatePathTotalLength=Oo,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.inject=lt,t.injectable=ut,t.isBrowser=io,t.isFillOrStrokeAffected=function(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=da,t.mergeColors=ya,t.parseColor=va,t.parseLength=Sa,t.parsePath=ja,t.propertyMetadataCache=zu,t.rad2deg=vo,t.resetEntityCounter=function(){_s=0},t.setDOMSize=function(t,e,n){io&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.singleton=ct,t.styleValueRegistry=Rc,t.translatePathToString=function(t,e,n,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=t.map((function(s,u){var c="Z"===t[t.length-1][0],l=u===t.length-(c?2:1)?o:0,h=u===t.length-(c?2:1)?a:0;switch(s[0]){case"M":return"M "+(s[1]-e+r)+","+(s[2]-n+i);case"L":return"L "+(s[1]-e+l)+","+(s[2]-n+h);case"Q":return"Q "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e+l)+" "+(s[4]-n+h);case"C":return"C "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+","+(s[5]-e+l)+" "+(s[6]-n+h);case"A":return"A "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]+" "+s[5]+" "+(s[6]-e+l)+" "+(s[7]-n+h);case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=yo,Object.defineProperty(t,"__esModule",{value:!0})}));
|