@visactor/vrender 0.19.24-alpha.7 → 0.19.24-alpha.8

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/index.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VRender={})}(this,(function(t){"use strict";class e{static GenAutoIncrementId(){return e.auto_increment_id++}}e.auto_increment_id=0;class i{constructor(t){this.id=e.GenAutoIncrementId(),this.registry=t}}const n="named",r="inject",s="multi_inject",o="inversify:tagged",a="inversify:paramtypes";class l{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===n?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var h=function(t){var e;return function(t){const e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,n=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,o={__proto__:[]}instanceof Array,a=!s&&!o,l={create:s?function(){return T(Object.create(null))}:o?function(){return T({__proto__:null})}:function(){return T({})},has:a?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:a?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,u=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){const t={},e=[],i=function(){function t(t,e,i){this._index=0,this._keys=t,this._values=e,this._selector=i}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){const t=this._index;if(t>=0&&t<this._keys.length){const i=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(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){const e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){const i=this._find(t,!0);return this._values[i]=e,this},e.prototype.delete=function(e){const i=this._find(e,!1);if(i>=0){const n=this._keys.length;for(let t=i+1;t<n;t++)this._keys[t-1]=this._keys[t],this._values[t-1]=this._values[t];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 i(this._keys,this._values,n)},e.prototype.values=function(){return new i(this._keys,this._values,s)},e.prototype.entries=function(){return new i(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function s(t,e){return e}function o(t,e){return[t,e]}}():Map,d=(c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new u}Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()}}():Set,new(c||"function"!=typeof WeakMap?function(){const t=16,i=l.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){const e=s(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){const e=s(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return s(t,!0)[this._key]=e,this},t.prototype.delete=function(t){const e=s(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){let t;do{t="@@WeakMap@@"+a()}while(l.has(i,t));return i[t]=!0,t}function s(t,i){if(!e.call(t,n)){if(!i)return;Object.defineProperty(t,n,{value:l.create()})}return t[n]}function o(t,e){for(let i=0;i<e;++i)t[i]=255*Math.random()|0;return t}function a(){const e=(i=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(i)):o(new Uint8Array(i),i):o(new Array(i),i));var i;e[6]=79&e[6]|64,e[8]=191&e[8]|128;let n="";for(let i=0;i<t;++i){const t=e[i];4!==i&&6!==i&&8!==i||(n+="-"),t<16&&(n+="0"),n+=t.toString(16).toLowerCase()}return n}}():WeakMap));function p(t,e,i){let n=d.get(t);if(m(n)){if(!i)return;n=new u,d.set(t,n)}let r=n.get(e);if(m(r)){if(!i)return;r=new u,n.set(e,r)}return r}function f(t,e,i){if(g(t,e,i))return!0;const n=S(e);return!y(n)&&f(t,n,i)}function g(t,e,i){const n=p(e,i,!1);return!m(n)&&!!n.has(t)}function v(t,e,i){if(g(t,e,i))return function(t,e,i){const n=p(e,i,!1);if(!m(n))return n.get(t)}(t,e,i);const n=S(e);return y(n)?void 0:v(t,n,i)}function m(t){return void 0===t}function y(t){return null===t}function b(t){return"object"==typeof t?null!==t:"function"==typeof t}function x(t,e){switch(function(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}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const i=3===e?"string":5===e?"number":"default",r=function(t,e){const i=t[e];if(null!=i){if(!A(i))throw new TypeError;return i}}(t,n);if(void 0!==r){const e=r.call(t,i);if(b(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(A(e)){const i=e.call(t);if(!b(i))return i}const i=t.valueOf;if(A(i)){const e=i.call(t);if(!b(e))return e}}else{const e=t.valueOf;if(A(e)){const i=e.call(t);if(!b(i))return i}const i=t.toString;if(A(i)){const e=i.call(t);if(!b(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function w(t){const e=x(t,3);return function(t){return"symbol"==typeof t}(e)?e:function(t){return""+t}(e)}function A(t){return"function"==typeof t}function S(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;const i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}function T(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,i,n){if(!b(i))throw new TypeError;return function(t,e,i,n){p(i,n,!0).set(t,e)}(t,e,i,n)})),t("hasMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),f(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),g(t,e,i)})),t("getMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),v(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function c(t,e,i,n){!function(t,e,i,n){const r=[n];let s={};h.hasOwnMetadata(t,e)&&(s=h.getMetadata(t,e));let o=s[i];void 0===o&&(o=[]),o.push(...r),s[i]=o,h.defineMetadata(t,s,e)}(o,t,i.toString(),n)}function u(t){return(e,i,n)=>{c(e,0,n,t)}}function d(t){return e=>(i,n,r)=>u(new l(t,e))(i,n,r)}const p=d(r),f=d(s);function g(){return function(t){return h.defineMetadata(a,null,t),t}}function v(t){return u(new l(n,t))}const m="Singleton",y="Transient",b="ConstantValue",x="DynamicValue",w="Factory",A="Function",S="Instance",T="Invalid";class C{constructor(t,i){this.id=e.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=i,this.type=T,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new C(this.serviceIdentifier,this.scope);return t.activated=t.scope===m&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class _{getConstructorMetadata(t){return{compilerGeneratedMetadata:h.getMetadata(a,t),userGeneratedMetadata:h.getMetadata(o,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const B=(P=n,t=>{const e=e=>{if(null==e)return!1;if(e.key===P&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===P&&i[e].value===t)return!0;return!1};return e.metaData=new l(P,t),e});var P;class R{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=m,this}inTransientScope(){return this._binding.scope=y,this}whenTargetNamed(t){return this._binding.constraint=B(t),this}}class M{constructor(t){this._binding=t}to(t){return this._binding.type=S,this._binding.implementationType=t,new R(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=x,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new R(this._binding)}toConstantValue(t){return this._binding.type=b,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=m,new R(this._binding)}toFactory(t){return this._binding.type=w,this._binding.factory=t,this._binding.scope=m,new R(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}class k{constructor(t){const i=t||{};i.defaultScope=i.defaultScope||y,this.options=i,this.id=e.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new _}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,n,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new C(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new M(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),r=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:r(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),o=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const a={inject:n[r],multiInject:n[s]},l=a.inject||a.multiInject,h={serviceIdentifier:l,constructorArgsMetadata:e},c={injectIdentifier:l,metadata:e,bindings:this._bindingDictionary.get(l).filter((t=>t.constraint(h)))};o.push(c)}return o}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case b:case A:e=t.cache;break;case S:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===m&&(t.cache=e,t.activated=!0)}}const E=Symbol("ContributionProvider");class O{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function L(t,e){t(E).toDynamicValue((t=>{let{container:i}=t;return new O(e,i)})).inSingletonScope().whenTargetNamed(e)}function I(t,e){t(E).toDynamicValue((t=>{let{container:i}=t;return new O(e,i)})).whenTargetNamed(e)}class D{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class j extends D{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const U=Symbol.for("EnvContribution"),W=Symbol.for("VGlobal");var N=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},F=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},z=function(t,e){return function(i,n){e(i,n,t)}};function G(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}t.DefaultGlobal=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=e.GenAutoIncrementId(),this.hooks={onSetEnv:new j(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const n=this.bindContribution(e);if(n&&n.then)return n.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=N([g(),z(0,p(E)),z(0,v(U)),F("design:paramtypes",[Object])],t.DefaultGlobal);var H={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,r,s,o){var a=i?i+t:t;if(!this._events[a])return!1;var l,h,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,o),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,n);break;case 4:c[h].fn.call(c[h].context,e,n,r);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},a.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var l=0,h=[],c=a.length;l<c;l++)(a[l].fn!==e||r&&!a[l].once||n&&a[l].context!==n)&&h.push(a[l]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(H);var V=G(H.exports);var Y=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var X=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Y(t,"Boolean")};var $=t=>"function"==typeof t;var q=t=>null==t;var K=t=>null!=t;var Z=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var J=t=>"object"==typeof t&&null!==t;var Q=function(t){if(!J(t)||!Y(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var et=t=>void 0===t;var it=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||Y(t,"String")};var nt=t=>Array.isArray?Array.isArray(t):Y(t,"Array");var rt=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var st=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||Y(t,"Number")};var ot=t=>st(t)&&Number.isFinite(t);var at=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var lt=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const ht=Object.prototype.hasOwnProperty;var ct=(t,e)=>null!=t&&ht.call(t,e);function ut(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(K(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:s}=r,o=-1;for(;s--;){const s=r[++o];K(n[s])&&"object"==typeof n[s]?dt(t,e,s,i):pt(t,s,n[s])}}}}function dt(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=t[i],s=e[i];let o=e[i],a=!0;if(nt(s)){if(n)o=[];else if(nt(r))o=r;else if(rt(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else Q(s)?(o=r,"function"!=typeof r&&"object"==typeof r||(o={})):a=!1;a&&ut(o,s,n),pt(t,i,o)}function pt(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function ft(t,e){if(!nt(t)||!nt(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const gt="undefined"!=typeof console;function vt(t,e,i){const n=[e].concat([].slice.call(i));gt&&console[t].apply(console,n)}var mt;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(mt||(mt={}));class yt{static getInstance(t,e){return yt._instance&&st(t)?yt._instance.level(t):yt._instance||(yt._instance=new yt(t,e)),yt._instance}static setInstance(t){return yt._instance=t}static setInstanceLevel(t){yt._instance?yt._instance.level(t):yt._instance=new yt(t)}static clearInstance(){yt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mt.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=mt.Info}canLogDebug(){return this._level>=mt.Debug}canLogError(){return this._level>=mt.Error}canLogWarn(){return this._level>=mt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=mt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):vt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Warn&&vt(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Info&&vt(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Debug&&vt(this._method||"log","DEBUG",e),this}}yt._instance=null;const bt=1e-10,xt=1e-10;function wt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bt,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:xt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var At=function(t,e,i){return t<e?e:t>i?i:t};const St=1e-12,Tt=Math.PI,Ct=Tt/2,_t=2*Tt,Bt=2*Math.PI,Pt=Math.abs,Rt=Math.atan2,Mt=Math.cos,kt=Math.max,Et=Math.min,Ot=Math.sin,Lt=Math.sqrt,It=Math.pow;function Dt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function jt(t){return t>=1?Ct:t<=-1?-Ct:Math.asin(t)}function Ut(t,e,i,n,r){let s=i,o=n;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:s,y:o}}function Wt(t,e){return t[0]*e[1]-t[1]*e[0]}function Nt(t){const e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}class Ft{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new Ft(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return st(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return st(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class zt{static distancePP(t,e){return Lt(It(t.x-e.x,2)+It(t.y-e.y,2))}static distanceNN(t,e,i,n){return Lt(It(t-i,2)+It(e-n,2))}static distancePN(t,e,i){return Lt(It(e-t.x,2)+It(i-t.y,2))}static pointAtPP(t,e,i){return new Ft((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function Gt(t,e,i){const{x1:n,y1:r,x2:s,y2:o}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*o+i.e,i.b*s+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}class Ht{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Ht(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return nt(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Gt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:r,x2:s,y2:o}=this,a=Math.cos(t),l=Math.sin(t),h=e-e*a+i*l,c=i-e*l-i*a;return[a*n-l*r+h,l*n+a*r+c,a*n-l*o+h,l*n+a*o+c,a*s-l*r+h,l*s+a*r+c,a*s-l*o+h,l*s+a*o+c]}scalePoints(t,e,i,n){const{x1:r,y1:s,x2:o,y2:a}=this;return[t*r+(1-t)*i,e*s+(1-e)*n,t*o+(1-t)*i,e*a+(1-e)*n]}}class Vt extends Ht{}const Yt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-_t;)t+=_t;else if(t>0)for(;t>_t;)t-=_t;return t};function Xt(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}class $t{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f,o=new $t,a=t*n-e*i;return o.a=n/a,o.b=-e/a,o.c=-i/a,o.d=t/a,o.e=(i*s-n*r)/a,o.f=-(t*s-e*r)/a,o}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=o,this}rotateByCenter(t,e,i){const n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,o=(1-n)*i-r*e,a=n*this.a-r*this.b,l=r*this.a+n*this.b,h=n*this.c-r*this.d,c=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+o;return this.a=a,this.b=l,this.c=h,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:r,f:s}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}multiply(t,e,i,n,r,s){const o=this.a,a=this.b,l=this.c,h=this.d,c=o*t+l*e,u=a*t+h*e,d=o*i+l*n,p=a*i+h*n,f=o*r+l*s+this.e,g=a*r+h*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}interpolate(t,e){const i=new $t;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:r,d:s,e:o,f:a}=this,l=i*s-n*r,h=s/l,c=-n/l,u=-r/l,d=i/l,p=(r*a-s*o)/l,f=-(i*a-n*o)/l,{x:g,y:v}=t;e.x=g*h+v*u+p,e.y=g*c+v*d+f}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new $t(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){const o=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/o):-Math.acos(i/o)),s.scaleX=r/o,s.scaleY=o,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}class qt{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:n=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<i)return 0;let s=0;const o=e=>{s++,t.delete(e)},a=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<r)return o(e);let i=0;for(;a-t.timestamp[t.timestamp.length-1-i]<n&&(i++,!(i>=r)););if(i<r)return o(e);for(;a-t.timestamp[0]>n;)t.timestamp.shift()})),s}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:n=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>n&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();t.forEach((t=>{for(;n-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();for(;n-t.timestamp[0]>i;)t.timestamp.shift()}}function Kt(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,r=n*(1-Math.abs(t/60%2-1)),s=i-n/2;let o=0,a=0,l=0;return 0<=t&&t<60?(o=n,a=r,l=0):60<=t&&t<120?(o=r,a=n,l=0):120<=t&&t<180?(o=0,a=n,l=r):180<=t&&t<240?(o=0,a=r,l=n):240<=t&&t<300?(o=r,a=0,l=n):300<=t&&t<360&&(o=n,a=0,l=r),o=Math.round(255*(o+s)),a=Math.round(255*(a+s)),l=Math.round(255*(l+s)),{r:o,g:a,b:l}}function Zt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),r=Math.max(t,e,i),s=r-n;let o=0,a=0,l=0;return o=0===s?0:r===t?(e-i)/s%6:r===e?(i-t)/s+2:(t-e)/s+4,o=Math.round(60*o),o<0&&(o+=360),l=(r+n)/2,a=0===s?0:s/(1-Math.abs(2*l-1)),a=+(100*a).toFixed(1),l=+(100*l).toFixed(1),{h:o,s:a,l:l}}const Jt=/^#([0-9a-f]{3,8})$/,Qt={transparent:4294967040},te={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 ee(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ie(t){return st(t)?new oe(t>>16,t>>8&255,255&t,1):nt(t)?new oe(t[0],t[1],t[2]):new oe(255,255,255)}function ne(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function re(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class se{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new se(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new se(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof se?t:new se(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(K(Qt[t]))return function(t){return st(t)?new oe(t>>>24,t>>>16&255,t>>>8&255,255&t):nt(t)?new oe(t[0],t[1],t[2],t[3]):new oe(255,255,255,1)}(Qt[t]);if(K(te[t]))return ie(te[t]);const e=`${t}`.trim().toLowerCase(),i=Jt.exec(e);if(i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new oe((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?ie(t):8===e?new oe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new oe(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Kt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new oe(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=se.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new oe(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,r=Zt(this.color.r,this.color.g,this.color.b),s=Kt(q(t)?r.h:At(t,0,360),q(e)?r.s:e>=0&&e<=1?100*e:e,q(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new oe(s.r,s.g,s.b,n),this}setRGB(t,e,i){return!q(t)&&(this.color.r=t),!q(e)&&(this.color.g=e),!q(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Jt.exec(e),n=parseInt(i[1],16),r=i[1].length;return 3===r?new oe((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):6===r?ie(n):8===r?new oe(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):this}setColorName(t){const e=te[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new se(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ne(t.color.r),this.color.g=ne(t.color.g),this.color.b=ne(t.color.b),this}copyLinearToSRGB(t){return this.color.r=re(t.color.r),this.color.g=re(t.color.g),this.color.b=re(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class oe{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),K(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${ee(this.r)+ee(this.g)+ee(this.b)+(1===this.opacity?"":ee(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=Zt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}function ae(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}let le,he,ce,ue,de,pe,fe,ge;function ve(t,e,i,n){if(!function(t,e,i,n){let r,s=t[0],o=e[0],a=i[0],l=n[0];return o<s&&(r=o,o=s,s=r),l<a&&(r=l,l=a,a=r),!(o<a||l<s||(s=t[1],o=e[1],a=i[1],l=n[1],o<s&&(r=o,o=s,s=r),l<a&&(r=l,l=a,a=r),o<a||l<s))}(t,e,i,n))return!1;const r=[0,0],s=[0,0],o=[0,0];if(ae(r,e,t),ae(s,n,i),function(t,e){return Pt(t[0]-e[0])+Pt(t[1]-e[1])<1e-12}(r,s))return!0;ae(o,i,t);const a=Wt(o,s)/Wt(r,s);return a>=0&&a<=1&&[t[0]+r[0]*a,t[1]+r[1]*a]}var me;function ye(t,e,i){return!(t&&e&&(i?(le=t.x1,he=t.x2,ce=t.y1,ue=t.y2,de=e.x1,pe=e.x2,fe=e.y1,ge=e.y2,le>he&&([le,he]=[he,le]),ce>ue&&([ce,ue]=[ue,ce]),de>pe&&([de,pe]=[pe,de]),fe>ge&&([fe,ge]=[ge,fe]),le>pe||he<de||ce>ge||ue<fe):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(me||(me={}));const be=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};class xe{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),K(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=K(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(q(this._canvas)&&(K(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),q(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&K(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),q(this._context)&&K(this._canvas)){const t=this._canvas.getContext("2d");K(t)&&(t.save(),t.font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{fontStyle:i=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:o=e.fontFamily}=t;return(i?i+" ":"")+(n?n+" ":"")+(r?r+" ":"")+s+"px "+(o||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!q(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:r=n.fontStyle,fontVariant:s=n.fontVariant,fontWeight:o=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:p,limit:f}=this._userSpec;let{lineHeight:g=a}=this._userSpec;if(it(g)&&"%"===g[g.length-1]){const t=Number.parseFloat(g.substring(0,g.length-1))/100;g=a*t}return{fontStyle:r,fontVariant:s,fontFamily:l,fontSize:a,fontWeight:o,textAlign:c,textBaseline:d,ellipsis:p,limit:f,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(q(t))return{width:0,height:0};if(q(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:o,limit:a,lineHeight:l}=this.textSpec;let h;try{const c=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:!!o,maxLineWidth:a||1/0,lineHeight:l});h={width:c.width(),height:c.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:r}=this.textSpec;return{width:i.width,height:null!==(e=r)&&void 0!==e?e:n}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let r=this._measureSpecialChar(n);q(r)&&xe.NUMBERS_CHAR_SET.includes(n)&&(r=this._measureNumberChar()),q(r)&&["F","W"].includes(be(n))&&(r=this._measureFullSizeChar()),q(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let e=0;e<t.length;e++){const r=t[e],s=["F","W"].includes(be(r))?1:.53;i.width+=s*n}return i.height=null!==(e=r)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:r}=this.textSpec,s={width:0,height:0};if(q(t))return s;if(nt(t)){const o=t.filter(K).map((t=>t.toString()));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:o.length*((null!==(i=r)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(q(this._numberCharSize)){const t=this._standardMethod(xe.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/xe.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return q(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(xe.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(q(this._letterCharSize)){const t=this._standardMethod(xe.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/xe.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return K(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){K(this._canvas)&&(this._canvas=null),K(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}xe.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",xe.NUMBERS_CHAR_SET="0123456789",xe.FULL_SIZE_CHAR="字";const we=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),Ae=_t-1e-8;class Se{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Ae)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(f(n),f(r),r!==n)if((n%=_t)<0&&(n+=_t),(r%=_t)<0&&(r+=_t),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=_t,o=n-n%Ct,a=0;a<4&&o>r;++a,o-=Ct)f(o);else for(o=n-n%Ct+Ct,a=0;a<4&&o<r;++a,o+=Ct)f(o);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class Te{constructor(){this.curves=[],this.bounds=new Vt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Ce=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,_e={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Be={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Pe,Re,Me,ke,Ee,Oe;function Le(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const r=[];for(let t=0,s=e.length;t<s;t++)if(Pe=e[t],Re=Pe.slice(1),Me=Pe[0],i=[Me],n=Re.match(Ce),null!==n){for(let t=0,e=n.length;t<e;t++)ke=n[t],Ee=parseFloat(ke),Number.isNaN(Ee)||i.push(Ee);if(Oe=_e[Me],i.length-1>Oe){let t;for(let e=1,n=i.length;e<n;e+=Oe){t=[Me];for(let n=e,r=e+Oe;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Ie,De,je,Ue,We,Ne,Fe,ze;function Ge(t,e,i,n,r,s,o,a,l){const h=o*(Math.PI/180),c=Math.sin(h),u=Math.cos(h),d=u*(a-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(a-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,v=c/i,m=-c/n,y=u/n,b=g*a+v*l,x=m*a+y*l,w=g*t+v*e,A=m*t+y*e;let S=1/((w-b)*(w-b)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);s===r&&(T=-T);const C=.5*(b+w)-T*(A-x),_=.5*(x+A)+T*(w-b),B=Math.atan2(x-_,b-C);let P=Math.atan2(A-_,w-C)-B;P<0&&1===s?P+=_t:P>0&&0===s&&(P-=_t);const R=Math.ceil(Math.abs(P/(Ct+.001))),M=[];for(let t=0;t<R;++t){const e=B+t*P/R,r=B+(t+1)*P/R;M[t]=[C,_,e,r,i,n,c,u]}return M}function He(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=l*s,c=-a*o,u=a*s,d=l*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),m=.5*(r-n),y=Math.sin(.5*m),b=8/3*y*y/Math.sin(m),x=e+p-b*f,w=i+f+b*p,A=e+g,S=i+v,T=A+b*v,C=S-b*g;return[h*x+c*w,u*x+d*w,h*T+c*C,u*T+d*C,h*A+c*S,u*A+d*S]}function Ve(t,e,i,n){const r=Ge(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<r.length;++e){const i=He(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Ie=t.UpdateTag||(t.UpdateTag={}))[Ie.NONE=0]="NONE",Ie[Ie.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Ie[Ie.UPDATE_SHAPE=2]="UPDATE_SHAPE",Ie[Ie.CLEAR_SHAPE=253]="CLEAR_SHAPE",Ie[Ie.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Ie[Ie.INIT=179]="INIT",Ie[Ie.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Ie[Ie.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Ie[Ie.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Ie[Ie.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Ie[Ie.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Ie[Ie.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",Ie[Ie.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",Ie[Ie.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(De=t.IContainPointMode||(t.IContainPointMode={}))[De.GLOBAL=1]="GLOBAL",De[De.LOCAL=16]="LOCAL",De[De.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",De[De.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(je=t.AttributeUpdateType||(t.AttributeUpdateType={}))[je.INIT=0]="INIT",je[je.DEFAULT=1]="DEFAULT",je[je.STATE=2]="STATE",je[je.ANIMATE_BIND=10]="ANIMATE_BIND",je[je.ANIMATE_PLAY=11]="ANIMATE_PLAY",je[je.ANIMATE_START=12]="ANIMATE_START",je[je.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",je[je.ANIMATE_END=14]="ANIMATE_END",je[je.TRANSLATE=20]="TRANSLATE",je[je.TRANSLATE_TO=21]="TRANSLATE_TO",je[je.SCALE=22]="SCALE",je[je.SCALE_TO=23]="SCALE_TO",je[je.ROTATE=24]="ROTATE",je[je.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Ue=t.AnimateStatus||(t.AnimateStatus={}))[Ue.INITIAL=0]="INITIAL",Ue[Ue.RUNNING=1]="RUNNING",Ue[Ue.PAUSED=2]="PAUSED",Ue[Ue.END=3]="END",t.AnimateMode=void 0,(We=t.AnimateMode||(t.AnimateMode={}))[We.NORMAL=0]="NORMAL",We[We.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Ne=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Ne.from="from",Ne.to="to",Ne.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,(Fe=t.CurveTypeEnum||(t.CurveTypeEnum={}))[Fe.CubicBezierCurve=0]="CubicBezierCurve",Fe[Fe.QuadraticBezierCurve=1]="QuadraticBezierCurve",Fe[Fe.ArcCurve=2]="ArcCurve",Fe[Fe.LineCurve=3]="LineCurve",Fe[Fe.EllipseCurve=4]="EllipseCurve",Fe[Fe.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(ze=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[ze.beforeFillStroke=0]="beforeFillStroke",ze[ze.afterFillStroke=1]="afterFillStroke";const Ye=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),l=4*Math.tan(a/4)/3,h=i<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),f=c*s+n,g=u*o+r,v=d*s+n,m=p*o+r,y=s*l*h,b=o*l*h;t.push(f-y*u,g+b*c,v+y*p,m-b*d,v,m)},Xe=[(t,e,i,n,r,s,o)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],o),(t,e,i,n,r,s,o)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,o),(t,e,i,n,r,s,o)=>e.bezierCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*r+i,t[6]*s+n,o),(t,e,i,n)=>e.closePath(),(t,e,i,n,r,s)=>e.ellipse(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,n,r,s,o)=>e.lineTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.moveTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,o),(t,e,i,n,r,s,o)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,o)];function $e(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const l=t[a];Xe[l[0]](l,e,i,n,r,s,o)}}class qe{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ke(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],o=e[r],a=t[(r+1)%n],l=e[(r+1)%n];i+=zt.distanceNN(s,o,a,l)}return i/2}function Ze(t,e,i,n,r){return Ke([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function Je(t,e,i,n,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*i*r*r*s+n*r*r*r}function Qe(t,e,i,n,r){const s=Je(t.x,e.x,i.x,n.x,r),o=Je(t.y,e.y,i.y,n.y,r);return new Ft(s,o)}function ti(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=Qe(i,n,r,s,e),a=zt.pointAtPP(i,n,e),l=zt.pointAtPP(n,r,e),h=zt.pointAtPP(r,s,e),c=zt.pointAtPP(a,l,e),u=zt.pointAtPP(l,h,e);return[new ei(i,a,c,o),new ei(o,u,h,s)]}class ei extends qe{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Qe(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Ze(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Pt(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Pt(this.p0.y-this.p3.y):0}getAngleAt(t){const e=kt(t-.01,0),i=Et(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return Rt(r.y-n.y,r.x-n.x)}}function ii(t,e){const{p0:i,p1:n}=t,r=zt.pointAtPP(i,n,e);return[new ni(i,r),new ni(r,n)]}class ni extends qe{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return zt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=Rt(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?zt.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Pt(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Pt(this.p0.y-this.p1.y):0}}class ri{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,o,a){const l=new ei(new Ft(this._lastX,this._lastY),new Ft(t,e),new Ft(i,n),new Ft(r,s));l.originP1=this._lastOriginP,l.originP2=a,l.defined=o,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,r){const s=new ni(new Ft(this._lastX,this._lastY),new Ft(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){var i,n;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return Pt(t.p0.y-n.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return Pt(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class si extends ri{bezierCurveTo(t,e,i,n,r,s,o,a){return super.bezierCurveTo(e,t,n,i,s,r,o,a)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function oi(t,e){let i=!1;for(let n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function ai(e,i,n){const r=null!=i?i:Pt(n[n.length-1].x-n[0].x)>Pt(n[n.length-1].y-n[0].y)?t.Direction.ROW:t.Direction.COLUMN;return"monotoneY"===e?new si(e,r):new ri(e,r)}class li{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function hi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ai("linear",i,t);return ci(new li(r,n),t),r}function ci(t,e){return oi(t,e)}function ui(t,e,i,n,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class di{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&ui(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:ui(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function pi(t,e){return oi(t,e)}function fi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hi(t,e);const r=ai("basis",i,t);return pi(new di(r,n),t),r}function gi(t){return t<0?-1:1}function vi(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),o=(i-t._y1)/(r||Number(n<0&&-0)),a=(s*r+o*n)/(n+r);return(gi(s)+gi(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function mi(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function yi(t,e,i,n,r){const s=t._x0,o=t._y0,a=t._x1,l=t._y1,h=(a-s)/3;t.context.bezierCurveTo(s+h,o+h*e,a-h,l-h*i,a,l,n,t.lastPoint1)}class bi{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:yi(this,this._t0,mi(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,yi(this,mi(this,e=vi(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:yi(this,this._t0,e=vi(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class xi extends bi{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function wi(t,e){return oi(t,e)}function Ai(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hi(t,e);const r=ai("monotoneX",i,t);return wi(new bi(r,n),t),r}function Si(t,e){return oi(t,e)}function Ti(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hi(t,e);const r=ai("monotoneY",i,t);return Si(new xi(r,n),t),r}let Ci=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function _i(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new ri("step",null!=r?r:Pt(e[e.length-1].x-e[0].x)>Pt(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Bi(new Ci(o,i,s),e),o}function Bi(t,e){return oi(t,e)}class Pi extends li{lineEnd(){this.context.closePath()}}function Ri(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ai("linear",i,t);return Mi(new Pi(r,n),t),r}function Mi(t,e){return oi(t,e)}function ki(t,e,i,n,r){let s=t._x1,o=t._y1,a=t._x2,l=t._y2;if(t._l01_a>St){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>St){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*n+t._x1*t._l23_2a-e*t._l12_2a)/r,l=(l*n+t._y1*t._l23_2a-i*t._l12_2a)/r}t.context.bezierCurveTo(s,o,a,l,t._x2,t._y2,n,t.lastPoint1)}function Ei(t,e){return function(i,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:o}=r;if(i.length<2-Number(!!o))return null;if(i.length<3-Number(!!o))return hi(i,r);const a=ai(t,s,i);return oi(new e(a,n,o),i),a}}const Oi=Ei("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:ki(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Li=Ei("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:ki(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function Ii(t,e,i){var n,r;switch(e){case"linear":default:return hi(t,i);case"basis":return fi(t,i);case"monotoneX":return Ai(t,i);case"monotoneY":return Ti(t,i);case"step":return _i(t,.5,i);case"stepBefore":return _i(t,0,i);case"stepAfter":return _i(t,1,i);case"catmullRom":return Oi(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Li(t,null!==(r=null==i?void 0:i.curveTension)&&void 0!==r?r:.5,i);case"linearClosed":return Ri(t,i)}}class Di extends Te{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Se(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Be.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Be.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Be.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.commandList.push([Be.C,t,e,i,n,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,s),this}arcTo(t,e,i,n,r){return this.commandList.push([Be.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,o,a){return this.commandList.push([Be.E,t,e,i,n,r,s,o,a]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,o,a),this}rect(t,e,i,n){return this.commandList.push([Be.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,s){return this.commandList.push([Be.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Be.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[Be.M]=t=>`M${t[1]} ${t[2]}`,t[Be.L]=t=>`L${t[1]} ${t[2]}`,t[Be.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Be.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Be.A]=t=>{const e=[];Ye(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Be.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Be.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,r){this.clear();const s=Le(t);return this._runCommandStrList(s,e,i,n,r),this._updateBounds(),this}fromLine(e){const{points:i,curveType:n,clipRangeByDimension:r}=e.attribute;if(!i)return;const s=Ii(i,n);"x"===r?this.direction=t.Direction.ROW:"y"===r?this.direction=t.Direction.COLUMN:"auto"===r&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const t=[];t[Be.M]=this.moveToTransform,t[Be.L]=this.lineToTransform,t[Be.Q]=this.quadraticCurveToTransform,t[Be.C]=this.bezierCurveToTransform,t[Be.AT]=this.arcToTransform,t[Be.E]=this.ellipseTransform,t[Be.R]=this.rectTransform,t[Be.A]=this.arcTransform,t[Be.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,r,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(e=t[g],1===l&&1===h||(e=Ui(e,l,h)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+o,d+a);break;case"L":u=e[1],d=e[2],this.lineTo(u+o,d+a);break;case"h":u+=e[1],this.lineTo(u+o,d+a);break;case"H":u=e[1],this.lineTo(u+o,d+a);break;case"v":d+=e[1],this.lineTo(u+o,d+a);break;case"V":d=e[1],this.lineTo(u+o,d+a);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+o,d+a);break;case"M":u=e[1],d=e[2],this.moveTo(u+o,d+a);break;case"c":i=u+e[5],n=d+e[6],p=u+e[3],f=d+e[4],this.bezierCurveTo(u+e[1]+o,d+e[2]+a,p+o,f+a,i+o,n+a),u=i,d=n;break;case"C":u=e[5],d=e[6],p=e[3],f=e[4],this.bezierCurveTo(e[1]+o,e[2]+a,p+o,f+a,u+o,d+a);break;case"s":i=u+e[3],n=d+e[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+o,f+a,u+e[1]+o,d+e[2]+a,i+o,n+a),p=u+e[1],f=d+e[2],u=i,d=n;break;case"S":i=e[3],n=e[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+o,f+a,e[1]+o,e[2]+a,i+o,n+a),u=i,d=n,p=e[1],f=e[2];break;case"q":i=u+e[3],n=d+e[4],p=u+e[1],f=d+e[2],this.quadraticCurveTo(p+o,f+a,i+o,n+a),u=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+o,e[2]+a,i+o,n+a),u=i,d=n,p=e[1],f=e[2];break;case"t":i=u+e[1],n=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-r,f=2*d-s):"q"===c[0]&&(p=2*u-p,f=2*d-f),r=p,s=f,this.quadraticCurveTo(p+o,f+a,i+o,n+a),u=i,d=n,p=u+e[1],f=d+e[2];break;case"T":i=e[1],n=e[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+o,f+a,i+o,n+a),u=i,d=n;break;case"a":Ve(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+u+o,e[7]+d+a]),u+=e[6],d+=e[7];break;case"A":Ve(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+a]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Be.L:this.lineToTransform(o,e,i,n,r);break;case Be.M:this.moveToTransform(o,e,i,n,r);break;case Be.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Be.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Be.A:this.arcToTransform(o,e,i,n,r);break;case Be.E:this.ellipseTransform(o,e,i,n,r);break;case Be.R:this.rectTransform(o,e,i,n,r);break;case Be.AT:this.arcToTransform(o,e,i,n,r);break;case Be.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),$e(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Pt(t.p0.y-e.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Pt(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const ji=["l",0,0,0,0,0,0,0];function Ui(t,e,i){const n=ji[0]=t[0];if("a"===n||"A"===n)ji[1]=e*t[1],ji[2]=i*t[2],ji[3]=t[3],ji[4]=t[4],ji[5]=t[5],ji[6]=e*t[6],ji[7]=i*t[7];else if("h"===n||"H"===n)ji[1]=e*t[1];else if("v"===n||"V"===n)ji[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)ji[n]=(n%2==1?e:i)*t[n];return ji}const Wi={alignSelf:"auto"},Ni={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new $t},Fi={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},zi={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Gi=Object.assign({outerBorder:Object.assign(Object.assign({},zi),{distance:0}),innerBorder:Object.assign(Object.assign({},zi),{distance:0})},zi),Hi={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},Vi={pickStrokeBuffer:0},Yi=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},Fi),Gi),Wi),Vi),Xi={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},$i={_debug_bounds:!1},qi=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic"},$i),Yi),Ni);const Ki=Object.assign(Object.assign({},qi),{startAngle:0,endAngle:Bt,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Zi=Object.assign(Object.assign(Object.assign({},qi),Xi),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Ji=Object.assign(Object.assign({},qi),{radius:1,startAngle:0,endAngle:Bt}),Qi=Object.assign(Object.assign({},qi),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),tn=Object.assign(Object.assign({},qi),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),en=Object.assign(Object.assign(Object.assign({},qi),Xi),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),nn=Object.assign(Object.assign({},qi),{path:new Di,customPath:()=>{yt.getInstance().warn("空函数")}}),rn=Object.assign(Object.assign({},qi),{points:[],cornerRadius:0,closePath:!0}),sn=Object.assign(Object.assign({},qi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),on=Object.assign(Object.assign({},qi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),an=Object.assign(Object.assign({},qi),{symbolType:"circle",size:10,keepDirIn3d:!0}),ln=Object.assign(Object.assign(Object.assign({},qi),Hi),{strokeBoundsBuffer:0,keepDirIn3d:!0}),hn=Object.assign(Object.assign(Object.assign({},qi),Hi),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),cn=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},qi),{fill:!0,cornerRadius:0}),un=Object.assign(Object.assign({},cn),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});class dn{}const pn=new dn,fn={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},gn=!0,vn=!1,mn=/\w|\(|\)|-/,yn=/[.?!,;:/,。?!、;:]/,bn=/\S/;function xn(t,e,i,n,r){if(!e||e<=0)return 0;const s=pn.graphicUtil.textMeasure;let o=n,a=t.slice(0,o),l=Math.floor(s.measureText(a,i).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,i).width);for(;l>e||c<=e;){if(l>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),l=Math.floor(s.measureText(a,i).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,i).width)}return r&&(o=wn(t,o)),o}function wn(t,e){let i=e;for(;mn.test(t[i-1])&&mn.test(t[i])||yn.test(t[i]);)if(i--,i<=0)return e;return i}function An(t,e){const i=pn.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}var Sn=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Tn=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,e){let{fontSize:i=ln.fontSize}=e,n=0,r=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?n++:r++;return{width:~~(.8*n*i+r*i),height:i}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Hi.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Hi.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,s.push(t[a]);if(t[a]&&t[a].text.length>1){const r=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1,"end",!1);if(n&&r.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[a].text;let s=wn(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[a]),{text:r.str,width:r.width})),o+=r.width}return{verticalList:s,width:o}}clipText(t,e,i,n){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const s=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&s.str!==t){const i=wn(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,n,r,s,o){let a;if("start"===s)a=this._clipTextStart(t,e,i,n,r),o&&(a.result=o+a.str);else if("middle"===s){const n=this._clipTextMiddle(t,e,i,"","",0,0,1);a={str:"none",width:n.width,result:n.left+o+n.right}}else a=this._clipTextEnd(t,e,i,n,r),o&&(a.result=a.str+o);return a}_clipTextEnd(t,e,i,n,r){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let l;if(a>i){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return l=this.measureTextWidth(r,e),l<=i?{str:r,width:l}:this._clipTextEnd(t,e,i,n,s)}if(a<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return l=this.measureTextWidth(n,e),l>=i?{str:o,width:a}:this._clipTextEnd(t,e,i,s,r)}return{str:o,width:a}}_clipTextStart(t,e,i,n,r){const s=Math.ceil((n+r)/2),o=t.substring(s-1,t.length-1),a=this.measureTextWidth(o,e);let l;if(a>i){if(o.length<=1)return{str:"",width:0};const n=t.substring(s,t.length-1);return l=this.measureTextWidth(n,e),l<=i?{str:n,width:l}:this._clipTextStart(t,e,i,s,t.length-1)}if(a<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};const r=t.substring(s-2,t.length-1);return l=this.measureTextWidth(r,e),l>=i?{str:o,width:a}:this._clipTextStart(t,e,i,n,s)}return{str:o,width:a}}_clipTextMiddle(t,e,i,n,r,s,o,a){const l=t.substring(0,a),h=this.measureTextWidth(l,e);if(h+o>i)return{left:n,right:r,width:s+o};const c=t.substring(t.length-a,t.length),u=this.measureTextWidth(c,e);return h+u>i?{left:l,right:r,width:h+o}:this._clipTextMiddle(t,e,i,l,c,h,u,a+1)}clipTextWithSuffixVertical(t,e,i,n,r,s){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const o=this.clipTextVertical(t,e,i,r);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;const a=this.measureTextWidth(n,e);if(a>i)return o;let l;if(i-=a,"start"===s){const s=this.revertVerticalList(t);l=this.clipTextVertical(s,e,i,r);const o=this.revertVerticalList(l.verticalList);o.unshift({text:n,direction:1,width:a}),l.verticalList=o}else if("middle"===s){const s=this.clipTextVertical(t,e,i/2,r),o=this.revertVerticalList(t),h=this.clipTextVertical(o,e,i/2,r);s.verticalList.push({text:n,direction:1,width:a}),this.revertVerticalList(h.verticalList).forEach((t=>s.verticalList.push(t))),l={verticalList:s.verticalList,width:s.width+h.width}}else l=this.clipTextVertical(t,e,i,r),l.verticalList.push({text:n,direction:1,width:a});return l.width+=a,l}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const a=this.measureTextWidth(t,e);if(!o&&a<=i)return{str:t,width:a};const l=this.measureTextWidth(n,e);if(l>i)return{str:"",width:0};if(o&&a+l<=i)return{str:t+n,width:a+l};i-=l;const h=this._clipText(t,e,i,0,t.length-1,s,n);if(r&&h.str!==t){const i=wn(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else o&&h.str===t&&(h.result=t+n);return h.str=h.result,h.width+=l,h}};Tn=Sn([g()],Tn);var Cn=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};const _n=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=class extends Tn{},t.DefaultTextMeasureContribution=Cn([g()],t.DefaultTextMeasureContribution);const Bn=new k,Pn=Symbol.for("CanvasFactory"),Rn=Symbol.for("Context2dFactory");function Mn(t){return Bn.getNamed(Pn,pn.global.env)(t)}const kn=1e-4,En=Math.sqrt(3),On=1/3;function Ln(t){return t>-$n&&t<$n}function In(t){return t>$n||t<-$n}const Dn=[0,0],jn=[0,0],Un=[0,0];function Wn(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Nn(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Fn(t,e,i,n,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*n+3*s*i)}function zn(t){return(t%=Bt)<0&&(t+=Bt),t}function Gn(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const o=(s-e)/(n-e);let a=n<e?1:-1;1!==o&&0!==o||(a=n<e?.5:-.5);const l=o*(i-t)+t;return l===r?1/0:l>r?a:0}function Hn(t,e,i,n,r,s,o,a,l){if(0===o)return!1;const h=o;return!(l>e+h&&l>n+h&&l>s+h||l<e-h&&l<n-h&&l<s-h||a>t+h&&a>i+h&&a>r+h||a<t-h&&a<i-h&&a<r-h)&&function(t,e,i,n,r,s,o,a,l){let h=0,c=.005,u=1/0;Dn[0]=o,Dn[1]=a;for(let o=0;o<1;o+=.05){jn[0]=Nn(t,i,r,o),jn[1]=Nn(e,n,s,o);const a=Wn(Dn,jn);a<u&&(h=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<kn);o++){const o=h-c,a=h+c;jn[0]=Nn(t,i,r,o),jn[1]=Nn(e,n,s,o);const l=Wn(jn,Dn);if(o>=0&&l<u)h=o,u=l;else{Un[0]=Nn(t,i,r,a),Un[1]=Nn(e,n,s,a);const o=Wn(Un,Dn);a<=1&&o<u?(h=a,u=o):c*=.5}}return l&&(l[0]=Nn(t,i,r,h),l[1]=Nn(e,n,s,h)),Math.sqrt(u)}(t,e,i,n,r,s,a,l,null)<=h/2}function Vn(t,e,i,n,r,s,o,a,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>n+u&&c>s+u&&c>a+u||c<e-u&&c<n-u&&c<s-u&&c<a-u||h>t+u&&h>i+u&&h>r+u&&h>o+u||h<t-u&&h<i-u&&h<r-u&&h<o-u)&&function(t,e,i,n,r,s,o,a,l,h,c){let u,d,p,f,g=0,v=.005,m=1/0;Dn[0]=l,Dn[1]=h;for(let l=0;l<1;l+=.05)jn[0]=Fn(t,i,r,o,l),jn[1]=Fn(e,n,s,a,l),p=Wn(Dn,jn),p<m&&(g=l,m=p);m=1/0;for(let l=0;l<32&&!(v<kn);l++)u=g-v,d=g+v,jn[0]=Fn(t,i,r,o,u),jn[1]=Fn(e,n,s,a,u),p=Wn(jn,Dn),u>=0&&p<m?(g=u,m=p):(Un[0]=Fn(t,i,r,o,d),Un[1]=Fn(e,n,s,a,d),f=Wn(Un,Dn),d<=1&&f<m?(g=d,m=f):v*=.5);return c&&(c[0]=Fn(t,i,r,o,g),c[1]=Fn(e,n,s,a,g)),Math.sqrt(m)}(t,e,i,n,r,s,o,a,h,c,null)<=u/2}function Yn(t,e,i,n,r,s,o,a,l){if(0===o)return!1;const h=o;a-=t,l-=e;const c=Math.sqrt(a*a+l*l);if(c-h>i||c+h<i)return!1;if(Math.abs(n-r)%Bt<1e-4)return!0;if(s){const t=n;n=zn(r),r=zn(t)}else n=zn(n),r=zn(r);n>r&&(r+=Bt);let u=Math.atan2(l,a);return u<0&&(u+=Bt),u>=n&&u<=r||u+Bt>=n&&u+Bt<=r}function Xn(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,l=r/2;let h=0,c=t;if(o>e+l&&o>n+l||o<e-l&&o<n-l||s>t+l&&s>i+l||s<t-l&&s<i-l)return!1;if(t===i)return Math.abs(s-t)<=a/2;h=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=h*s-o+c;return u*u/(h*h+1)<=a/2*a/2}const $n=1e-4;function qn(t,e,i,n,r){const s=6*i-12*e+6*t,o=9*e+3*n-3*t-9*i,a=3*e-3*t;let l=0;if(Ln(o)){if(In(s)){const t=-a/s;t>=0&&t<=1&&(r[l++]=t)}}else{const t=s*s-4*o*a;if(Ln(t))r[0]=-s/(2*o);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*o),n=(-s-e)/(2*o);i>=0&&i<=1&&(r[l++]=i),n>=0&&n<=1&&(r[l++]=n)}}return l}const Kn=[-1,-1,-1],Zn=[-1,-1];function Jn(){const t=Zn[0];Zn[0]=Zn[1],Zn[1]=t}function Qn(t,e,i,n,r,s,o,a,l,h){if(h>e&&h>n&&h>s&&h>a||h<e&&h<n&&h<s&&h<a)return 0;const c=function(t,e,i,n,r,s){const o=n+3*(e-i)-t,a=3*(i-2*e+t),l=3*(e-t),h=t-r,c=a*a-3*o*l,u=a*l-9*o*h,d=l*l-3*a*h;let p=0;if(Ln(c)&&Ln(u))if(Ln(a))s[0]=0;else{const t=-l/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Ln(t)){const t=u/c,e=-a/o+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*a+1.5*o*(-u+e),n=c*a+1.5*o*(-u-e);i=i<0?-Math.pow(-i,On):Math.pow(i,On),n=n<0?-Math.pow(-n,On):Math.pow(n,On);const r=(-a-(i+n))/(3*o);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-a-2*i*n)/(3*o),l=(-a+i*(n+En*Math.sin(e)))/(3*o),h=(-a+i*(n-En*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[p++]=r),l>=0&&l<=1&&(s[p++]=l),h>=0&&h<=1&&(s[p++]=h)}}return p}(e,n,s,a,h,Kn);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let h=0;h<c;h++){const c=Kn[h],g=0===c||1===c?.5:1;Fn(t,i,r,o,c)<l||(d<0&&(d=qn(e,n,s,a,Zn),Zn[1]<Zn[0]&&d>1&&Jn(),p=Fn(e,n,s,a,Zn[0]),d>1&&(f=Fn(e,n,s,a,Zn[1]))),2===d?c<Zn[0]?u+=p<e?g:-g:c<Zn[1]?u+=f<p?g:-g:u+=a<f?g:-g:c<Zn[0]?u+=p<e?g:-g:u+=a<p?g:-g)}return u}function tr(t,e,i,n,r,s,o,a){if(a>e&&a>n&&a>s||a<e&&a<n&&a<s)return 0;const l=function(t,e,i,n,r){const s=t-2*e+i,o=2*(e-t),a=t-n;let l=0;if(Ln(s)){if(In(o)){const t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{const t=o*o-4*s*a;if(Ln(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-o+e)/(2*s),n=(-o-e)/(2*s);i>=0&&i<=1&&(r[l++]=i),n>=0&&n<=1&&(r[l++]=n)}}return l}(e,n,s,a,Kn);if(0===l)return 0;const h=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(h>=0&&h<=1){let a=0;const c=Nn(e,n,s,h);for(let n=0;n<l;n++){const l=0===Kn[n]||1===Kn[n]?.5:1;Nn(t,i,r,Kn[n])<o||(Kn[n]<h?a+=c<e?l:-l:a+=s<c?l:-l)}return a}const c=0===Kn[0]||1===Kn[0]?.5:1;return Nn(t,i,r,Kn[0])<o?0:s<e?c:-c}function er(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const l=Math.sqrt(i*i-a*a);Kn[0]=-l,Kn[1]=l;const h=Math.abs(n-r);if(h<1e-4)return 0;if(h>=Bt-1e-4){n=0,r=Bt;const e=s?1:-1;return o>=Kn[0]+t&&o<=Kn[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=Bt,r+=Bt);let c=0;for(let e=0;e<2;e++){const i=Kn[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=Bt+t),(t>=n&&t<=r||t+Bt>=n&&t+Bt<=r)&&(t>Tt/2&&t<1.5*Tt&&(e=-e),c+=e)}}return c}function ir(t){return Math.round(t/Tt*1e8)/1e8%2*Tt}function nr(t,e){let i=ir(t[0]);i<0&&(i+=Bt);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=Bt?r=i+Bt:e&&i-r>=Bt?r=i-Bt:!e&&i>r?r=i+(Bt-ir(i-r)):e&&i<r&&(r=i-(Bt-ir(r-i))),t[0]=i,t[1]=r}const rr=[0,0];function sr(t,e,i,n,r){const s=t,o=t.length;let a,l,h=0,c=0,u=0,d=0,p=0;for(let t=0;t<o;t++){const o=s[t],f=0===t;o[0]===Be.M&&t>1&&(i||(h+=Gn(c,u,d,p,n,r))),f&&(c=o[1],u=o[2],d=c,p=u);const g=o[0],v=o[1],m=o[2],y=o[3],b=o[4],x=o[5],w=o[6];let A=b,S=x;rr[0]=A,rr[1]=S,nr(rr,Boolean(o[6])),A=rr[0],S=rr[1];const T=A,C=S-A,_=!!(1-(o[6]?0:1)),B=(n-v)*y/y+v;switch(g){case Be.M:d=v,p=m,c=d,u=p;break;case Be.L:if(i){if(Xn(c,u,v,m,e,n,r))return!0}else h+=Gn(c,u,v,m,n,r)||0;c=v,u=m;break;case Be.C:if(i){if(Vn(c,u,v,m,y,b,x,w,e,n,r))return!0}else h+=Qn(c,u,v,m,y,b,x,w,n,r)||0;c=x,u=w;break;case Be.Q:if(i){if(Hn(c,u,v,m,y,b,e,n,r))return!0}else h+=tr(c,u,v,m,y,b,n,r)||0;c=y,u=b;break;case Be.A:if(a=Math.cos(T)*y+v,l=Math.sin(T)*y+m,f?(d=a,p=l):h+=Gn(c,u,a,l,n,r),i){if(Yn(v,m,y,T,T+C,_,e,B,r))return!0}else h+=er(v,m,y,T,T+C,_,B,r);c=Math.cos(T+C)*y+v,u=Math.sin(T+C)*y+m;break;case Be.R:if(d=c=v,p=u=m,a=d+y,l=p+b,i){if(Xn(d,p,a,p,e,n,r)||Xn(a,p,a,l,e,n,r)||Xn(a,l,d,l,e,n,r)||Xn(d,l,d,p,e,n,r))return!0}else h+=Gn(a,p,a,l,n,r),h+=Gn(d,l,d,p,n,r);break;case Be.Z:if(i){if(Xn(c,u,d,p,e,n,r))return!0}else h+=Gn(c,u,d,p,n,r);c=d,u=p}}return i||function(t,e){return Math.abs(t-e)<$n}(u,p)||(h+=Gn(c,u,d,p,n,r)||0),0!==h}class or{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=Mn(Object.assign({nativeCanvas:pn.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Mn(Object.assign({nativeCanvas:pn.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const ar=new or;var lr=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const cr=Symbol.for("VWindow"),ur=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new j(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(Bn.getNamed(ur,t.env).configure(this,t),this.actived=!0)},this._uid=e.GenAutoIncrementId(),this.global=pn.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const n=this._handler.getWH();this._width=n.width,this._height=n.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,n,r,s){this._handler.setViewBoxTransform(t,e,i,n,r,s)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),n={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},n),n.x-=i.x1,n.y-=i.y1,n}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},t.DefaultWindow=lr([g(),hr("design:paramtypes",[])],t.DefaultWindow);var dr,pr=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},fr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gr=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultGraphicUtil=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=pn.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=ar.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:Hi.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new xe(Object.assign({defaultFontParams:{fontFamily:Hi.fontFamily,fontSize:Hi.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+xe.ALPHABET_CHAR_SET+xe.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const n=Bn.get(cr),r=t.AABBBounds,s=r.width(),o=r.height(),a=-r.x1,l=-r.y1;n.create({viewBox:{x1:a,y1:l,x2:r.x2,y2:r.y2},width:s,height:o,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{transMatrix:n.getViewBoxTransform(),viewBox:n.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const c=n.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}},t.DefaultGraphicUtil=pr([g(),gr(0,p(E)),gr(0,v(_n)),fr("design:paramtypes",[Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(dr||(dr={}));const vr=new $t;t.DefaultTransformUtil=class{constructor(){this.matrix=new $t}init(t){return this.mode=dr.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=dr.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(vr.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:r}=i;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(vr.a,vr.b,vr.c,vr.d,vr.e,vr.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(vr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:n}=e;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(vr.a,vr.b,vr.c,vr.d,vr.e,vr.f),this}scale(t,e,i){return this.mode===dr.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===dr.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return vr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(vr.a,vr.b,vr.c,vr.d,vr.e,vr.f),this}translate(t,e){return this.mode===dr.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===dr.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=pr([g(),fr("design:paramtypes",[])],t.DefaultTransformUtil);const mr={arc:Ki,area:Zi,circle:Ji,line:en,path:nn,symbol:an,text:ln,rect:sn,polygon:rn,richtext:hn,richtextIcon:un,image:cn,group:Qi,glyph:tn},yr=Object.keys(mr);function br(){return{arc:Object.assign({},mr.arc),area:Object.assign({},mr.area),circle:Object.assign({},mr.circle),line:Object.assign({},mr.line),path:Object.assign({},mr.path),symbol:Object.assign({},mr.symbol),text:Object.assign({},mr.text),rect:Object.assign({},mr.rect),polygon:Object.assign({},mr.polygon),richtext:Object.assign({},mr.richtext),richtextIcon:Object.assign({},mr.richtextIcon),image:Object.assign({},mr.image),group:Object.assign({},mr.group),glyph:Object.assign({},mr.glyph)}}function xr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const wr=br();class Ar{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},yr.forEach((t=>{this._defaultTheme[t]=Object.create(wr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,yt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;yr.forEach((n=>{const r=Object.create(wr[n]);t&&t[n]&&xr(r,t[n]),i[n]&&xr(r,i[n]),e[n]&&xr(r,e[n]),this.combinedTheme[n]=r})),e.common&&yr.forEach((t=>{xr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Sr=new Ar;function Tr(t,e){return t.glyphHost?Tr(t.glyphHost):e?(t.isContainer,e):Cr(t)||t.attachedThemeGraphic&&Tr(t.attachedThemeGraphic)||Sr.getTheme()}function Cr(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Sr.getTheme()}return null}var _r=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};class Br extends V{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=e.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return _r(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&yt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=X(i,!0)&&i||Z(i)&&i.capture,r=Z(i)&&i.once,s=$(e)?void 0:e;return t=n?`${t}capture`:t,e=$(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=X(i,!0)&&i||Z(i)&&i.capture,r=$(e)?void 0:e;t=n?`${t}capture`:t,e=$(e)?e:e.handleEvent;const s=Z(i)&&i.once;return super.off(t,e,r,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return Z(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Pr{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Pr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&$(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&$(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Rr extends Pr{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f){throw new Error("Method not implemented.")}}class Mr extends Rr{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new Mr(this.manager);n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice();const r=this.composedDetailPath();return n.detailPath=r&&r.slice(),n.type=this.type,n}}class kr extends Rr{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new kr(this.manager);n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice();const r=this.composedDetailPath();return n.detailPath=r&&r.slice(),n.type=this.type,n}}kr.DOM_DELTA_PIXEL=0,kr.DOM_DELTA_LINE=1,kr.DOM_DELTA_PAGE=2;class Er extends Pr{constructor(t,e){super(),this.type=t,this.detail=e}}const Or="object"==typeof performance&&performance.now?performance:Date;function Lr(t){return"mouse"===t||"pen"===t}class Ir{constructor(t,e){this.dispatch=new V,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(Lr(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,n;if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=Lr(r.pointerType),o=this.trackingData(t.pointerId),a=this.findMountedTarget(o.overTargets);if(o.overTargets&&a&&a!==this.rootTarget&&a!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,a||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(a)){const e=this.createPointerEvent(t,"pointerleave",a||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(a!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let n=null==a?void 0:a.parent;for(;n&&n!==this.rootTarget.parent&&n!==r.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let n=a;for(;n&&n!==this.rootTarget;)i.add(n),n=n.parent;for(;e&&e!==a&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&this.dispatchEvent(r,"touchmove"),s&&(this.dispatchEvent(r,"mousemove"),this.cursorTarget=r.target,this.cursor=(null===(n=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor()),o.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,n;if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),o=Lr(s.pointerType);this.dispatchEvent(s,"pointerover"),o&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursorTarget=s.target,this.cursor=(null===(n=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor());const a=this.clonePointerEvent(s,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),o&&this.notifyTarget(a,"mouseenter"),a.target=a.target.parent;r.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(a)},this.onPointerOut=(t,e)=>{if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=Lr(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=Or.now(),r=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if(Lr(r.pointerType)){const t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}const s=this.trackingData(t.pointerId),o=this.findMountedTarget(s.pressTargetsByButton[t.button]);let a=o;if(o&&!r.composedPath().includes(o)){let e=o;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if(Lr(r.pointerType)){const t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete s.pressTargetsByButton[t.button],a=e}if(a){const e=this.clonePointerEvent(r,"click");e.target=a,e.path=[],e.detailPath=[],s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:n});const o=s.clicksByButton[t.button];o.target===e.target&&n-o.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++o.clickCount:o.clickCount=1,o.target=e.target,o.timeStamp=n,e.detail=o.clickCount,Lr(e.pointerType)?(this.dispatchEvent(e,"click"),2===o.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===o.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(r)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):Lr(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof kr))return void yt.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,n,r,s,o,a;if(!this.rootTarget)return;const l=this.mappingTable[t.type];let h;const c=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[c])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[c])||void 0===n?void 0:n.stage)&&(null===(s=null===(r=this._prePointTargetCache)||void 0===r?void 0:r[c])||void 0===s?void 0:s.stage.renderCount)===(null===(o=this._prePointTargetCache)||void 0===o?void 0:o.stageRenderCount)?h=this._prePointTargetCache[c]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[c]:h,stageRenderCount:null!==(a=null==h?void 0:h.stage.renderCount)&&void 0!==a?a:-1})),l)for(let e=0,i=l.length;e<i;e++)l[e].fn(t,h);else yt.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],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){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){var n,r;const s=this.allocateEvent(Mr);return this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t,s.target=i||this.pickTarget(null!==(n=s.viewX)&&void 0!==n?n:s.global.x,null!==(r=s.viewY)&&void 0!==r?r:s.global.y,s),"string"==typeof e&&(s.type=e),s}createWheelEvent(t,e){var i,n;const r=this.allocateEvent(kr);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget(null!==(i=r.viewX)&&void 0!==i?i:r.global.x,null!==(n=r.viewY)&&void 0!==n?n:r.global.y,r),r}clonePointerEvent(t,e){const i=this.allocateEvent(Mr);i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice();const n=t.composedDetailPath();return i.detailPath=n&&n.slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Mr&&e instanceof Mr&&(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)}copyMouseData(t,e){t instanceof Rr&&e instanceof Rr&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((i=>{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Or.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),n}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}const Dr={dispatchEvent(t){var e;if(!(t instanceof Pr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Er(t,e))}},jr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Ur{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,autoPreventDefault:s=!1,clickInterval:o,supportsTouchEvents:a=r.supportsTouchEvents,supportsPointerEvents:l=r.supportsPointerEvents}=t;this.manager=new Ir(n,{clickInterval:o}),this.globalObj=r,this.supportsPointerEvents=l,this.supportsTouchEvents=a,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=s,this.eventsAdded=!1,this.rootPointerEvent=new Mr,this.rootWheelEvent=new kr,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:n}=this;if(this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];r?"string"==typeof r&&i?n.style.cursor=r:"function"==typeof r?r(t):"object"==typeof r&&i&&Object.assign(n.style,r):i&&it(t)&&!ct(this.cursorStyles,t)&&(n.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const n=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(n)return n;let r=0,s=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=e.clientX||0,s=e.clientY||0}else r=t.clientX||0,s=t.clientY||0;const o=this.domElement.getBoundingClientRect();return{x:r-o.left,y:s-o.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];et(n.button)&&(n.button=0),et(n.buttons)&&(n.buttons=1),et(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),et(n.width)&&(n.width=n.radiusX||1),et(n.height)&&(n.height=n.radiusY||1),et(n.tiltX)&&(n.tiltX=0),et(n.tiltY)&&(n.tiltY=0),et(n.pointerType)&&(n.pointerType="touch"),et(n.pointerId)&&(n.pointerId=n.identifier||0),et(n.pressure)&&(n.pressure=n.force||.5),et(n.twist)&&(n.twist=0),et(n.tangentialPressure)&&(n.tangentialPressure=0),et(n.layerX)&&(n.layerX=n.offsetX=n.clientX),et(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){const i=t;et(i.isPrimary)&&(i.isPrimary=!0),et(i.width)&&(i.width=1),et(i.height)&&(i.height=1),et(i.tiltX)&&(i.tiltX=0),et(i.tiltY)&&(i.tiltY=0),et(i.pointerType)&&(i.pointerType="mouse"),et(i.pointerId)&&(i.pointerId=1),et(i.pressure)&&(i.pressure=.5),et(i.twist)&&(i.twist=0),et(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.x=i,e.global.y=n,e.offset.x=i,e.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){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);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.x=i,t.global.y=n,t.offset.x=i,t.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,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=jr[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Or.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),n=i.width(),r=i.height();return!(e.x<n&&e.y<r&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class Wr{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Wr.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class Nr{static Avaliable(){return!0}avaliable(){return Nr.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Fr{static Avaliable(){return!!pn.global.getRequestAnimationFrame()}avaliable(){return Fr.Avaliable()}tick(t,e){pn.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var zr;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(zr||(zr={}));class Gr{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===zr.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=zr.INITIAL,pn.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),pn.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Fr},{mode:"timeout",cons:Nr},{mode:"manual",cons:Wr}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new Fr;break;case"timeout":t=new Nr;break;case"manual":t=new Wr;break;default:yt.getInstance().warn("非法的计时器模式"),t=new Fr}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==zr.INITIAL&&(this.status=zr.PAUSE,!0)}resume(){return this.status!==zr.INITIAL&&(this.status=zr.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===zr.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===zr.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=zr.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=zr.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Hr{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-Hr.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Hr.bounceIn(2*t):.5*Hr.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/Bt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Bt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/Bt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*Bt/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/Bt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Bt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*Bt/e)*.5+1}}}Hr.quadIn=Hr.getPowIn(2),Hr.quadOut=Hr.getPowOut(2),Hr.quadInOut=Hr.getPowInOut(2),Hr.cubicIn=Hr.getPowIn(3),Hr.cubicOut=Hr.getPowOut(3),Hr.cubicInOut=Hr.getPowInOut(3),Hr.quartIn=Hr.getPowIn(4),Hr.quartOut=Hr.getPowOut(4),Hr.quartInOut=Hr.getPowInOut(4),Hr.quintIn=Hr.getPowIn(5),Hr.quintOut=Hr.getPowOut(5),Hr.quintInOut=Hr.getPowInOut(5),Hr.backIn=Hr.getBackIn(1.7),Hr.backOut=Hr.getBackOut(1.7),Hr.backInOut=Hr.getBackInOut(1.7),Hr.elasticIn=Hr.getElasticIn(1,.3),Hr.elasticOut=Hr.getElasticOut(1,.3),Hr.elasticInOut=Hr.getElasticInOut(1,.3*1.5);class Vr{constructor(){this.id=e.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(e){if(this.paused)return;let i=this.animateHead;for(this.animateCount=0;i;)i.status===t.AnimateStatus.END?this.removeAnimate(i):i.status===t.AnimateStatus.RUNNING||i.status===t.AnimateStatus.INITIAL?(this.animateCount++,i.advance(e)):i.status===t.AnimateStatus.PAUSED&&this.animateCount++,i=i.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const Yr=new Vr;class Xr{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class $r extends Xr{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class qr{constructor(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.GenAutoIncrementId(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yr;this.id=i,this.timeline=n,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Kr(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=kt(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){qr.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qr.mode;e&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}runCb(t){const e=new $r((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=qr.interpolateMap.get(t)||qr.interpolateMap.get("");return!!o&&o(t,e,i,n,r,s)}pause(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}resume(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new Kr(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(this.rawPosition+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===n)return s;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=t.AnimateStatus.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}qr.mode=t.AnimateMode.NORMAL,qr.interpolateMap=new Map;class Kr{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new Zr(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(e){let i=e.duration;(null==i||i<0)&&(i=0);const n=e.easing,r="string"==typeof n?Hr[n]:n,s=this._addStep(i,null,r);return s.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),s,!1),this._appendCustomAnimate(e,s),this}to(e,i,n,r){(null==i||i<0)&&(i=0);const s="string"==typeof n?Hr[n]:n,o=this._addStep(i,null,s);return o.type=t.AnimateStepType.to,this._appendProps(e,o,!!r&&r.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new Zr(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,o,a=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,i<=0)return a=!0,a;if(s=Math.floor(t/i),o=t-s*i,a=t>=n*i+i,a&&(o=i,s=n,t=o*s+i),t===r)return a;const h=!this.reversed!=!(this.bounce&&s%2);return h&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+l,this.updatePosition(a,h),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let o=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return yt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class Zr{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Jr={duration:200,easing:"cubicOut"},Qr={duration:1e3,easing:"quadInOut"};var ts;t.Edge=void 0,(ts=t.Edge||(t.Edge={}))[ts.Top=1]="Top",ts[ts.Right=2]="Right",ts[ts.Bottom=4]="Bottom",ts[ts.Left=8]="Left",ts[ts.ALL=15]="ALL";const es=[!1,!1,!1,!1],is=t=>{var e;let i=!0;if(X(t,!0)){for(let n=0;n<4;n++)es[n]=t,i&&(i=!(null!==(e=es[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)es[e]=!!t[e],i&&(i=!!es[e]);else es[0]=!1,es[1]=!1,es[2]=!1,es[3]=!1;return{isFullStroke:i,stroke:es}},ns=[0,0,0,0],rs=t=>t?nt(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(ns[0]=t[0],ns[2]=t[0],ns[1]=t[1],ns[3]=t[1],ns):t:t:0,ss=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],os=[1,2,3,0,1,2,3,0];function as(t,e,i,n){for(;t>=Bt;)t-=Bt;for(;t<0;)t+=Bt;for(;t>e;)e+=Bt;ss[0].x=i,ss[1].y=i,ss[2].x=-i,ss[3].y=-i;const r=Math.ceil(t/Ct)%4,s=Math.ceil(e/Ct)%4;if(n.add(Mt(t)*i,Ot(t)*i),n.add(Mt(e)*i,Ot(e)*i),r!==s||e-t>Tt){let t=!1;for(let e=0;e<os.length;e++)if(t||r!==os[e]){if(t&&s===os[e])break;if(t){const t=ss[os[e]];n.add(t.x,t.y)}}else{t=!0;const e=ss[r];n.add(e.x,e.y)}}}function ls(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function hs(t,e,i){const{x:n,y:r}=Ut(t.x,t.y,e.x,e.y,i),{x:s,y:o}=Ut(t.x1,t.y1,e.x1,e.y1,i),a=new Ft(n,r,s,o);return a.defined=e.defined,a}function cs(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new Ft(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=hs(t[r],e[r],i)}else{n=e.map((t=>{const e=new Ft(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=hs(t[r],e[r],i)}return n}const us=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],ds=t=>us.includes(t);function ps(t,e){if(nt(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class fs{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fs.TimeOut;this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}fs.TimeOut=1e3/60;const gs=new fs,vs=(t,e)=>it(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t;var ms;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(ms||(ms={}));class ys extends Xr{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0:r.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function bs(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,l=(n-i)*r+i,h=(a-o)*r+o,c=(l-a)*r+a,u=(c-h)*r+h;s[0]=t,s[1]=o,s[2]=h,s[3]=u,s[4]=u,s[5]=c,s[6]=l,s[7]=n}function xs(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],o=i<n?t:e,a=Math.min(i,n),l=Math.abs(n-i)/6,h=(a-2)/6,c=Math.ceil(l/h),u=[o[0],o[1]];let d=l;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],l=o[t+2],h=o[t+3];const p=o[t+4],f=o[t+5];if(d<=0){u.push(n,a,l,h,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const o=t/g;bs(e,n,l,p,o,r),bs(i,a,h,f,o,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],a=s[5],l=r[6],h=s[6]}d-=g-1}return o===t?[u,e]:[t,u]}function ws(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],o=[];for(let t=0;t<e.length;t+=2)o[t]=r,o[t+1]=s;return o}function As(t){const e=[],i=t.length;for(let n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function Ss(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,o=r-2;s<r;o=s,s+=2){const r=t[o],a=t[o+1],l=t[s],h=t[s+1],c=r*h-l*a;e+=c,i+=(r+l)*c,n+=(a+h)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function Ts(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,l=a-2;for(let h=0;h<r;h++){const r=6*h;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%l+2,a=t[o]-i[0],h=t[o+1]-i[1],u=e[s]-n[0]-a,d=e[s+1]-n[1]-h;c+=u*u+d*d}c<s&&(s=c,o=h)}return o}function Cs(t,e,i,n){const r=[];let s;for(let o=0;o<t.length;o++){let a=t[o];const l=e[o],h=Ss(a),c=Ss(l);null==s&&(s=h[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],v=a.length;s&&(a=As(a));const m=6*Ts(a,l,h,c),y=v-2;for(let t=0;t<y;t+=2){const e=(m+t)%y+2;u[t+2]=a[e]-h[0],u[t+3]=a[e+1]-h[1]}if(u[0]=a[m]-h[0],u[1]=a[m+1]-h[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<a.length;e+=2){const r=u[e],s=u[e+1],o=l[e]-c[0],a=l[e+1]-c[1],h=o*i-a*t,d=o*t+a*i;g[e]=h,g[e+1]=d;const p=h-r,f=d-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}else for(let t=0;t<v;t+=2)d[t]=l[t]-c[0],d[t+1]=l[t+1]-c[1];r.push({from:u,to:d,fromCp:h,toCp:c,rotation:-p})}return r}function _s(t,e){let i,n;const r=[],s=[];for(let o=0;o<Math.max(t.length,e.length);o++){const a=t[o],l=e[o];let h,c;a?l?([h,c]=xs(a,l),i=h,n=c):(c=ws(n,a),h=a):(h=ws(i,l),c=l),r.push(h),s.push(c)}return[r,s]}const Bs=(t,e,i,n,r)=>{wt(e,n)&&wt(i,r)||t.push(e,i,n,r,n,r)};function Ps(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const l=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let h,c,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(o=r=i[1],a=s=i[2],[Be.L,Be.C,Be.Q].includes(i[0])&&(n=[o,a])),i[0]){case Be.M:r=o=i[1],s=a=i[2],l(o,a);break;case Be.L:h=i[1],c=i[2],Bs(n,r,s,h,c),r=h,s=c;break;case Be.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Be.Q:h=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(h-r),s+2/3*(c-s),u+2/3*(h-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Be.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],v=!!i[6];h=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(o=h,a=c,l(o,a)):Bs(n,r,s,h,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const m=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=m){const r=v?Math.max(i+m,g):Math.min(i+m,g);Ye(n,i,r,t,e,u,d)}break}case Be.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],v=i[7]+g,m=!!i[8],y=!wt(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,A=Math.sin(g)*d;y?(h=w*b-A*x+t,c=w*x+A*b+e):(h=w+t,c=A+e),p?(o=h,a=c,l(o,a)):Bs(n,r,s,h,c),w=Math.cos(v)*u,A=Math.sin(v)*d,y?(r=w*b-A*x+t,s=w*x+A*b+e):(r=w+t,s=A+e);const S=(m?-1:1)*Math.PI/2;for(let i=g;m?i>v:i<v;i+=S){const r=m?Math.max(i+S,v):Math.min(i+S,v);if(Ye(n,i,r,t,e,u,d),y){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],A=n[r+1],n[r]=(w-t)*b-(A-e)*x+t,n[r+1]=(w-t)*x+(A-e)*b+e}}break}case Be.R:o=r=i[1],a=s=i[2],h=o+i[3],c=a+i[4],l(h,a),Bs(n,h,a,h,c),Bs(n,h,c,o,c),Bs(n,o,c,o,a),Bs(n,o,a,h,a);break;case Be.AT:{const t=i[1],e=i[2],l=i[3],h=i[4],c=i[5],u=zt.distancePP({x:r,y:s},{x:t,y:e}),d=zt.distancePP({x:l,y:h},{x:t,y:e}),p=((r-t)*(l-t)+(s-e)*(h-e))/(u*d),f=c/Math.sin(p/2),g=(r+l-2*t)/2,v=(s+h-2*e)/2,m=zt.distancePP({x:g,y:v},{x:0,y:0}),y=t+f*g/m,b=l+f*v/m,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/u,a=e+x*(s-e)/u,Bs(n,r,s,o,a),r=t+x*(l-t)/d,s=e+x*(h-e)/d;const w=Xt({x:y,y:b},{x:o,y:a}),A=Xt({x:y,y:b},{x:r,y:s});Ye(n,w,A,y,b,c,c);break}case Be.Z:n&&Bs(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function Rs(t,e){for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t+=2){const i=n[t],r=n[t+1],s={x:i,y:r};e.transformPoint({x:i,y:r},s),n[t]=s.x,n[t+1]=s.y}}}function Ms(t){const e=new Di;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}const ks=t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=q(t.width)?t.x1-t.x:t.width,i=q(t.height)?t.y1-t.y:t.height,n=0,r=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(r=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:r,width:e,height:i}};function Es(t,e,i){const n=t/e;let r,s;t>=e?(s=Math.ceil(Math.sqrt(i*n)),r=Math.floor(i/s),0===r&&(r=1,s=i)):(r=Math.ceil(Math.sqrt(i/n)),s=Math.floor(i/r),0===s&&(s=1,r=i));const o=[];for(let t=0;t<r;t++)o.push(s);const a=i-r*s;if(a>0)for(let t=0;t<a;t+=s)t+s<a?o.push(s):o.push(a-t);return o}const Os=(t,e)=>{const{width:i,height:n}=ks(t.attribute),r=Es(i,n,e),s=[],o=n/r.length;for(let t=0,e=r.length;t<e;t++){const e=r[t],n=i/e;for(let i=0;i<e;i++)s.push({x:0+i*n,y:0+t*o,width:n,height:o})}return s},Ls=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),o=t.getComputedAttribute("outerRadius"),a=Math.abs(n-r),l=Math.abs(o-s),h=Es(a*(s+o)/2,l,e),c=[],u=l/h.length,d=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=h.length;t<e;t++){const e=h[t],i=a/e;for(let r=0;r<e;r++)c.push({innerRadius:o-u*t*d,outerRadius:o-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Is=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=Es(s*r,r,e),a=[],l=s/o[0],h=r/o.length,c=n>=i?1:-1;for(let t=0,e=o.length;t<e;t++)for(let e=0,n=o[t];e<n;e++)a.push({innerRadius:h*t,outerRadius:h*(t+1),startAngle:i+l*e*c,endAngle:i+l*(e+1)*c});return a},Ds=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&st(t.x)&&st(t.y)));if(0===i.length)return[];if(1===i.length)return new Array(e).fill(0).map((t=>i[0]));const n=[];if(e<=i.length){const t=i.length/e;let r=0,s=0;for(;r<e;)n.push(i[Math.floor(s)]),s+=t,r++;return n}const r=e-i.length,s=1/(r/(i.length-1)+1);let o=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const a=t[e].x,l=t[e].y,h=t[e+1].x,c=t[e+1].y;for(;i<1&&o<r;)n.push({x:a+(h-a)*i,y:l+(c-l)*i}),i+=s,o+=1}return n},js=(t,e)=>{var i,n;const r=t.attribute;let s=r.points;const o=r.segments;s||(s=o.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const a=s.filter((t=>!1!==t.defined&&st(t.x)&&st(t.y)));if(!a.length)return[];const l=[];a.forEach((t=>{l.push({x:t.x,y:t.y})}));for(let t=a.length-1;t>=0;t--){const e=a[t];l.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const h=[];return zs(s,e,h),h},Us=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Ds(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return Ds(t,e)}return[]};const Ws=t=>t.map((t=>({x:t.x,y:t.y}))),Ns=(t,e,i)=>{const n=t.length,r=[];for(let a=0;a<n;a++){const l=t[a],h=a===n-1?t[0]:t[a+1],c=ve([e.x,e.y],[i.x,i.y],[l.x,l.y],[h.x,h.y]);c&&"boolean"!=typeof c&&r.push({dot:(s=[c[0]-e.x,c[1]-e.x],o=[i.x-e.x,i.y-e.x],s[0]*o[1]-s[1]*o[0]),point:{x:c[0],y:c[1]},edgeIndex:a})}var s,o;if(r.length<2)return[Ws(t),Ws(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],l=r[r.length-1];a.edgeIndex>l.edgeIndex&&([a,l]=[l,a]);const h=a.point,c=l.point,u=[{x:h.x,y:h.y}];for(let e=a.edgeIndex+1;e<=l.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:c.x,y:c.y});const d=[{x:c.x,y:c.y}];for(let e=l.edgeIndex+1,i=a.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:h.x,y:h.y}),[u,d]},Fs=t=>{const e=new Ht;t.forEach((t=>{e.add(t.x,t.y)}));const i=e.width(),n=e.height();if(i>=n){const n=e.x1+i/2;return Ns(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Ns(t,{x:e.x1,y:r},{x:e.x2,y:r})},zs=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Fs(t);zs(r[0],n,i),zs(r[1],e-n,i)}},Gs=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Ws(i)}];const n=[];return zs(i,e,n),n},Hs=(t,e)=>{const i=Ps(t.getParsedPathShape());if(!i.length||e<0)return[];const n=i.length;if(i.length>=e){const t=[],r=Math.floor(i.length/e);for(let s=0;s<e;s++){const o=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:Ms(o)})}return t}const r=[],s=Math.floor(e/n);let o=e;for(let t=0;t<n;t++){const e=[];for(let n=2,r=i[t].length;n<r;n+=2)e.push({x:i[0][n],y:i[0][n+1]});zs(e,t===n-1?o:s,r),o-=s}return r};var Vs;t.ColorType=void 0,(Vs=t.ColorType||(t.ColorType={}))[Vs.Color255=0]="Color255",Vs[Vs.Color1=1]="Color1";class Ys{static Get(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ColorType.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===t.ColorType.Color1){const t=Ys.store1[e];if(t)return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n;const i=se.parseColorString(e);if(i){const t=[i.r/255,i.g/255,i.b/255,i.opacity];Ys.store1[e]=t,Ys.store255[e]=[i.r,i.g,i.b,i.opacity],n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]}return n}const r=Ys.store255[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;const s=se.parseColorString(e);return s&&(Ys.store1[e]=[s.r/255,s.g/255,s.b/255,s.opacity],Ys.store255[e]=[s.r,s.g,s.b,s.opacity],n[0]=s.r,n[1]=s.g,n[2]=s.b,n[3]=s.opacity),n}static Set(e,i,n){if(i===t.ColorType.Color1){if(Ys.store1[e])return;Ys.store1[e]=n,Ys.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Ys.store255[e])return;Ys.store255[e]=n,Ys.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Xs(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&st(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function $s(t,e,i,n,r){return Array.isArray(t)&&!st(t[0])||Array.isArray(e)&&!st(e[0])?new Array(4).fill(0).map(((r,s)=>qs(nt(t)?t[s]:t,nt(e)?e[s]:e,i,n))):qs(t,e,i,n,r)}function qs(e,i,n,r,s){if(!e||!i)return e&&Xs(e)||i&&Xs(i)||!1;let o,a,l=!1,h=!1;if(Array.isArray(e)?o=e:"string"==typeof e?o=Ys.Get(e,t.ColorType.Color255):l=!0,Array.isArray(i)?a=i:"string"==typeof i?a=Ys.Get(i,t.ColorType.Color255):h=!0,l!==h){const t=l?e:i,o=l?i:e,a=Object.assign(Object.assign({},t),{stops:t.stops.map((t=>Object.assign(Object.assign({},t),{color:Xs(o)})))});return l?$s(t,a,n,r,s):$s(a,t,n,r,s)}if(l){if(e.gradient===i.gradient){const t=e,r=i,s=t.stops,o=r.stops;if(s.length!==o.length)return!1;if("linear"===t.gradient)return Ks(t,r,n);if("radial"===t.gradient)return Zs(t,r,n);if("conical"===t.gradient)return Js(t,r,n)}return!1}return s&&s(o,a),Xs(Qs(o,a,n),r)}function Ks(t,e,i){const n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:io(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Zs(t,e,i){const n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:io(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Js(t,e,i){const n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:io(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Qs(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}Ys.store255={},Ys.store1={};const to=[0,0,0,0],eo=[0,0,0,0];function io(e,i,n){return Ys.Get(e,t.ColorType.Color255,to),Ys.Get(i,t.ColorType.Color255,eo),`rgba(${Math.round(to[0]+(eo[0]-to[0])*n)},${Math.round(to[1]+(eo[1]-to[1])*n)},${Math.round(to[2]+(eo[2]-to[2])*n)},${to[3]+(eo[3]-to[3])*n})`}const no=(t,e,i)=>{t.forEach((t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){const n=$s(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},ro=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,l=o.to,h=o.rotation*i,c=o.fromCp,u=o.toCp,d=Math.sin(h),p=Math.cos(h);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<a.length;t+=2){const e=a[t],s=a[t+1],o=e*(1-i)+l[t]*i,h=s*(1-i)+l[t+1]*i;n[t]=o*p-h*d+r[0],n[t+1]=o*d+h*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<a.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],o=n[t+3],a=n[t+4],l=n[t+5];f===i&&g===r&&s===a&&o===l?e.lineTo(a,l):e.bezierCurveTo(i,r,s,o,a,l),f=a,g=l}}},so=(t,e,i)=>{const n=t?Ps(t):[],r=Ps(e);i&&n&&(i.fromTransform&&Rs(n,i.fromTransform.clone().getInverse()),Rs(n,i.toTransfrom));const[s,o]=_s(n,r);return t?Cs(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},oo=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],ao=(e,i)=>{if(!e||!i)return null;const n=[];let r=!1;return Object.keys(e).forEach((s=>{if(!oo.includes(s))return;const o=i[s];q(o)||q(e[s])||o===e[s]||("fill"===s||"stroke"===s?n.push({from:"string"==typeof e[s]?Ys.Get(e[s],t.ColorType.Color255):e[s],to:"string"==typeof o?Ys.Get(o,t.ColorType.Color255):o,key:s}):n.push({from:e[s],to:o,key:s}),r=!0)})),r?n:null};class lo extends Xr{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;ro(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&no(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const ho=(t,e,i,n)=>{var r,s,o;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let a=null==t?void 0:t.globalTransMatrix;n&&a&&(a=n.clone().multiply(a.a,a.b,a.c,a.d,a.e,a.f));const l=so(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:a,toTransfrom:e.globalTransMatrix}),h=ao(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new lo({morphingData:l,otherAttrs:h},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:Qr.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:Qr.easing)),c};class co extends Xr{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{var n;ro(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&no(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const uo=t=>{const e={};return Object.keys(t).forEach((i=>{ds(i)||(e[i]=t[i])})),e},po=(t,e,i)=>{const n=uo(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:n}),e.forEach((t=>{r.appendChild(t)}));else{const s=t.AABBBounds,o=s.width(),a=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=pn.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},fo=(t,e,i)=>{const n=[],r=i?null:uo(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Di).fromCustomPath2D(s)};n.push(pn.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&po(t,n,e),n},go=(t,e,i)=>{const n=[],r=i?null:uo(t.attribute);if("rect"===t.type)Os(t,e).forEach((t=>{n.push(pn.graphicService.creator.rect(i?t:Object.assign({},r,t)))}));else if("arc"===t.type)Ls(t,e).forEach((t=>{n.push(pn.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("circle"===t.type)Is(t,e).forEach((t=>{n.push(pn.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("line"===t.type){const s=Us(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(pn.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else"polygon"===t.type?Gs(t,e).forEach((t=>{n.push(pn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"area"===t.type?js(t,e).forEach((t=>{n.push(pn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"path"===t.type&&Hs(t,e).forEach((t=>{"path"in t?n.push(pn.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(pn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}));return i&&po(t,n,e),n};class vo{static GetImage(t,e){var i;const n=vo.cache.get(t);n?"fail"===n.loadState?pn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):vo.loadImage(t,e)}static GetSvg(t,e){var i;let n=vo.cache.get(t);n?"fail"===n.loadState?pn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},vo.cache.set(t,n),n.dataPromise=pn.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=vo.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},vo.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=pn.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=pn.global.loadBlob(t):"json"===e&&(i.dataPromise=pn.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!vo.isLoading&&vo.toLoadAueue.length){vo.isLoading=!0;const t=vo.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,r={type:"image",loadState:"init"};if(vo.cache.set(i,r),r.dataPromise=pn.global.loadImage(i),r.dataPromise){r.waitingMark=n;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(i,t.data)):(r.loadState="fail",e.imageLoadFail(i))}))}));e.push(t)}else r.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{vo.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),vo.loading()})).catch((t=>{console.error(t),vo.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),vo.loading()}))}}),0)}static loadImage(t,e){const i=mo(t,vo.toLoadAueue);if(-1!==i)return vo.toLoadAueue[i].marks.push(e),void vo.loading();vo.toLoadAueue.push({url:t,marks:[e]}),vo.loading()}static improveImageLoading(t){const e=mo(t,vo.toLoadAueue);if(-1!==e){const t=vo.toLoadAueue.splice(e,1);vo.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function mo(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}vo.cache=new Map,vo.isLoading=!1,vo.toLoadAueue=[],vo.onLoadSuccessCb=[];const yo=new $t,bo=new Vt,xo=["lineWidth","scaleX","scaleY","angle","anchor","visible"],wo=["x","y"],Ao=["scaleX","scaleY"],So=["angle"],To=new Ft,Co={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class _o extends Br{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(_o.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var i;super(),this._AABBBounds=new Vt,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background?this.loadImage(null!==(i=e.background.background)&&void 0!==i?i:e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;To.x=r+(null!==(i=t.scrollX)&&void 0!==i?i:0),To.y=s+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else To.x=r,To.y=s;return To}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;pn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return pn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new $t),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new Ft(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);s?this._setAttributes(s,i,n):q(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xo;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xo;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background?this.loadImage(e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic),this._updateTag=t.UpdateTag.INIT,this.valid=this.isValid(),this.onAttributeUpdate(i)}translate(e,i){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,wo,s);o&&(e=o.x,i=o.y,delete o.x,delete o.y,this._setAttributes(o));const a=this.attribute,l=a.postMatrix;return l?pn.transformUtil.fromMatrix(l,l).translate(e,i):(a.x=(null!==(n=a.x)&&void 0!==n?n:Ni.x)+e,a.y=(null!==(r=a.y)&&void 0!==r?r:Ni.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,wo,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){var r,s;if(1===e&&1===i)return this;const o={type:t.AttributeUpdateType.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,Ao,o);a&&(e=a.scaleX,i=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const l=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new $t,l.postMatrix=t),pn.transformUtil.fromMatrix(t,t).scale(e,i,n)}else l.scaleX=(null!==(r=l.scaleX)&&void 0!==r?r:Ni.scaleX)*e,l.scaleY=(null!==(s=l.scaleY)&&void 0!==s?s:Ni.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,Ao,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}rotate(e,i){var n;if(0===e)return this;const r={type:t.AttributeUpdateType.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:i},this.attribute,So,r);s&&(delete s.angle,this._setAttributes(s,!1,r));const o=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new $t,o.postMatrix=t),pn.transformUtil.fromMatrix(t,t).rotate(e,i)}else o.angle=(null!==(n=o.angle)&&void 0!==n?n:Ni.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}rotateTo(e){const i=this.attribute;if(i.angle===e)return this;const n={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,So,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new qr(null==t?void 0:t.id,this.stage&&this.stage.getTimeline()).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(pn.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!q(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,o,a,l;if(n){const n=Object.keys(e),h=this.getNoWorkAnimateAttr(),c={};let u;n.forEach((t=>{h[t]?(u||(u={}),u[t]=e[t]):c[t]=r&&void 0===e[t]?this.getDefaultAttribute(t):e[t]}));const d=this.animate();d.stateNames=i,d.to(c,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==o?o:Jr.duration,null!==(l=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==l?l:Jr.easing),u&&this.setAttributes(u,!1,{type:t.AttributeUpdateType.STATE})}else this.stopStateAnimates(),this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();ct(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return bo.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(bo),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=n();i[0]=r.x1+(r.x2-r.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=n();i[1]=r.y1+(r.y2-r.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Ni.x,y:e=Ni.y,scaleX:i=Ni.scaleX,scaleY:n=Ni.scaleY,angle:r=Ni.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute;let l=[0,0];const h={};if(o&&(l=this.getAnchor(o,h)),!s||1===i&&1===n)!function(t,e,i,n,r,s,o,a){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,f=Mt(o),g=Ot(o);let v,m;a?(v=a[0],m=a[1]):(v=i,m=n);const y=v-i,b=m-n,x=l*f+c*g,w=h*f+u*g,A=c*f-l*g,S=u*f-h*g;t.a=r*x,t.b=r*w,t.c=s*A,t.d=s*S,t.e=d+l*v+c*m-x*y-A*b,t.f=p+h*v+u*m-w*y-S*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,o&&l);else{const o=this._transMatrix;o.reset(),o.translate(l[0],l[1]),o.rotate(r),o.translate(-l[0],-l[1]),o.translate(t,e),l=this.getAnchor(s,h),pn.transformUtil.fromMatrix(o,o).scale(i,n,{x:l[0],y:l[1]})}const c=this.getOffsetXY(Ni);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,a){const t=yo.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),pn.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const o={};if(n.customAnimate)n.customAnimate.update(s,r,o);else{const t=n.props,a=n.parsedProps,l=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,l)}this.setAttributes(o,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,o,a,l,h){h||(h=Object.keys(o),n.propKeys=h),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):h.forEach((s=>{var h;if(!e.validAttr(s))return;const c=o[s],u=null!==(h=a&&a[s])&&void 0!==h?h:t.getLastPropByName(s,n);if(null==c||null==u)return void(i[s]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,l,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=l}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const o=r.fillColorArray,a=$s(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){r||(r={});const o=r.strokeColorArray,a=$s(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){r||(r={});const o=r.shadowColorArray,a=$s(e,null!=o?o:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(n[i]=a),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return Tr(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:pn.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return it(t,!0)?this.pathProxy=(new Di).fromString(t):this.pathProxy=new Di,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(vo.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(at(t)||t.includes("/")||lt(t))&&(vo.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):Z(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",pn.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Er(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}_o.mixin(Dr);class Bo{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Po(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function Ro(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let r=n.data;const s=n.index,o=r.search(/\s/);let a=r,l=!0;-1!==o&&(a=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));const h=a;if(i){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),l=a!==n.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:l,rawTagName:h}}const Mo=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class ko{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const r=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t<s;t++)r.push(n[t]);i.push(r),n=e.exec(t)}return i}(t,Mo),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],i=r[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Bo("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=Po(t,">",s,"Closing Tag is not closed."),o=r.lastIndexOf(".");r=r.substring(0,o),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",s=e}else if("?"===t[s+1])s=Ro(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=Po(t,"--\x3e",s+4,"Comment is not closed.");else{const o=Ro(t,s,!1);let a=o.tagName,l=o.tagExp;const h=o.attrExpPresent,c=o.closeIndex;if(a!==e.tagname&&(r+=r?"."+a:a),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),l=a):l=l.substr(0,l.length-1);const t=new Bo(a);a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Bo(a);this.tagsNodeStack.push(i),a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(i,t,r),i=t}n="",s=c}else n+=t[s];return e.child}}function Eo(t,e){return Oo(t)}function Oo(t,e){const i={};for(let e=0;e<t.length;e++){const r=t[e],s=Lo(r);if(void 0!==s&&r[s]){const t=Oo(r[s]);n=t,Object.keys(n).length,r[":@"]&&Io(t,r[":@"]),void 0!==i[s]&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(t)):i[s]=t}}var n;return i}function Lo(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Io(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let r=0;r<n;r++){const n=i[r];t[n]=e[n]}}}class Do{constructor(t){this.options=Object.assign({},Do.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Eo(new ko(this.options).parseXml(t),this.options)}}function jo(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function Uo(t){return t.startsWith("<")}Do.defaultOptions={};var Wo=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};function No(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let Fo=0;function zo(){return Fo++}var Go;function Ho(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)Xo(e[s])?n?r+=e[s]:(n=1,r=e[s]):(n&&(i.push({text:r,direction:t.TextDirection.VERTICAL}),r="",n=0),i.push({text:e[s],direction:t.TextDirection.HORIZONTAL}));return r&&i.push({text:r,direction:t.TextDirection.VERTICAL}),i}t.TextDirection=void 0,(Go=t.TextDirection||(t.TextDirection={}))[Go.HORIZONTAL=0]="HORIZONTAL",Go[Go.VERTICAL=1]="VERTICAL";const Vo=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Vo.set(t,!0)));const Yo=new Map;function Xo(t){if(Vo.has(t))return!0;if(Yo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function $o(t,e){const i=t.attribute;i&&i.split(";").forEach((t=>{if(!t)return;const i=t.split(":");if(2===i.length){const t=parseFloat(i[1]);e[i[0].trim()]=isFinite(t)?t:i[1].trim()}else{let t="";for(let e=1;e<i.length;e++)e>1&&(t+=":"),t+=i[e].trim();e[i[0].trim()]=t}}))}[""].forEach((t=>Yo.set(t,!0)));const qo=zo(),Ko=zo(),Zo=zo(),Jo=zo(),Qo=zo(),ta=zo(),ea=zo(),ia=zo(),na=zo(),ra=zo(),sa=zo(),oa=zo(),aa=zo(),la=zo(),ha=zo(),ca=zo(),ua=Symbol.for("GraphicService"),da=Symbol.for("GraphicCreator"),pa={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},fa=Object.keys(pa),ga={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},va=Object.keys(ga);var ma;t.GroupUpdateAABBBoundsMode=void 0,(ma=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[ma.LESS_GROUP=0]="LESS_GROUP",ma[ma.MORE_GROUP=1]="MORE_GROUP";class ya extends _o{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=ta,this._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Ar),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Ar)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren((t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}showAll(){this.setAttribute("visible",!0),this.forEachChildren((t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}containsPoint(e,i,n){if(n===t.IContainPointMode.GLOBAL){const t=new Ft(e,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),this.AABBBounds.contains(t.x,t.y)}return this.AABBBounds.contains(e,i)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;pn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),pn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Ni.x,y:e=Ni.y,dx:i=Ni.dx,dy:n=Ni.dy,scaleX:r=Ni.scaleX,scaleY:s=Ni.scaleY,angle:o=Ni.angle,postMatrix:a}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==r||1!==s||0!==o||a)return super.doUpdateLocalMatrix();this._transMatrix.reset()}doUpdateAABBBounds(){const t=this.attribute,e=Tr(this).group;this._AABBBounds.clear();const i=pn.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=rs(n);return r&&i.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),pn.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),pn.graphicService.onClearIncremental(this,this.stage)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,pn.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{pn.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),pn.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=pn.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new ya(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ya.NOWORK_ANIMATE_ATTR}}function ba(t){return new ya(t)}ya.NOWORK_ANIMATE_ATTR=Co;class xa extends ya{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=n.layerHandler,this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Ar,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{pn.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{pn.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const wa=Symbol.for("TransformUtil"),Aa=Symbol.for("GraphicUtil"),Sa=Symbol.for("LayerService"),Ta=Symbol.for("StaticLayerHandlerContribution"),Ca=Symbol.for("DynamicLayerHandlerContribution"),_a=Symbol.for("VirtualLayerHandlerContribution");var Ba,Pa=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ra=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.DefaultLayerService=Ba=class{static GenerateLayerId(){return`${Ba.idprefix}_${Ba.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=pn.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?Bn.get(Ta):"dynamic"===t?Bn.get(Ca):Bn.get(_a),e}createLayer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};var i;this.tryInit();let n=this.getRecommendedLayerType(e.layerMode);n=e.main||e.canvasId?"static":n;const r=this.getLayerHandler(n),s=new xa(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:n,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:Ba.GenerateLayerId(),layerHandler:r})),o=this.layerMap.get(t)||[];return o.push(s),this.layerMap.set(t,o),this.staticLayerCountInEnv--,s}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}},t.DefaultLayerService.idprefix="visactor_layer",t.DefaultLayerService.prefix_count=0,t.DefaultLayerService=Ba=Pa([g(),Ra("design:paramtypes",[])],t.DefaultLayerService);var Ma=new i((e=>{e(W).to(t.DefaultGlobal).inSingletonScope(),e(cr).to(t.DefaultWindow),e(Aa).to(t.DefaultGraphicUtil).inSingletonScope(),e(wa).to(t.DefaultTransformUtil).inSingletonScope(),e(Sa).to(t.DefaultLayerService).inSingletonScope()}));function ka(t,e){return!(!t&&!e)}function Ea(t,e){let i;return i=nt(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Oa(t,e,i){return i&&t*e>0}function La(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function Ia(t,e){return t*e>0}function Da(t,e,i,n){return t*e>0&&0!==i&&0!==n}function ja(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const l=Tr(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:f=l.strokeOpacity,visible:g=l.visible,x:v=l.x,y:m=l.y}=t.attribute,y=Oa(u,d,h),b=Ia(u,f),x=ka(h),w=Ea(c,p);if(!g)return!0;if(!x&&!w)return!0;if(!(y||b||o||a))return!0;e.beginPath();return $e(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i-v,n-m,l),e.stroke())),x&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,i-v,n-m,l),e.fill())),!0}function Ua(t,e,i,n,r,s,o,a){const l=i-t,h=n-e,c=o-r,u=a-s;let d=u*l-c*h;return d*d<St?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*l,e+d*h])}function Wa(t,e,i,n,r,s,o){const a=t-i,l=e-n,h=(o?s:-s)/Math.sqrt(a*a+l*l),c=h*l,u=-h*a,d=t+c,p=e+u,f=i+c,g=n+u,v=(d+f)/2,m=(p+g)/2,y=f-d,b=g-p,x=y*y+b*b,w=r-s,A=d*g-f*p,S=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-A*A));let T=(A*b-y*S)/x,C=(-A*y-b*S)/x;const _=(A*b+y*S)/x,B=(-A*y+b*S)/x,P=T-v,R=C-m,M=_-v,k=B-m;return P*P+R*R>M*M+k*k&&(T=_,C=B),{cx:T,cy:C,x01:-c,y01:-u,x11:T*(r/w-1),y11:C*(r/w-1)}}function Na(t,e,i,n,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=Pt(l-a),c=l>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=St)e.moveTo(i,n);else if(h>=Bt-St)e.moveTo(i+r*Mt(a),n+r*Ot(a)),e.arc(i,n,r,a,l,!c),s>St&&(e.moveTo(i+s*Mt(l),n+s*Ot(l)),e.arc(i,n,s,l,a,c));else{const d=t.getParsedCornerRadius(),p=nt(d),{outerDeltaAngle:f,innerDeltaAngle:g,outerStartAngle:v,outerEndAngle:m,innerEndAngle:y,innerStartAngle:b}=t.getParsePadAngle(a,l),x=p?d[0]:d,w=p?d[1]:d,A=p?d[2]:d,S=p?d[3]:d,T=Math.max(w,x),C=Math.max(A,S);let _=T,B=C;const P=r*Mt(v),R=r*Ot(v),M=s*Mt(y),k=s*Ot(y);let E,O,L,I;if((C>St||T>St)&&(E=r*Mt(m),O=r*Ot(m),L=s*Mt(b),I=s*Ot(b),h<Tt)){const t=Ua(P,R,L,I,E,O,M,k);if(t){const e=P-t[0],i=R-t[1],n=E-t[0],o=O-t[1],a=1/Ot(Dt((e*n+i*o)/(Lt(e*e+i*i)*Lt(n*n+o*o)))/2),l=Lt(t[0]*t[0]+t[1]*t[1]);B=Et(C,(s-l)/(a-1)),_=Et(T,(r-l)/(a+1))}}if(f<.001)o&&(o[3]||o[1])&&e.moveTo(i+P,n+R),u=!0;else if(_>St){const t=Et(x,_),s=Et(w,_),a=Wa(L,I,P,R,r,t,Number(c)),l=Wa(E,O,M,k,r,s,Number(c));_<T&&t===s?!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,_,Rt(a.y01,a.x01),Rt(l.y01,l.x01),!c)):e.moveTo(i+a.cx+_*Mt(Rt(l.y01,l.x01)),n+a.cy+_*Ot(Rt(l.y01,l.x01))):!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),t>0&&e.arc(i+a.cx,n+a.cy,t,Rt(a.y01,a.x01),Rt(a.y11,a.x11),!c),e.arc(i,n,r,Rt(a.cy+a.y11,a.cx+a.x11),Rt(l.cy+l.y11,l.cx+l.x11),!c),s>0&&e.arc(i+l.cx,n+l.cy,s,Rt(l.y11,l.x11),Rt(l.y01,l.x01),!c)):s>0?e.moveTo(i+l.cx+s*Mt(Rt(l.y01,l.x01)),n+l.cy+s*Ot(Rt(l.y01,l.x01))):e.moveTo(i+E,n+r*Ot(m))}else!o||o[0]?(e.moveTo(i+P,n+R),e.arc(i,n,r,v,m,!c)):e.moveTo(i+r*Mt(m),n+r*Ot(m));if(!(s>St)||g<.001)!o||o[1]?e.lineTo(i+M,n+k):e.moveTo(i+M,n+k),u=!0;else if(B>St){const t=Et(S,B),r=Et(A,B),a=Wa(M,k,E,O,s,-r,Number(c)),l=Wa(P,R,L,I,s,-t,Number(c));if(!o||o[1]?e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01):e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),B<C&&t===r){const t=Rt(l.y01,l.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,B,Rt(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+Mt(t),n+a.cy+Ot(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,Rt(a.y01,a.x01),Rt(a.y11,a.x11),!c),e.arc(i,n,s,Rt(a.cy+a.y11,a.cx+a.x11),Rt(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(i+l.cx,n+l.cy,t,Rt(l.y11,l.x11),Rt(l.y01,l.x01),!c)):t>0?e.moveTo(i+l.cx+t*Mt(Rt(l.y01,l.x01)),n+l.cy+t*Ot(Rt(l.y01,l.x01))):e.moveTo(i+L,n+I)}else!o||o[1]?e.lineTo(i+M,n+k):e.moveTo(i+M,n+k),!o||o[2]?e.arc(i,n,s,y,b,c):e.moveTo(i+s*Mt(b),n+s*Ot(b))}return o?o[3]&&e.lineTo(i+r*Mt(a),n+r*Ot(a)):e.closePath(),u}class Fa{static GetCanvas(){try{return Fa.canvas||(Fa.canvas=pn.global.createCanvas({})),Fa.canvas}catch(t){return null}}static GetCtx(){if(!Fa.ctx){const t=Fa.GetCanvas();Fa.ctx=t.getContext("2d")}return Fa.ctx}}class za extends qt{static getInstance(){return za._instance||(za._instance=new za),za._instance}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Fa.GetCanvas(),n=Fa.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,o=`${t}${e}${i}${n}`;r.forEach((t=>o+=t.join())),o+=s;let a=this.dataMap.get(o);return a||(a={data:new za(r,s),timestamp:[]},this.addLimitedTimestamp(a,Date.now(),{}),this.dataMap.set(o,a)),this.clearCache(this.dataMap,this.cacheParams),a.data}}class Ga{static GetSize(t){for(let e=0;e<Ga.ImageSize.length;e++)if(Ga.ImageSize[e]>=t)return Ga.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=Ga.GenKey(t,e,i,n,r),l=Ga.cache[a];if(!l||0===l.length)return null;for(let t=0;t<l.length;t++)if(l[t].width>=s&&l[t].height>=o)return l[t].pattern;return null}static Set(t,e,i,n,r,s,o,a){const l=Ga.GenKey(t,e,i,n,r);Ga.cache[l]?Ga.cache[l].push({width:o,height:a,pattern:s}):Ga.cache[l]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function Ha(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=Bt;for(;i>Bt;)i-=Bt;if(i<s)return r[0].color;if(i>o)return r[0].color;let a,l,h=(i-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=h){a=r[t-1],l=r[t];break}return h=(h-a.offset)/(l.offset-a.offset),$s(a.color,l.color,h,!1)}function Va(t,e,i,n,r,s,o,a,l){const h=Math.floor(180*r/Math.PI),c=Fa.GetCanvas(),u=Fa.GetCtx();if(!u)return null;const d=Ga.GetSize(a),p=Ga.GetSize(l);let f=Ga.Get(e,i,n,s,o,d,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),v=h+1,m=r/Math.max(1,v-1),y=za.getInstance().GetOrCreate(i,n,d,p,e,v),b=2*Math.PI*g/360;c.width=d,c.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=v-1;t<e&&!(s+t*m>o);t++){const e=y.getColor(t);u.beginPath(),u.rotate(m),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&Ga.Set(e,i,n,s,o,f,d,p),f}Ga.cache={},Ga.ImageSize=[20,40,80,160,320,640,1280,2560];const Ya=Symbol.for("ArcRenderContribution"),Xa=Symbol.for("AreaRenderContribution"),$a=Symbol.for("CircleRenderContribution"),qa=Symbol.for("GroupRenderContribution"),Ka=Symbol.for("ImageRenderContribution"),Za=Symbol.for("PathRenderContribution"),Ja=Symbol.for("PolygonRenderContribution"),Qa=Symbol.for("RectRenderContribution"),tl=Symbol.for("SymbolRenderContribution"),el=Symbol.for("TextRenderContribution"),il=Symbol.for("CommonRenderContribution"),nl=Symbol.for("InteractiveSubRenderContribution"),rl=["radius","startAngle","endAngle",...xo];class sl extends _o{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=Jo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}doUpdateAABBBounds(t){const e=Tr(this).circle;this._AABBBounds.clear();const i=this.attribute,n=pn.graphicService.updateCircleAABBBounds(i,Tr(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=rs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,rl)}needUpdateTag(t){return super.needUpdateTag(t,rl)}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),a=new Di;return a.arc(0,0,r,s,o),a}clone(){return new sl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sl.NOWORK_ANIMATE_ATTR}}function ol(t){return new sl(t)}function al(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*i+"px "+(a||"sans-serif")}function ll(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0}function hl(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function cl(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function ul(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[we(i)]=t[i])})),["fontSize","lineHeight"].forEach((n=>{const r=we(n);q(t[n])||(e[r]=i(t[n]))})),K(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&it(t.fill)&&(e.color=t.fill),e}sl.NOWORK_ANIMATE_ATTR=Co;class dl{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,s,o,a,l){const h=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a,l);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?u[0]=c[0]/-2:"right"!==n&&"end"!==n||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,h,n,r,s)}GetLayoutByLines(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((t=>t.toString()));const l=[],h=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),o),l.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s,a).str,width:e});h[0]=o}else{let e,i;o=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),o=Math.max(o,e),l.push({str:i,width:e});h[0]=o}h[1]=l.length*n,h[0]=l.reduce(((t,e)=>Math.max(t,e.width)),0);const c={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(c,e,i),this.layoutWithBBox(c,l,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],o=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-o)/2:"bottom"===n&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const pl=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...xo];class fl extends _o{get font(){const t=Tr(this).text;return this._font||(this._font=al(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=Tr(this).text;if(!this.isSimplify())return;const{maxLineWidth:n=i.maxLineWidth}=e;return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=Tr(this).text,e=this.attribute;if(this.isMultiLine)return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),"vertical"===e.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==e.text.toString():null!=this.clipedText&&this.clipedText!==e.text.toString())}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=ca,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return nt(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}doUpdateAABBBounds(){const t=Tr(this).text;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateWrapAABBBounds(t){var e,i,n,r;const s=Tr(this).text,{fontFamily:o=s.fontFamily,textAlign:a=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:d=s.stroke,lineWidth:p=s.lineWidth,wordBreak:f=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:v=s.ignoreBuf,suffixPosition:m=s.suffixPosition,heightLimit:y=0,lineClamp:b}=this.attribute,x=null!==(e=vs(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,w=v?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const A=pn.graphicUtil.textMeasure,S=new dl(o,{fontSize:h,fontWeight:g,fontFamily:o},A),T=nt(t)?t.map((t=>t.toString())):[t.toString()],C=[],_=[0,0];let B=1/0;if(y>0&&(B=Math.max(Math.floor(y/x),1)),b&&(B=Math.min(B,b)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<T.length;t++){const e=T[t];let i=!0;if(t===B-1){const i=S.textMeasure.clipTextWithSuffix(e,S.textOptions,u,c,!1,m,t!==T.length-1);C.push({str:i.str,width:i.width});break}const s=S.textMeasure.clipText(e,S.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=S.textMeasure.clipTextWithSuffix(e,S.textOptions,u,c,!1,m);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;i=!1}if(C.push({str:s.str,width:s.width}),s.str.length===e.length);else if(i){const i=e.substring(s.str.length);T.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,i=0;for(let n=0,r=T.length;n<r;n++){if(n===B-1){const t=S.textMeasure.clipTextWithSuffix(T[n],S.textOptions,u,c,!1,m);C.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=T[n],t=S.textMeasure.measureTextWidth(e,S.textOptions,"break-word"===f),i=Math.max(i,t),C.push({str:e,width:t})}_[0]=i}_[1]=C.length*(x+w);const P={xOffset:0,yOffset:0,width:_[0],height:_[1]};S.LayoutBBox(P,a,l);const R=S.layoutWithBBox(P,C,a,l,x);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=Tr(this).text,{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),r}updateMultilineAABBBounds(t){const e=Tr(this).text,{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),r}updateHorizontalSinglelineAABBBounds(t){var e,i;const n=Tr(this).text,{wrap:r=n.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds([t]);const s=pn.graphicUtil.textMeasure;let o,a;const l=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:c=n.ellipsis,textAlign:u=n.textAlign,textBaseline:d=n.textBaseline,fontFamily:p=n.fontFamily,fontSize:f=n.fontSize,fontWeight:g=n.fontWeight,stroke:v=n.stroke,lineWidth:m=n.lineWidth,ignoreBuf:y=n.ignoreBuf,whiteSpace:b=n.whiteSpace,suffixPosition:x=n.suffixPosition}=l;if("normal"===b)return this.updateWrapAABBBounds(t);const w=y?0:Math.max(2,.075*f),A=l.fontSize||n.fontSize,S=null!==(e=vs(l.lineHeight,A))&&void 0!==e?e:A+w;if(!this.shouldUpdateShape()&&this.cache){o=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=hl(u,o),e=cl(d,S,f);return this._AABBBounds.set(t,e,t+o,e+S),v&&this._AABBBounds.expand(m/2),this._AABBBounds}if(Number.isFinite(h)){if(c){const e=!0===c?n.ellipsis:c,i=s.clipTextWithSuffix(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p},h,e,!1,x);a=i.str,o=i.width}else{const e=s.clipText(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p},h,!1);a=e.str,o=e.width}this.cache.clipedText=a,this.cache.clipedWidth=o}else o=s.measureTextWidth(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=o;this.clearUpdateShapeTag();const T=hl(u,o);let C=S;pn.global&&pn.global.isSafari()&&(C+=.2*f);const _=cl(d,C,f,w);return this._AABBBounds.set(T,_,T+o,_+C),v&&this._AABBBounds.expand(m/2),this._AABBBounds}getBaselineMapAlign(){return fl.baselineMapAlign}getAlignMapBaseline(){return fl.alignMapBaseline}updateVerticalSinglelineAABBBounds(e){var i,n,r;const s=Tr(this).text,o=pn.graphicUtil.textMeasure;let a;const l=this.attribute,{ignoreBuf:h=s.ignoreBuf}=l,c=h?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontSize:p=s.fontSize,fontWeight:f=s.fontWeight,fontFamily:g=s.fontFamily,stroke:v=s.stroke,lineWidth:m=s.lineWidth,verticalMode:y=s.verticalMode,suffixPosition:b=s.suffixPosition}=l,x=null!==(i=vs(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==i?i:(l.fontSize||s.fontSize)+c;let{textAlign:w=s.textAlign,textBaseline:A=s.textBaseline}=l;if(!y){const t=w;w=null!==(n=fl.baselineMapAlign[A])&&void 0!==n?n:"left",A=null!==(r=fl.alignMapBaseline[t])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){a=this.cache.clipedWidth;const t=hl(w,a),e=cl(A,x,p);return this._AABBBounds.set(e,t,e+x,t+a),v&&this._AABBBounds.expand(m/2),this._AABBBounds}let S=[Ho(e.toString())];if(Number.isFinite(u)){if(d){const t=!0===d?s.ellipsis:d,e=o.clipTextWithSuffixVertical(S[0],{fontSize:p,fontWeight:f,fontFamily:g},u,t,!1,b);S=[e.verticalList],a=e.width}else{const t=o.clipTextVertical(S[0],{fontSize:p,fontWeight:f,fontFamily:g},u,!1);S=[t.verticalList],a=t.width}this.cache.verticalList=S,this.cache.clipedWidth=a}else a=0,S[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?p:o.measureTextWidth(e.text,{fontSize:p,fontWeight:f,fontFamily:g});a+=i,e.width=i})),this.cache.verticalList=S,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const T=hl(w,a),C=cl(A,x,p);return this._AABBBounds.set(C,T,C+x,T+a),v&&this._AABBBounds.expand(m/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const n=Tr(this).text,{wrap:r=n.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds(t);const s=this.attribute,{fontFamily:o=n.fontFamily,textAlign:a=n.textAlign,textBaseline:l=n.textBaseline,fontSize:h=n.fontSize,fontWeight:c=n.fontWeight,ellipsis:u=n.ellipsis,maxLineWidth:d,stroke:p=n.stroke,lineWidth:f=n.lineWidth,whiteSpace:g=n.whiteSpace,suffixPosition:v=n.suffixPosition}=s,m=null!==(e=vs(s.lineHeight,s.fontSize||n.fontSize))&&void 0!==e?e:s.fontSize||n.fontSize;if("normal"===g)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const y=pn.graphicUtil.textMeasure,b=new dl(o,{fontSize:h,fontWeight:c,fontFamily:o},y).GetLayoutByLines(t,a,l,m,!0===u?n.ellipsis:u||void 0,!1,d,v),{bbox:x}=b;return this.cache.layoutData=b,this.clearUpdateShapeTag(),this._AABBBounds.set(x.xOffset,x.yOffset,x.xOffset+x.width,x.yOffset+x.height),p&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i,n,r;const s=Tr(this).text,o=pn.graphicUtil.textMeasure;let a;const l=this.attribute,{ignoreBuf:h=s.ignoreBuf}=l,c=h?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontFamily:p=s.fontFamily,fontSize:f=s.fontSize,fontWeight:g=s.fontWeight,stroke:v=s.stroke,lineWidth:m=s.lineWidth,verticalMode:y=s.verticalMode,suffixPosition:b=s.suffixPosition}=l,x=null!==(i=vs(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==i?i:(l.fontSize||s.fontSize)+c;let{textAlign:w=s.textAlign,textBaseline:A=s.textBaseline}=l;if(!y){const t=w;w=null!==(n=fl.baselineMapAlign[A])&&void 0!==n?n:"left",A=null!==(r=fl.alignMapBaseline[t])&&void 0!==r?r:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=kt(e,a)}));const t=hl(w,a),e=this.cache.verticalList.length*x,i=cl(A,e,f);return this._AABBBounds.set(i,t,i+e,t+a),v&&this._AABBBounds.expand(m/2),this._AABBBounds}const S=e.map((t=>Ho(t.toString())));S.forEach(((e,i)=>{if(Number.isFinite(u))if(d){const t=!0===d?s.ellipsis:d,n=o.clipTextWithSuffixVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,t,!1,b);S[i]=n.verticalList,a=n.width}else{const t=o.clipTextVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,!1);S[i]=t.verticalList,a=t.width}else a=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?f:o.measureTextWidth(e.text,{fontSize:f,fontWeight:g,fontFamily:p});a+=i,e.width=i}))})),this.cache.verticalList=S,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=kt(e,a)}));const T=hl(w,a),C=this.cache.verticalList.length*x,_=cl(A,C,f);return this._AABBBounds.set(_,T,_+C,T+a),v&&this._AABBBounds.expand(m/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).text[t]}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pl;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pl;return super.needUpdateTag(t,e)}clone(){return new fl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fl.NOWORK_ANIMATE_ATTR}}function gl(t){return new fl(t)}fl.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Co),fl.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fl.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const vl=["heightLimit","lineClamp"];class ml extends fl{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return nt(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n,r;const s=Tr(this).text,{fontFamily:o=s.fontFamily,textAlign:a=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:d=s.stroke,lineWidth:p=s.lineWidth,wordBreak:f=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:v=s.ignoreBuf,heightLimit:m=0,suffixPosition:y=s.suffixPosition,lineClamp:b}=this.attribute,x=null!==(e=vs(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,w=v?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const A=pn.graphicUtil.textMeasure,S=new dl(o,{fontSize:h,fontWeight:g,fontFamily:o},A),T=t.map((t=>t.toString())),C=[],_=[0,0];let B=1/0;if(m>0&&(B=Math.max(Math.floor(m/x),1)),b&&(B=Math.min(B,b)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<T.length;t++){const e=T[t];let i=!0;if(t===B-1){const t=S.textMeasure.clipTextWithSuffix(e,S.textOptions,u,c,!1,y);C.push({str:t.str,width:t.width});break}const s=S.textMeasure.clipText(e,S.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=S.textMeasure.clipTextWithSuffix(e,S.textOptions,u,c,!1,y);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;i=!1}if(C.push({str:s.str,width:s.width}),s.str.length===e.length);else if(i){const i=e.substring(s.str.length);T.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,i=0;for(let n=0,r=T.length;n<r;n++){if(n===B-1){const t=S.textMeasure.clipTextWithSuffix(T[n],S.textOptions,u,c,!1,y);C.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=T[n],t=S.textMeasure.measureTextWidth(e,S.textOptions,"break-word"===f),i=Math.max(i,t),C.push({str:e,width:t})}_[0]=i}_[1]=C.length*(x+w);const P={xOffset:0,yOffset:0,width:_[0],height:_[1]};S.LayoutBBox(P,a,l);const R=S.layoutWithBBox(P,C,a,l,x);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<vl.length;e++){const i=vl[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<vl.length;e++)if(t===vl[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return ml.NOWORK_ANIMATE_ATTR}}function yl(t){return new ml(t)}class bl{bounds(t,e){if(st(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function xl(t,e,i,n,r){return r?t.arc(i,n,e,0,_t,!1,r):t.arc(i,n,e,0,_t),!1}var wl=new class extends bl{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,r){return xl(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return xl(t,e/2+r,i,n,s)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var Al=new class extends bl{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,e/6,i,n,r,s)}};function Sl(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var Tl=new class extends bl{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return Sl(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return Sl(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Sl(t,e/2+r,i,n,s)}};function Cl(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var _l=new class extends bl{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Cl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Cl(t,e/2+r,i,n)}};class Bl extends bl{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}var Pl=new Bl;var Rl=new class extends Bl{constructor(){super(...arguments),this.type="triangle"}};const Ml=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),kl=Math.sin(_t/10)*Ml,El=-Math.cos(_t/10)*Ml;function Ol(t,e,i,n){const r=kl*e,s=El*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=_t*o/5,l=Math.cos(a),h=Math.sin(a);t.lineTo(h*e+i,-l*e+n),t.lineTo(l*r-h*s+i,h*r+l*s+n)}return t.closePath(),!0}var Ll=new class extends bl{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return Ol(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ol(t,e/2+r,i,n)}};const Il=Lt(3);function Dl(t,e,i,n){const r=e,s=r/Il,o=s/5,a=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(o/2+i,n),t.lineTo(o/2+i,a+n),t.lineTo(-o/2+i,a+n),t.lineTo(-o/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var jl=new class extends bl{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return Dl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Dl(t,e/2+r,i,n)}};function Ul(t,e,i,n){const r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Wl=new class extends bl{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Ul(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ul(t,e/2+r,i,n)}};function Nl(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Fl=new class extends bl{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Nl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Nl(t,e/2+r,i,n)}};const zl=-.5,Gl=Lt(3)/2,Hl=1/Lt(12);function Vl(t,e,i,n){const r=e/2,s=e*Hl,o=r,a=e*Hl+e,l=-o,h=a;return t.moveTo(r+i,s+n),t.lineTo(o+i,a+n),t.lineTo(l+i,h+n),t.lineTo(zl*r-Gl*s+i,Gl*r+zl*s+n),t.lineTo(zl*o-Gl*a+i,Gl*o+zl*a+n),t.lineTo(zl*l-Gl*h+i,Gl*l+zl*h+n),t.lineTo(zl*r+Gl*s+i,zl*s-Gl*r+n),t.lineTo(zl*o+Gl*a+i,zl*a-Gl*o+n),t.lineTo(zl*l+Gl*h+i,zl*h-Gl*l+n),t.closePath(),!1}var Yl=new class extends bl{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return Vl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Vl(t,e/2+r,i,n)}};var Xl=new class extends bl{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}};var $l=new class extends bl{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}};var ql=new class extends bl{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}};const Kl=Lt(3);function Zl(t,e,i,n){const r=e*Kl;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var Jl=new class extends Bl{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Zl(t,e/2/Kl,i,n)}drawOffset(t,e,i,n,r){return Zl(t,e/2/Kl+r,i,n)}};function Ql(t,e,i,n){const r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var th=new class extends bl{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return Ql(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Ql(t,e/4+r,i,n)}};function eh(t,e,i,n){const r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var ih=new class extends bl{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return eh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return eh(t,e/4+r,i,n)}};function nh(t,e,i,n){const r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var rh=new class extends bl{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return nh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return nh(t,e/4+r,i,n)}};function sh(t,e,i,n){const r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var oh=new class extends bl{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return sh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return sh(t,e/4+r,i,n)}};function ah(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var lh=new class extends bl{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return ah(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return ah(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e}, ${i-r} L ${e},${i+r}`}};function hh(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var ch=new class extends bl{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return hh(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return hh(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} L ${e+r},${i}`}};function uh(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var dh=new class extends bl{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,r){return uh(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return uh(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}};function ph(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function fh(t,e,i,n){const r=e,s=e/2;return t.rect(i-r/2,n-s/2,r,s),!1}var gh=new class extends bl{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return st(e)?fh(t,e,i,n):ph(t,e,i,n)}drawOffset(t,e,i,n,r){return st(e)?fh(t,e+2*r,i,n):ph(t,[e[0]+2*r,e[1]+2*r],i,n)}};const vh=new Vt;class mh{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,nt(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,r,s,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),$e(r.path.commandList,t,i,n,e,e),o&&o(r.path,r.attribute)})),!1):($e(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),$e(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):($e(this.path.commandList,t,i,n,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;vh.x1=n.bounds.x1*t,vh.y1=n.bounds.y1*t,vh.x2=n.bounds.x2*t,vh.y2=n.bounds.y2*t,e.union(vh)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const yh=[wl,Al,Tl,_l,Jl,Rl,Ll,jl,Wl,Fl,Yl,Xl,$l,Pl,ql,th,ih,rh,oh,gh,lh,ch,dh],bh={};yh.forEach((t=>{bh[t.type]=t}));const xh={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},wh=new Vt,Ah=["symbolType","size",...xo];let Sh=class t extends _o{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=ha}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return nt(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=Tr(this).symbol;let{symbolType:i=e.symbolType}=this.attribute,n=bh[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(i=xh[i]||i,!0===jo(i)){const e=new Do,{svg:n}=e.parse(i);if(!n)return null;const r=nt(n.path)?n.path:[n.path];wh.clear();const s=[];r.forEach((t=>{const e=(new Di).fromString(t.d),i={};va.forEach((e=>{t[e]&&(i[ga[e]]=t[e])})),s.push({path:e,attribute:i}),wh.union(e.bounds)}));const o=wh.width(),a=wh.height(),l=1/kt(o,a);return s.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new mh(i,s,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new Di).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/kt(s,o);return r.transform(0,0,a,a),this._parsedPath=new mh(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=Tr(this).symbol;this._AABBBounds.clear();const i=this.attribute,n=pn.graphicService.updateSymbolAABBBounds(i,Tr(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=rs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,Ah)}needUpdateTag(t){return super.needUpdateTag(t,Ah)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=nt(e)?e:[e,e];return t.path?(new Di).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Di).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Th(t){return new Sh(t)}Sh.userSymbolMap={},Sh.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Co);const Ch=["segments","points","curveType","curveTension",...xo];let _h=class t extends _o{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=ia}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=cs(i,n,e))}doUpdateAABBBounds(){const t=Tr(this).line;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateLineAABBBounds(e,Tr(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,Ch)}needUpdateTag(t){return super.needUpdateTag(t,Ch)}toCustomPath(){const t=this.attribute,e=new Di,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Bh(t){return new _h(t)}_h.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Co);const Ph=["width","x1","y1","height","cornerRadius",...xo];class Rh extends _o{constructor(t){super(t),this.type="rect",this.numberType=oa}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}doUpdateAABBBounds(){const t=Tr(this).rect;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateRectAABBBounds(e,Tr(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,Ph)}needUpdateTag(t){return super.needUpdateTag(t,Ph)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:n,height:r}=ks(t),s=new Di;return s.moveTo(e,i),s.rect(e,i,n,r),s}clone(){return new Rh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Rh.NOWORK_ANIMATE_ATTR}}function Mh(t){return new Rh(t)}Rh.NOWORK_ANIMATE_ATTR=Co;const kh=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class Eh extends Rh{constructor(t){super(t),this.type="rect3d",this.numberType=aa}findFace(){const t={polygons:[],vertices:[],edges:[]},e=Tr(this).rect,{x1:i,y1:n,x:r,y:s,length:o=Et(e.width,e.height)}=this.attribute;let{width:a,height:l}=this.attribute;a=null!=a?a:i-r,l=null!=l?l:n-s;for(let e=0;e<kh.length;e++){const i=kh[e];t.vertices.push([i[0]*a,i[1]*l,i[2]*o])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return Eh.NOWORK_ANIMATE_ATTR}}function Oh(t){return new Eh(t)}Eh.NOWORK_ANIMATE_ATTR=Co;class Lh extends _o{constructor(t){super(t),this.type="glyph",this.numberType=Qo,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}doUpdateAABBBounds(){this._AABBBounds.clear();const t=pn.graphicService.updateGlyphAABBBounds(this.attribute,Tr(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;this.stopStateAnimates();const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new Lh(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return Lh.NOWORK_ANIMATE_ATTR}}function Ih(t){return new Lh(t)}Lh.NOWORK_ANIMATE_ATTR=Co;class Dh{constructor(t,e,i,n,r,s,o,a,l,h,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=o,this.lines=[],this.globalAlign=a,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=fn[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}let a=0;"right"===this.globalAlign||"end"===this.globalAlign?a=-r:"center"===this.globalAlign&&(a=-r/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+l)return h;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=i:o+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,a,s+o,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,h=!0),this.lines[i].draw(t,n,a,s+o,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+l)return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(n=!0,h=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],o=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&o-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class jh{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const n=vs(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof n?n>this.fontSize?n:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:o,width:a}=An(t,i);let l=0,h=0,c=0;this.height>s&&(l=(this.height-s)/2,h=Math.ceil(l),c=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=s-l):"bottom"===this.textBaseline?(this.ascent=s-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+h,this.descent=o+c),this.length=t.length,this.width=a||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=An(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,o=this.left+i;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+=this.ellipsisStr,"right"!==r&&"end"!==r||(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=xn(s,("vertical"===a?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+=this.ellipsisStr,"right"===r||"end"===r){const{width:e}=An(this.text.slice(t),this.character);"vertical"===a||(o-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===a&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||vn;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i;let s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const i=e&&e.fill||gn;if(!i)return void(t.globalAlpha=0);const{fillOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.fillStyle=i;let s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===a&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=xn(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=An(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const Uh=["width","height","image",...xo];class Wh extends _o{constructor(t){super(t),this.type="image",this.numberType=ea,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}doUpdateAABBBounds(){const t=Tr(this).image;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateImageAABBBounds(e,Tr(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return cn[t]}needUpdateTags(t){return super.needUpdateTags(t,Uh)}needUpdateTag(t){return super.needUpdateTag(t,Uh)}clone(){return new Wh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Wh.NOWORK_ANIMATE_ATTR}}function Nh(t){return new Wh(t)}Wh.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Co);class Fh extends Wh{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=rs(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(nt(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=rs(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=cn.width,height:e=cn.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,s=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class zh{constructor(t,e,i,n,r,s,o,a){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Fh?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=fn[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof jh){const e=bn.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=a?0:this.width-this.actualWidth,this.calcOffset(e,a)}calcOffset(t,e){const i=this.directionKey,n=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof Fh?(t["_"+i.x]=r,r+=t[i.width]+s,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+s)}))}draw(t,e,i,n,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n.overflow)continue;if(n instanceof Fh)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:o}=An(s,n.character),a=o||0;if(a<=this.blankWidth+t){e&&(n.ellipsis="add");break}if(a<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=a,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}}this.paragraphs.map(((e,r)=>{if(e instanceof Fh)return e.setAttributes({x:i+e._x,y:n+e._y}),void s(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===r,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof Fh)break;const{width:r}=An(t,n.character),s=r||0;if(s<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=s;break}if(s<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=s,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof Fh?t.width:t.getWidthWithEllips(this.direction)})),i}}class Gh{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=fn[this.direction]}store(t){if(t instanceof Fh){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new zh(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof Fh?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}cut(t){const e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,n=xn(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==n){const[e,i]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new jh(i,t.newLine,t.character),new jh(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Hh=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...xo];class Vh extends _o{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=la}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:hn.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:hn.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:hn.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:hn.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:hn.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:hn.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:hn.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:hn.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=Tr(this).richtext;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateRichTextAABBBounds(e,Tr(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return hn[t]}needUpdateTags(t){return super.needUpdateTags(t,Hh)}needUpdateTag(t){return super.needUpdateTag(t,Hh)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:o,lineWidth:a,opacity:l,fillOpacity:h,strokeOpacity:c}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:o,lineWidth:a,opacity:l,fillOpacity:h,strokeOpacity:c},t)}doUpdateFrameCache(t){var e;const{textConfig:i=[],maxWidth:n,maxHeight:r,width:s,height:o,ellipsis:a,wordBreak:l,verticalDirection:h,textAlign:c,textBaseline:u,layoutDirection:d,singleLine:p,disableAutoWrapLine:f}=this.attribute,g=[],v=null!=t?t:i;for(let t=0;t<v.length;t++)if("image"in v[t]){const e=this.combinedStyleToCharacter(v[t]),i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)g.push(i);else{const t=new Fh(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,g.push(t)}}else{const e=this.combinedStyleToCharacter(v[t]);if(st(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i<t.length;i++)g.push(new jh(t[i],0!==i,e))}else e.text&&g.push(new jh(e.text,!1,e))}const m="number"==typeof n&&Number.isFinite(n)&&n>0,y="number"==typeof r&&Number.isFinite(r)&&r>0,b="number"==typeof s&&Number.isFinite(s)&&s>0&&(!m||s<=n),x="number"==typeof o&&Number.isFinite(o)&&o>0&&(!y||o<=r),w=new Dh(0,0,(b?s:m?n:0)||0,(x?o:y?r:0)||0,a,l,h,c,u,d||"horizontal",!b&&m,!x&&y,p||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),A=new Gh(w);if(f){let t=0,e=!1;for(let i=0;i<g.length;i++){const n=g[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&w.lines[w.lines.length-1].paragraphs.push(n)):A.deal(n),w.lines.length!==t&&(t=w.lines.length,A.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,w.lines[w.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,A.lineWidth=0)}}else for(let t=0;t<g.length;t++)A.deal(g[t]);if(A.send(),!("horizontal"===w.layoutDirection?b:x)){const t=w.getActualSizeWidthEllipsis();let e="horizontal"===w.layoutDirection?t.width:t.height;("horizontal"===w.layoutDirection?m:y)&&(e=Math.min(e,"horizontal"===w.layoutDirection?n:r)),w.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=w}clone(){return new Vh(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,i,n,r,s;const o=this.pickIcon(t.global);o&&o===this._currentHoverIcon||(o?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=o,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(o.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):!o&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;const a=e.AABBBounds.clone();a.translate(e._marginArray[3],e._marginArray[0]),a.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i+e._marginArray[3],r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),r}getNoWorkAnimateAttr(){return Vh.NOWORK_ANIMATE_ATTR}}function Yh(t){return new Vh(t)}Vh.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Co);const Xh=["path","customPath",...xo];class $h extends _o{constructor(t){super(t),this.type="path",this.numberType=na}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=Tr(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Di?e.path:(q(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Di?this.cache:t.path)}doUpdateAABBBounds(){const t=Tr(this).path;this.doUpdatePathShape(),this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updatePathAABBBounds(e,Tr(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;it(t.path,!0)?this.cache=(new Di).fromString(t.path):t.customPath&&(this.cache=new Di,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,Xh)}needUpdateTag(t){return super.needUpdateTag(t,Xh)}toCustomPath(){return(new Di).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new $h(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return $h.NOWORK_ANIMATE_ATTR}}function qh(t){return new $h(t)}$h.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Co);const Kh=["segments","points","curveType","curveTension",...xo];class Zh extends _o{constructor(t){super(t),this.type="area",this.numberType=Zo}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=Tr(this).area;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateAreaAABBBounds(e,Tr(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=cs(i,n,e))}getDefaultAttribute(t){return Tr(this).area[t]}needUpdateTags(t){return super.needUpdateTags(t,Kh)}needUpdateTag(t){return super.needUpdateTag(t,Kh)}toCustomPath(){const t=new Di,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new Zh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Zh.NOWORK_ANIMATE_ATTR}}function Jh(t){return new Zh(t)}Zh.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Co);const Qh=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...xo];class tc extends _o{constructor(t){super(t),this.type="arc",this.numberType=qo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=Tr(this).arc,{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:n=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=n,s-=i,0===e||"0%"===e)return 0;const o=Math.abs(r-s),a=t=>Math.min(st(t,!0)?t:o*parseFloat(t)/100,o/2);if(nt(e)){const t=e.map((t=>a(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return a(e)}getParsedAngle(){const t=Tr(this).arc;let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,r=i-e>=0?1:-1,s=i-e;if(e=Yt(e),i=e+s,n&&Pt(s)<Bt-St){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));let{outerRadius:a=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;a+=h,l-=c;const u=Math.abs(a-l)/2,d=u/a;if(u>St&&a>St)return{startAngle:e-r*d*s,endAngle:i+r*d*o,sc:r*d*s,ec:r*d*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=Tr(this).arc,{innerPadding:n=i.innerPadding,outerPadding:r=i.outerPadding,padAngle:s=i.padAngle}=this.attribute;let{outerRadius:o=i.outerRadius,innerRadius:a=i.innerRadius}=this.attribute;o+=r,a-=n;const{padRadius:l=Lt(o*o+a*a)}=this.attribute,h=Pt(e-t);let c=t,u=e,d=t,p=e;const f=s/2;let g=h,v=h;if(f>St&&l>St){const i=e>t?1:-1;let n=jt(Number(l)/a*Ot(f)),r=jt(Number(l)/o*Ot(f));return(g-=2*n)>St?(n*=i,d+=n,p-=n):(g=0,d=p=(t+e)/2),(v-=2*r)>St?(r*=i,c+=r,u-=r):(v=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}doUpdateAABBBounds(t){const e=Tr(this).arc;this._AABBBounds.clear();const i=this.attribute,n=pn.graphicService.updateArcAABBBounds(i,Tr(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=rs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,Qh)}needUpdateTag(t){return super.needUpdateTag(t,Qh)}getDefaultAttribute(t){return Tr(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius-(t.innerPadding||0),r=t.outerRadius-(t.outerPadding||0);const s=Pt(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new Di;if(r<=St)a.moveTo(0,0);else if(s>=Bt-St)a.moveTo(0+r*Mt(e),0+r*Ot(e)),a.arc(0,0,r,e,i,!o),n>St&&(a.moveTo(0+n*Mt(i),0+n*Ot(i)),a.arc(0,0,n,i,e,o));else{const t=r*Mt(e),s=r*Ot(e),l=n*Mt(i),h=n*Ot(i);a.moveTo(0+t,0+s),a.arc(0,0,r,e,i,!o),a.lineTo(0+l,0+h),a.arc(0,0,n,i,e,o),a.closePath()}return a}clone(){return new tc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return tc.NOWORK_ANIMATE_ATTR}}function ec(t){return new tc(t)}tc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Co);class ic extends tc{constructor(t){super(t),this.type="arc3d",this.numberType=Ko}doUpdateAABBBounds(){const t=Tr(this).arc;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateArc3dAABBBounds(e,Tr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return ic.NOWORK_ANIMATE_ATTR}}function nc(t){return new ic(t)}ic.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Co);const rc=["points","cornerRadius",...xo];class sc extends _o{constructor(t){super(t),this.type="polygon",this.numberType=ra}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=Tr(this).polygon;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updatePolygonAABBBounds(e,Tr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=cs(i,n,e))}getDefaultAttribute(t){return Tr(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,rc)}needUpdateTag(t){return super.needUpdateTag(t,rc)}toCustomPath(){const t=this.attribute.points,e=new Di;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new sc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sc.NOWORK_ANIMATE_ATTR}}function oc(t){return new sc(t)}sc.NOWORK_ANIMATE_ATTR=Co;class ac extends sc{constructor(t){super(t),this.type="pyramid3d",this.numberType=sa}doUpdateAABBBounds(){const t=Tr(this).polygon;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updatePyramid3dAABBBounds(e,Tr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),i=t.map((t=>({p:t,d:0})));let n=!1,r=0;for(let t=0;t<e.length-1;t++){for(let s=t+1;s<e.length;s++){if(e[t]===e[s]){n=!0;const e=zt.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=kt(r,e);const o=zt.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=kt(r,o)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(r-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const s={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{s.vertices.push([t.p.x,t.p.y,t.d])})),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return ac.NOWORK_ANIMATE_ATTR}}function lc(t){return new ac(t)}ac.NOWORK_ANIMATE_ATTR=Co;class hc extends ya{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function cc(t){return new hc(t)}class uc{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:o=t.lineWidth}=r;i.expand(n+(s+o)/2)}return i}}class dc extends uc{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:a=t.lineWidth}=r;No(i,n+(s+a)/2,!0,o)}return i}}const pc=Symbol.for("MatrixAllocate"),fc=Symbol.for("Mat4Allocate");function gc(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class vc{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new $t(t,e,i,n,r,s);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=r,o.f=s,o}allocateByObj(t){if(!this.pools.length)return new $t(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class mc{constructor(){this.pools=[]}static identity(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}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return mc.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const yc=new vc,bc=new mc;var xc=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},wc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ac=function(t,e){return function(i,n){e(i,n,t)}};function Sc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=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]=s*r+h*n,t[5]=o*r+c*n,t[6]=a*r+u*n,t[7]=l*r+d*n,t[8]=h*r-s*n,t[9]=c*r-o*n,t[10]=u*r-a*n,t[11]=d*r-l*n,t}function Tc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],l=e[3],h=e[8],c=e[9],u=e[10],d=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]=s*r-h*n,t[1]=o*r-c*n,t[2]=a*r-u*n,t[3]=l*r-d*n,t[8]=s*n+h*r,t[9]=o*n+c*r,t[10]=a*n+u*r,t[11]=l*n+d*r,t}function Cc(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,l,h,c,u,d,p,f,g,v,m;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(o=e[0],a=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],v=e[10],m=e[11],t[0]=o,t[1]=a,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=m,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+u*r+g*s+e[13],t[14]=l*n+d*r+v*s+e[14],t[15]=h*n+p*r+m*s+e[15]),t}function _c(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Bc(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*l+w*d+A*v,t[2]=b*s+x*h+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*l+w*d+A*v,t[6]=b*s+x*h+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*l+w*d+A*v,t[10]=b*s+x*h+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*l+w*d+A*v,t[14]=b*s+x*h+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function Pc(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:o=i.z,dx:a=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:v=e.attribute.anchor,anchor:m}=e.attribute,y=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;y[0]=i.x1+(i.x2-i.x1)*t}else y[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;y[1]=i.x1+(i.x2-i.x1)*t}else y[1]=v[1];y[2]=null!==(n=v[2])&&void 0!==n?n:0}if(function(t){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),Cc(t,t,[r+a,s+l,o+h]),Cc(t,t,[y[0],y[1],y[2]]),Sc(t,t,f),Tc(t,t,p),Cc(t,t,[-y[0],-y[1],y[2]]),function(t,e,i){const n=i[0],r=i[1],s=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),g){const i=bc.allocate(),n=[0,0];if(m){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=v[1]}Cc(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],l=e[3],h=e[4],c=e[5],u=e[6],d=e[7];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]=s*r+h*n,t[1]=o*r+c*n,t[2]=a*r+u*n,t[3]=l*r+d*n,t[4]=h*r-s*n,t[5]=c*r-o*n,t[6]=u*r-a*n,t[7]=d*r-l*n}(i,i,g),Cc(i,i,[-n[0],-n[1],0]),Bc(t,t,i)}}function Rc(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new j(["graphic"]),onSetStage:new j(["graphic","stage"]),onRemove:new j(["graphic"]),onRelease:new j(["graphic"]),onAddIncremental:new j(["graphic","group","stage"]),onClearIncremental:new j(["graphic","group","stage"]),beforeUpdateAABBBounds:new j(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new j(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Vt,this.tempAABBBounds2=new Vt,this._rectBoundsContribitions=[new uc],this._symbolBoundsContribitions=[new dc],this._imageBoundsContribitions=[new uc],this._circleBoundsContribitions=[new uc],this._arcBoundsContribitions=[new uc],this._pathBoundsContribitions=[new uc]}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new Se(t);return $e(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){let{width:e,height:n}=t;const{x1:r,y1:s,x:o,y:a}=t;e=null!=e?e:r-o,n=null!=n?n:s-a,(isFinite(e)||isFinite(n)||isFinite(o)||isFinite(a))&&i.set(0,0,e||0,n||0)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}updateGroupAABBBounds(t,e,i,n){const r=i;i=i.clone();const{width:s,height:o,path:a,clip:l=e.clip,display:h}=t;a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=o&&i.set(0,0,Math.max(0,s),Math.max(0,o)),l||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const c=this.tempAABBBounds1,u=this.tempAABBBounds2;return c.setValue(i.x1,i.y1,i.x2,i.y2),u.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),r.copy(i),r}updateGlyphAABBBounds(t,e,i,n){return this._validCheck(t,e,i,n)?(n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i):i}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=st(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=cl(s,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=st(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=hl(r,e);i.set(n,i.y1,n+e,i.y2)}}updateRichTextAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:l=e.textAlign,textBaseline:h=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:l}=t.getActualSize();let h=r||e||0,c=s||l||0;c="number"==typeof a&&c>a?a:c||0,h="number"==typeof o&&h>o?o:h||0,i.set(0,0,h,c)}let c=0;switch(h){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-i.height()}let u=0;switch(l){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}i.translate(u,c);const d=this.tempAABBBounds1,p=this.tempAABBBounds2;return d.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,i),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;const{text:r=e.text}=n.attribute;Array.isArray(r)?n.updateMultilineAABBBounds(r):n.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:a=e.scaleX,scaleY:l=e.scaleY,shadowBlur:h=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(h){No(s,h/Math.abs(a+l),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,i),Gt(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePathAABBBoundsImprecise(t,e,i,n){if(!n)return i;const r=n.getParsedPathShape();return i.union(r.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)}));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateArc3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;const{outerRadius:s=e.outerRadius,height:o=0}=t,a=s+o;i.setValue(-a,-a,a,a);const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePolygonAABBBoundsImprecise(t,e,i,n){const{points:r=e.points}=t;return r.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points,connectedType:s}=t,o=i;return r.forEach((t=>{!1===t.defined&&"zero"!==s||o.add(t.x,t.y)})),o}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments,connectedType:s}=t,o=i;return r.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"zero"!==s||o.add(t.x,t.y)}))})),o}updateAreaAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}updateCircleAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}updateCircleAABBBoundsImprecise(t,e,i,n){const{radius:r=e.radius}=t;return i.set(-r,-r,r,r),i}updateCircleAABBBoundsAccurate(t,e,i,n){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:o=e.radius}=t;return s-r>Bt-St?i.set(-o,-o,o,o):as(r,s,o,i),i}updateArcAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateArcAABBBoundsImprecise(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:o=e.outerPadding,innerPadding:a=e.innerPadding}=t;return r+=o,s-=a,r<s&&(r=s),i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:o=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(r+=o,s-=a,r<s){const t=r;r=s,s=t}let{endAngle:l=e.endAngle,startAngle:h=e.startAngle}=t;if(h>l){const t=h;h=l,l=t}return r<=St?i.set(0,0,0,0):Math.abs(l-h)>Bt-St?i.set(-r,-r,r,r):(as(h,l,r,i),as(h,l,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(nt(r))i.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,n){if(!n)return i;const{size:r=e.size}=t;return n.getParsedPath().bounds(r,i),i}updateImageAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._imageBoundsContribitions.length&&this._imageBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){if(!e.empty()){const{scaleX:r=i.scaleX,scaleY:s=i.scaleY,stroke:o=i.stroke,shadowBlur:a=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(o&&l){No(u,(l+h)/Math.abs(r+s),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(a){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:o=i.shadowOffsetY}=t;No(u,a/Math.abs(r+s)*2,!1,c+1),u.translate(n,o),e.union(u)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const o=r.transMatrix;r&&r.isContainer&&(s=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),s&&Gt(e,e,o)}_validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(!n.valid)return i.clear(),!1;const{visible:r=e.visible}=t;return!!r||(i.clear(),!1)}},t.DefaultGraphicService=xc([g(),Ac(0,p(da)),wc("design:paramtypes",[Object])],t.DefaultGraphicService);const Mc=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let kc,Ec;function Oc(t){return kc||(kc=Mc.CreateGraphic("text",{})),kc.initAttributes(t),kc.AABBBounds}const Lc={x:0,y:0,z:0,lastModelMatrix:null};class Ic{init(e){e&&(this._renderContribitions=e.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.afterFillStroke)))}beforeRenderStep(t,e,i,n,r,s,o,a,l,h,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d)}))}afterRenderStep(t,e,i,n,r,s,o,a,l,h,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d)}))}valid(t,e,i,n){const{fill:r=e.fill,background:s,stroke:o=e.stroke,opacity:a=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=Oa(a,l,r),p=Ia(a,c),f=ka(r,s),g=Ea(o,h);return!(!t.valid||!u)&&!(!f&&!g)&&!!(d||p||i||n||s)&&{fVisible:d,sVisible:p,doFill:f,doStroke:g}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:r=e.x,y:s=e.y,z:o=e.z,scaleX:a=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;Lc.x=r,Lc.y=s,Lc.z=o,Lc.lastModelMatrix=u;const p=d&&(n||Rc(t)),f=p?t.transMatrix.onlyTranslate()&&!c:1===a&&1===l&&0===h&&!c;if(p){const n=bc.allocate(),r=bc.allocate();Pc(r,t,e),Bc(n,u||n,r),Lc.x=0,Lc.y=0,Lc.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),bc.free(r)}if(f&&!u){const n=t.getOffsetXY(e);Lc.x+=n.x,Lc.y+=n.y,Lc.z=o,i.setTransformForCurrent()}else if(p)Lc.x=0,Lc.y=0,Lc.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);Lc.x+=n.x,Lc.y+=n.y,this.transformWithoutTranslate(i,Lc.x,Lc.y,Lc.z,a,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Lc.x=0,Lc.y=0,Lc.z=0;return Lc}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,o=n.project(0,0,i),a=n.project(r,0,i),l=n.project(r,s,i),h={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),p=-(h.y*(l.x-a.x)-c.y*l.x+u.y*a.x+(c.y-u.y)*o.x)*d,f=(c.y*l.y+h.y*(a.y-l.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(h.x*(l.x-a.x)-c.x*l.x+u.x*a.x+(c.x-u.x)*o.x)*d,v=-(c.x*l.y+h.x*(a.y-l.y)-u.x*a.y+(u.x-c.x)*o.y)*d,m=(h.x*(u.y*a.x-c.y*l.x)+h.y*(c.x*l.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,y=(h.x*(u.y*a.y-c.y*l.y)+h.y*(c.x*l.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;n.setTransform(p,f,g,v,m,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,o){const a=t.project(e,i,n);t.translate(a.x,a.y,!1),t.scale(r,s,!1),t.rotate(o,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,r){const{context:s}=n;if(!s)return;const{renderable:o}=t.attribute;if(!1===o)return;s.highPerformanceSave();const a=this.transform(t,e,s,i),{x:l,y:h,z:c,lastModelMatrix:u}=a;this.z=c,ja(t,s,l,h,0,r)||(this.drawShape(t,s,l,h,n,r),this.z=0,s.modelMatrix!==u&&bc.free(s.modelMatrix),s.modelMatrix=u),s.highPerformanceRestore()}}const Dc=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,a)||r("conic",t.conicGradient,o)}function r(e,n,r){return function(n,s){const o=m(n);if(o){m(t.startCall)||i("Missing (");const n=function(n){const s=r();return s&&(m(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:d(p)}}();return m(t.endCall)||i("Missing )"),n}}(n)}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function o(){return v("angular",t.fromAngleValue,1)}function a(){let i,n,r=l();return r&&(i=[],i.push(r),n=e,m(t.comma)&&(r=l(),r?i.push(r):e=n)),i}function l(){let t=function(){const t=v("shape",/^(circle)/i,0);return t&&(t.style=g()||h()),t}()||function(){const t=v("shape",/^(ellipse)/i,0);return t&&(t.style=f()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function h(){return v("extent-keyword",t.extentKeywords,1)}function c(){if(v("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:f(),y:f()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let n=e();const r=[];if(n)for(r.push(n);m(t.comma);)n=e(),n?r.push(n):i("One extra comma");return r}function p(){const e=v("hex",t.hexColor,1)||v("rgba",t.rgbaColor,1)||v("rgb",t.rgbColor,1)||v("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=f(),e}function f(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||g()}function g(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,i){const n=m(e);if(n)return{type:t,value:n[i]}}function m(t){const i=/^[\n\r\t\s]+/.exec(e);i&&y(i[0].length);const n=t.exec(e);return n&&y(n[0].length),n}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class jc{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(jc.IsGradientStr(t))try{const e=Dc(t)[0];if(e){if("linear"===e.type)return jc.ParseLinear(e);if("radial"===e.type)return jc.ParseRadial(e);if("conic"===e.type)return jc.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=Tt/2,r=parseFloat(e.value)/180*Tt-n;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+Bt,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=Tt/2;let r="angular"===e.type?parseFloat(e.value)/180*Tt:0;for(;r<0;)r+=Bt;for(;r>Bt;)r-=Bt;let s=0,o=0,a=0,l=0;return r<n?(s=0,o=1,a=Math.sin(r),l=Math.cos(r)):r<Tt?(s=0,o=0,a=Math.cos(r-n),l=Math.sin(r-n)):r<Tt+n?(s=1,o=0,a=s-Math.sin(r-Tt),l=Math.cos(r-Tt)):(s=1,a=s-Math.cos(r-n-Tt),l-=Math.sin(r-n-Tt)),{gradient:"linear",x0:s,y0:o,x1:a,y1:l,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Uc(t,e,i){let n=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),h=Math.sign(a)*Math.sqrt(o*o+a*a);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}function Wc(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(nt(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return o=jc.Parse(o),"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l;const h=i.AABBBounds;if(!h)return;let c=h.x2-h.x1,u=h.y2-h.y1,d=h.x1-n,p=h.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,p/=e}const f=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,p+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,p+(null!==(l=e.y1)&&void 0!==l?l:0)*u);return e.stops.forEach((t=>{f.addColorStop(t.offset,t.color)})),f}(t,o,i,n,r):"conical"===o.gradient?s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o;const a=i.AABBBounds;if(!a)return;let l=a.x2-a.x1,h=a.y2-a.y1,c=a.x1-n,u=a.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;l/=t,h/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*l,u+(null!==(o=e.y)&&void 0!==o?o:0)*h,e.startAngle,e.endAngle);return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(l+c,h+u,void 0)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l,h,c;const u=i.AABBBounds;if(!u)return;let d=u.x2-u.x1,p=u.y2-u.y1,f=u.x1-n,g=u.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;f/=t,g/=e,d/=t,p/=e}const v=t.createRadialGradient(f+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*p,Math.max(d,p)*(null!==(a=e.r0)&&void 0!==a?a:0),f+(null!==(l=e.x1)&&void 0!==l?l:.5)*d,g+(null!==(h=e.y1)&&void 0!==h?h:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{v.addColorStop(t.offset,t.color)})),v}(t,o,i,n,r)),s||"orange")}var Nc=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zc=function(t,e){return function(i,n){e(i,n,t)}};class Gc{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){var p;const{background:f,backgroundOpacity:g=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:v=l.opacity,backgroundMode:m=l.backgroundMode,backgroundFit:y=l.backgroundFit}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const r=t.resources.get(f);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Tr(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=g*v,this.doDrawImage(e,r.data,s,m,y),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=g*v,e.fillStyle=f,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n,r){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=i.width(),o=i.height();let a=s,l=o;if(r&&"repeat"!==n&&(e.width||e.height)){const i=e.width,r=e.height;"repeat-x"===n?(a=i*(o/r),l=o):"repeat-y"===n&&(l=r*(s/i),a=s);const h=t.dpr,c=ar.allocate({width:a,height:l,dpr:h}),u=c.getContext("2d");u&&(u.inuse=!0,u.clearMatrix(),u.setTransformForCurrent(!0),u.clearRect(0,0,a,l),u.drawImage(e,0,0,a,l),e=c.nativeCanvas),ar.free(c)}const h=t.dpr,c=t.createPattern(e,n);c.setTransform&&c.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=c,t.translate(i.x1,i.y1),t.fillRect(0,0,s,o),t.translate(-i.x1,-i.y1)}}}const Hc=new Gc;t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,l,h,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=Nc([g(),zc(0,p(E)),zc(0,v(nl)),Fc("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution);class Vc{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,o=n.dpr,a=ar.allocate({width:t,height:t,dpr:o}),l=a.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(s,l);const h=n.createPattern(a.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),ar.free(a),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,Bt),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:f=l.textureColor,textureSize:g=l.textureSize,texturePadding:v=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,f,g,v)}drawTexture(t,e,i,n,r,s,o,a,l){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(a,l,o,i);break;case"diamond":h=this.createDiamondPattern(a,l,o,i);break;case"rect":h=this.createRectPattern(a,l,o,i);break;case"vertical-line":h=this.createVerticalLinePattern(a,l,o,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(a,l,o,i);break;case"bias-lr":h=this.createBiasLRLinePattern(a,l,o,i);break;case"bias-rl":h=this.createBiasRLLinePattern(a,l,o,i);break;case"grid":h=this.createGridPattern(a,l,o,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,r,s),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}}const Yc=new Vc;class Xc{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerPadding:v=l.innerPadding,outerPadding:m=l.outerPadding,startAngle:y=l.startAngle,endAngle:b=l.endAngle,opacity:x=l.opacity,x:w=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY}=t.attribute;let{innerRadius:C=l.innerRadius,outerRadius:_=l.outerRadius}=t.attribute;_+=m,C-=v;const B=!(!d||!d.stroke),P=!(!p||!p.stroke);if(f){const{distance:r=l.outerBorder.distance}=d,s=Uc(e,r,e.dpr),o=r/_;if(t.setAttributes({outerRadius:_+s,innerRadius:C-s,startAngle:y-o,endAngle:b+o}),e.beginPath(),Na(t,e,i,n,_+s,C-s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(B){const r=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,d,(w-i)/S,(A-n)/T,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=p,s=Uc(e,r,e.dpr),o=r/_;if(t.setAttributes({outerRadius:_-s,innerRadius:C+s,startAngle:y+o,endAngle:b-o}),e.beginPath(),Na(t,e,i,n,_-s,C+s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(P){const r=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,p,(w-i)/S,(A-n)/T,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:_,innerRadius:C,startAngle:y,endAngle:b})}}const $c=new Xc,qc=Yc,Kc=Hc;class Zc{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{radius:v=l.radius,startAngle:m=l.startAngle,endAngle:y=l.endAngle,opacity:b=l.opacity,x:x=l.x,y:w=l.y,scaleX:A=l.scaleX,scaleY:S=l.scaleY}=t.attribute,T=!(!d||!d.stroke),C=!(!p||!p.stroke);if(f){const{distance:r=l.outerBorder.distance}=d,s=Uc(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v+s,m,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(T){const r=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/A,(w-n)/S,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=p,s=Uc(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v-s,m,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(C){const r=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(w-n)/S,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}}const Jc=new Zc,Qc=Yc,tu=Hc;class eu extends Gc{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{background:d,backgroundMode:p=l.backgroundMode,backgroundFit:f=l.backgroundFit}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p,f),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}}const iu=new eu,nu=Tt/2;function ru(t,e,i,n,r,s,o){let a;if(n<0&&(e+=n,n=-n),r<0&&(i+=r,r=-r),st(s,!0))a=[s=Pt(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,i;switch(t.length){case 0:a=[0,0,0,0];break;case 1:e=Pt(t[0]),a=[e,e,e,e];break;case 2:case 3:e=Pt(t[0]),i=Pt(t[1]),a=[e,i,e,i];break;default:a=t,a[0]=Pt(a[0]),a[1]=Pt(a[1]),a[2]=Pt(a[2]),a[3]=Pt(a[3])}}else a=[0,0,0,0];if(n<0||a[0]+a[1]+a[2]+a[3]<1e-12)return t.rect(e,i,n,r);const[l,h,c,u]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],d=Math.min(n/2,r/2),p=[Math.min(d,a[0]),Math.min(d,a[1]),Math.min(d,a[2]),Math.min(d,a[3])],f=[l[0]+p[0],l[1]],g=[l[0],l[1]+p[0]],v=[h[0]-p[1],h[1]],m=[h[0],h[1]+p[1]],y=[c[0]-p[2],c[1]],b=[c[0],c[1]-p[2]],x=[u[0]+p[3],u[1]],w=[u[0],u[1]-p[3]];if(t.moveTo(f[0],f[1]),o&&o[0]?o[0](f[0],f[1],v[0],v[1]):t.lineTo(v[0],v[1]),!ft(v,m)){o&&o[0]&&t.moveTo(v[0],v[1]);const e=v[0],i=v[1]+p[1];t.arc(e,i,p[1],-nu,0,!1)}if(o&&o[1]?o[1](m[0],m[1],b[0],b[1]):t.lineTo(b[0],b[1]),!ft(y,b)){const e=b[0]-p[2],i=b[1];o&&o[1]&&t.moveTo(b[0],b[1]),t.arc(e,i,p[2],0,nu,!1)}if(o&&o[2]?o[2](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!ft(x,w)){const e=x[0],i=x[1]-p[3];o&&o[2]&&t.moveTo(x[0],x[1]),t.arc(e,i,p[3],nu,Tt,!1)}if(o&&o[3]?o[3](w[0],w[1],g[0],g[1]):t.lineTo(g[0],g[1]),!ft(f,g)){const e=f[0],i=f[1]+p[0];o&&o[3]&&t.moveTo(g[0],g[1]),t.arc(e,i,p[0],Tt,Tt+nu,!1)}return!o&&t.closePath(),t}var su=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};class ou{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{cornerRadius:v=l.cornerRadius,opacity:m=l.opacity,x:y=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:w=l.scaleY,x1:A,y1:S}=t.attribute;let{width:T,height:C}=t.attribute;T=(null!=T?T:A-i)||0,C=(null!=C?C:S-n)||0;const _=!(!d||!d.stroke),B=!(!p||!p.stroke);if(f){const{distance:r=l.outerBorder.distance}=d,s=Uc(e,r,e.dpr),o=i-s,a=n-s,h=2*s;if(0===v||nt(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,T+h,C+h)):(e.beginPath(),ru(e,o,a,T+h,C+h,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(_){const r=l.outerBorder.opacity;l.outerBorder.opacity=m,e.setStrokeStyle(t,d,(y-i)/x,(b-n)/w,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=p,s=Uc(e,r,e.dpr),o=i+s,a=n+s,h=2*s;if(0===v||nt(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,T-h,C-h)):(e.beginPath(),ru(e,o,a,T-h,C-h,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(B){const r=l.innerBorder.opacity;l.innerBorder.opacity=m,e.setStrokeStyle(t,p,(y-i)/x,(b-n)/w,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}}t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=su([g()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{x1:d,y1:p,x:f=l.x,y:g=l.y,stroke:v=l.stroke,cornerRadius:m=l.cornerRadius}=t.attribute;let{width:y,height:b}=t.attribute;if(y=(null!=y?y:d-f)||0,b=(null!=b?b:p-g)||0,Array.isArray(v)&&v.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,l),!(0===m||nt(m)&&m.every((t=>0===t)))){let r,s=0;return ru(e,i,n,y,b,m,new Array(4).fill(0).map(((o,a)=>(o,h,c,u)=>{v[a]&&(s===a-1&&v[a]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:v[a]}),i,n,l),e.beginPath(),e.moveTo(o,h),r=v[a]),s=a,e.lineTo(c,u),e.stroke(),3===a&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,n),v[0]?e.lineTo(i+y,n):e.moveTo(i+y,n),v[1]?e.lineTo(i+y,n+b):e.moveTo(i+y,n+b),v[2]?e.lineTo(i,n+b):e.moveTo(i,n+b),v[3]){const t=v[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=su([g()],t.SplitRectAfterRenderContribution);const au=new ou,lu=Yc,hu=Hc;class cu extends Gc{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{background:d,backgroundMode:p=l.backgroundMode,backgroundFit:f=l.backgroundFit}=t.attribute;if(d)if(t.backgroundImg){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Tr(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p,f),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(Z(d)){const{stroke:i,fill:n,lineWidth:r=1,cornerRadius:s=0,expandX:o=0,expandY:a=0}=d;if(!i&&!n)return;e.beginPath();const{x:l,y:h,width:c,height:u}=function(t){const e=rs(t.attribute.boundsPadding),i=t.AABBBounds;let n=i.x1,r=i.y1,s=i.width(),o=i.height();return st(e)?(n+=e,r+=e,s-=2*e,o-=2*e):(n+=e[3],r+=e[0],s-=e[1]+e[3],o-=e[0]+e[2]),{x:n,y:r,width:s,height:o}}(t);s?ru(e,l-o,h-a,c+2*o,u+2*a,s):e.rect(l-o,h-a,c+2*o,u+2*a),e.globalAlpha=1,n&&(e.fillStyle=n,e.fill()),i&&r>0&&(e.lineWidth=r,e.strokeStyle=i,e.stroke())}else{e.beginPath();const r=t.AABBBounds;e.rect(i,n,r.width(),r.height()),e.fillStyle=d,e.globalAlpha=1,e.fill()}}}class uu extends ou{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){return super.drawShape(t,e,i,n,r,s,o,a,l,h,c,u)}}const du=new uu,pu=new cu;class fu{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,v=f&&!1!==f.visible;if(!g&&!v)return;const{size:m=l.size,opacity:y=l.opacity,x:b=l.x,y:x=l.y,scaleX:w=l.scaleX,scaleY:A=l.scaleY}=t.attribute,S=!(!p||!p.stroke),T=!(!f||!f.stroke);if(g){const{distance:r=l.outerBorder.distance}=p,s=Uc(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,m,i,n,s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.outerBorder);else if(S){const r=l.outerBorder.opacity;l.outerBorder.opacity=y,e.setStrokeStyle(t,p,(b-i)/w,(x-n)/A,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(v){const{distance:r=l.innerBorder.distance}=f,s=Uc(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,m,i,n,-s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,f,l.innerBorder);else if(T){const r=l.innerBorder.opacity;l.innerBorder.opacity=y,e.setStrokeStyle(t,f,(b-i)/w,(x-n)/A,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}}const gu=new fu,vu=Yc,mu=Hc;class yu extends Vc{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){var p,f,g,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:m=t.attribute}=d||{},{texture:y=(null!==(p=t.attribute.texture)&&void 0!==p?p:ps(l,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:ps(l,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:ps(l,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:ps(l,"texturePadding"))}=m;y&&this.drawTexture(y,t,e,i,n,l,b,x,w)}}var bu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wu=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasArcRender=class extends Ic{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=qo,this.builtinContributions=[$c,Kc,qc],this.init(t)}drawArcTailCapPath(t,e,i,n,r,s,o,a){const l=a-o,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=a;const d=Pt(u-c),p=u>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),v=nt(g),{outerDeltaAngle:m,innerDeltaAngle:y,outerStartAngle:b,outerEndAngle:x,innerEndAngle:w,innerStartAngle:A}=t.getParsePadAngle(c,u),S=v?g[0]:g,T=v?g[1]:g,C=v?g[2]:g,_=v?g[3]:g,B=Math.max(T,S),P=Math.max(C,_);let R=B,M=P;const k=r*Mt(b),E=r*Ot(b),O=s*Mt(w),L=s*Ot(w);let I,D,j,U;if((P>St||B>St)&&(I=r*Mt(x),D=r*Ot(x),j=s*Mt(A),U=s*Ot(A),d<Tt)){const t=Ua(k,E,j,U,I,D,O,L);if(t){const e=k-t[0],i=E-t[1],n=I-t[0],o=D-t[1],a=1/Ot(Dt((e*n+i*o)/(Lt(e*e+i*i)*Lt(n*n+o*o)))/2),l=Lt(t[0]*t[0]+t[1]*t[1]);M=Et(P,(s-l)/(a-1)),R=Et(B,(r-l)/(a+1))}}if(R>St){const t=Et(S,R),s=Et(T,R),o=Wa(j,U,k,E,r,t,Number(p)),a=Wa(I,D,O,L,r,s,Number(p));if(R<B&&t===s)e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,R,Rt(o.y01,o.x01),Rt(a.y01,a.x01),!p);else{const t=u-l-.03,o=Rt(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,Rt(a.y11,a.x11),Rt(a.y01,a.x01),!p)}}else e.moveTo(i+k,n+E);if(!(s>St)||y<.001)e.lineTo(i+O,n+L),f=!0;else if(M>St){const t=Et(_,M),r=Et(C,M),o=Wa(O,L,I,D,s,-r,Number(p)),a=Wa(k,E,j,U,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),M<P&&t===r){const t=Rt(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,M,Rt(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,Rt(o.y01,o.x01),Rt(o.y11,o.x11),!p);const t=Rt(o.cy+o.y11,o.cx+o.x11),a=u-l-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*Mt(A),n+s*Ot(A));return f}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t,null==s?void 0:s.theme).arc,{fill:h=l.fill,stroke:c=l.stroke,x:u=l.x,y:d=l.y}=t.attribute,p=this.valid(t,l,o,a);if(!p)return;const{fVisible:f,sVisible:g,doFill:v,doStroke:m}=p,{outerPadding:y=l.outerPadding,innerPadding:b=l.innerPadding,cap:x=l.cap,forceShowCap:w=l.forceShowCap}=t.attribute;let{outerRadius:A=l.outerRadius,innerRadius:S=l.innerRadius}=t.attribute;A+=y,S-=b;let T=0;const C=(X(x)&&x||x[0])&&"conical"===h.gradient;if(C){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();Pt(n-i)<Bt-St&&(T=e||0,h.startAngle-=T,h.endAngle-=T)}let _=!1;const{isFullStroke:B,stroke:P}=is(c);if((v||B)&&(e.beginPath(),Na(t,e,i,n,A,S),_=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,v,m,f,g,l,r,o,a),v&&(o?o(e,t.attribute,l):f&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill())),m&&B&&(a?a(e,t.attribute,l):g&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))),!B&&m&&(e.beginPath(),Na(t,e,i,n,A,S,P),_||this.beforeRenderStep(t,e,i,n,v,m,f,g,l,r,o,a),a?a(e,t.attribute,l):g&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),(X(x)&&x||x[1])&&w){const{startAngle:s,endAngle:h}=t.getParsedAngle();if(Pt(h-s)>=Bt-St){e.beginPath();const s=Math.abs(A-S)/2/A,{endAngle:h=l.endAngle,fill:c=l.fill}=t.attribute,u=h;if(this.drawArcTailCapPath(t,e,i,n,A,S,u,u+s),_||this.beforeRenderStep(t,e,i,n,v,m,f,g,l,r,o,a),v){const r=c;if("conical"===r.gradient){const s=Ha(0,0,h,r);o||Oa&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=s,e.fill())}}m&&(a||g&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke()))}}this.afterRenderStep(t,e,i,n,v,m,f,g,l,r,o,a),C&&(h.startAngle+=T,h.endAngle+=T)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}},t.DefaultCanvasArcRender=bu([g(),wu(0,p(E)),wu(0,v(Ya)),xu("design:paramtypes",[Object])],t.DefaultCanvasArcRender);var Au=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Su=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tu=function(t,e){return function(i,n){e(i,n,t)}};function Cu(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[n]=ti(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,o)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,o)}}function _u(e,i,n,r,s){var o;const{offsetX:a=0,offsetY:l=0,offsetZ:h=0,mode:c="none",drawConnect:u=!1,zeroX:d=0,zeroY:p=0}=s||{};if(u&&"none"===c)return;if(!i)return;let f=!0;const{curves:g}=i;if(n>=1){if(u){let t,i=!0;g.forEach(((n,r)=>{var s;let o=n.p0;if(n.originP1!==n.originP2){if(t&&t.originP1===t.originP2&&(o=t.p0),n.defined)i||(e.lineTo(o.x+a,o.y+l,h),i=!i);else{const{originP1:t,originP2:r}=n;let c;if(t&&!1!==t.defined?c=o:t&&!1!==r.defined&&(c=null!==(s=n.p3)&&void 0!==s?s:n.p1),i){i=!i;const t=c?c.x:n.p0.x,r=c?c.y:n.p0.y;e.moveTo(t+a,r+l,h)}else c&&(i=!i,e.lineTo(c.x+a,c.y+l,h))}t=n}else t=n}))}else g.forEach((t=>{t.defined?(f&&e.moveTo(t.p0.x+a,t.p0.y+l,h),Cu(e,t,1,s),f=!1):f=!0}));return}if(n<=0)return;let v;"x"===r?v=t.Direction.ROW:"y"===r?v=t.Direction.COLUMN:"auto"===r&&(v=i.direction);const m=n*i.tryUpdateLength(v);let y=0,b=!0,x=null;for(let t=0,i=g.length;t<i;t++){const i=g[t],n=i.getLength(v),r=(m-y)/n;if(y+=n,r<0)break;if(u){let t=i.p0;if(i.originP1===i.originP2){x=i;continue}if(x&&x.originP1===x.originP2&&(t=x.p0),i.defined)b||(e.lineTo(t.x+a,t.y+l,h),b=!b);else{const{originP1:n,originP2:r}=i;let s;if(n&&!1!==n.defined?s=t:n&&!1!==r.defined&&(s=null!==(o=i.p3)&&void 0!==o?o:i.p1),b){b=!b;const t=s?s.x:i.p0.x,n=s?s.y:i.p0.y;e.moveTo(t+a,n+l,h)}else s&&(b=!b,e.lineTo(s.x+a,s.y+l,h))}x=i}else{if(!i.defined){f=!0;continue}f&&e.moveTo(i.p0.x+a,i.p0.y+l,h),Cu(e,i,Et(r,1),s),f=!1}}}function Bu(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},o=e?e.points[e.points.length-1]:i.points[0];t.moveTo(o.x+r,o.y+s),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}function Pu(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{var o,a,l,h;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(o=n.x1)&&void 0!==o?o:n.x,null!==(a=n.y1)&&void 0!==a?a:n.y)}t.lineTo(null!==(l=c.x1)&&void 0!==l?l:c.x,null!==(h=c.y1)&&void 0!==h?h:c.y),t.closePath()}))}t.DefaultCanvasCircleRender=class extends Ic{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=Jo,this.builtinContributions=[Jc,tu,Qc],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t,null==s?void 0:s.theme).circle,{radius:h=l.radius,startAngle:c=l.startAngle,endAngle:u=l.endAngle,x:d=l.x,y:p=l.y}=t.attribute,f=this.valid(t,l,o,a);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f;e.beginPath(),e.arc(i,n,h,c,u),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,m,y,g,v,l,r,o,a),m&&(o?o(e,t.attribute,l):g&&(e.setCommonStyle(t,t.attribute,d-i,p-n,l),e.fill())),y&&(a?a(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,m,y,g,v,l,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}},t.DefaultCanvasCircleRender=Au([g(),Tu(0,p(E)),Tu(0,v($a)),Su("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);var Ru=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};function Mu(e,i,n,r){var s;const{drawConnect:o=!1,mode:a="none"}=r||{};if(o&&"none"===a)return;const{top:l,bottom:h}=i;if(l.curves.length!==h.curves.length)return;if(n>=1){const t=[],i=[];let n=!0;if(o){let n,s,o=!0;const a=l.curves.length;l.curves.forEach(((l,c)=>{const u=h.curves[a-c-1];let d=l,p=u;if(l.originP1===l.originP2)return n=l,void(s=u);if(n&&n.originP1===n.originP2&&(d=n,p=s),l.defined)o||(t.push(d),i.push(p),ku(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=l;let a,h;n&&!1!==n.defined?(a=d,h=p):n&&!1!==s.defined&&(a=l,h=u),o?(o=!o,t.push(a||l),i.push(h||u)):a&&(o=!o,t.push(a||l),i.push(h||u),ku(e,t,i,r),t.length=0,i.length=0)}n=l})),ku(e,t,i,r)}else{for(let s=0,o=l.curves.length;s<o;s++){const a=l.curves[s];n!==a.defined?(n?(Eu(e,t,i,r),t.length=0,i.length=0):(t.push(a),i.push(h.curves[o-s-1])),n=!n):n&&(t.push(a),i.push(h.curves[o-s-1]))}Eu(e,t,i,r)}return}if(n<=0)return;let{direction:c}=r||{};const{curves:u}=l,d=null!==(s=u[u.length-1].p3)&&void 0!==s?s:u[u.length-1].p1,p=Pt(d.x-u[0].p0.x),f=Pt(d.y-u[0].p0.y);c=null!=c?c:p>f?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(p)||(c=t.Direction.COLUMN),Number.isFinite(f)||(c=t.Direction.ROW);const g=n*(c===t.Direction.ROW?p:f);let v=0,m=!0;const y=[],b=[];let x,w,A=!0;for(let t=0,i=l.curves.length;t<i;t++){const n=l.curves[t],s=n.getLength(c),a=(g-v)/s;if(a<0)break;if(v+=s,o){const s=h.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){x=n,w=s;continue}if(x&&x.originP1===x.originP2&&(o=x,a=w),n.defined)A||(y.push(o),b.push(a),ku(e,y,b,r),y.length=0,b.length=0,A=!A);else{const{originP1:t,originP2:i}=n;let l,h;t&&!1!==t.defined?(l=o,h=a):t&&!1!==i.defined&&(l=n,h=s),A?(A=!A,y.push(l||n),b.push(h||s)):l&&(A=!A,y.push(l||n),b.push(h||s),ku(e,y,b,r),y.length=0,b.length=0)}x=n}else{let s=null,o=null;m!==n.defined?(m?(Eu(e,y,b,r),y.length=0,b.length=0):(s=n,o=h.curves[i-t-1]),m=!m):m&&(s=n,o=h.curves[i-t-1]),s&&o&&(a<1&&(s=s.p2&&s.p3?ti(s,a)[0]:ii(s,a)[0],o=o.p2&&o.p3?ti(o,1-a)[1]:ii(o,1-a)[1]),s.defined=m,o.defined=m,y.push(s),b.push(o)),s=null,o=null}}o?ku(e,y,b,r):Eu(e,y,b,r)}function ku(t,e,i,n){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=n||{};let l=e[0];t.moveTo(l.p0.x+r,l.p0.y+s,o),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+r,h.y+s,o),l=i[i.length-1],t.lineTo(l.p0.x+r,l.p0.y+s,o),l=i[0],h=l.p3||l.p1,t.lineTo(h.x+r,h.y+s,o),t.closePath()}function Eu(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=n||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+r,e.p0.y+s,o),Cu(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const l=i[e];l.defined?(a&&t.lineTo(l.p0.x+r,l.p0.y+s,o),Cu(t,l,1,n),a=!1):a=!0}t.closePath()}t.DefaultCanvasLineRender=class extends Ic{constructor(){super(...arguments),this.numberType=ia}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f){var g,v,m,y,b;if(!e)return;t.beginPath();const x=null!==(g=this.z)&&void 0!==g?g:0;_u(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:x}),d.cache&&!nt(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,o,a);const{x:w=0,x:A=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,o,w-c,A-u,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,o,w-c,A-u,a),t.stroke()));let{connectedType:S,connectedX:T,connectedY:C,connectedStyle:_}=o;if(nt(a)?(S=null!==(v=null!=S?S:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,T=null!==(m=null!=T?T:a[0].connectedX)&&void 0!==m?m:a[1].connectedX,C=null!==(y=null!=C?C:a[0].connectedY)&&void 0!==y?y:a[1].connectedY,_=null!==(b=null!=_?_:a[0].connectedStyle)&&void 0!==b?b:a[1].connectedStyle):(S=null!=S?S:a.connectedType,T=null!=T?T:a.connectedX,C=null!=C?C:a.connectedY,_=null!=_?_:a.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),"none"!==S){t.beginPath(),_u(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:x,drawConnect:!0,mode:S,zeroX:T,zeroY:C});const g=[];nt(a)?a.forEach((t=>g.push(t))):g.push(a),g.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,_,w-c,A-u,g),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,_,w-c,A-u,g),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,n,r,s,o,a,l,h,c,u,d){var p;e.beginPath();const f=null!==(p=this.z)&&void 0!==p?p:0,{points:g}=t.attribute,v=g[0];e.moveTo(v.x+o,v.y+a,f);for(let t=1;t<g.length;t++){const i=g[t];e.lineTo(i.x+o,i.y+a,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:m=0,x:y=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):r&&(e.setCommonStyle(t,t.attribute,m-o,y-a,l),e.fill())),!1!==n&&(d?d(e,t.attribute,l):s&&(e.setStrokeStyle(t,t.attribute,m-o,y-a,l),e.stroke()))}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t,null==s?void 0:s.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:f,closePath:g,curveTension:v=l.curveTension}=t.attribute;if(!this.valid(t,l,o,a))return;let{curveType:m=l.curveType}=t.attribute;g&&"linear"===m&&(m="linearClosed");const{clipRange:y=l.clipRange,clipRangeByDimension:b=l.clipRangeByDimension}=t.attribute;if(1===y&&!p&&!f.some((t=>!1===t.defined))&&"linear"===m)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,n,l,r,s,o,a);if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const r=Ii(t.points,m,{startPoint:e,curveTension:v});return n=r,r})).filter((t=>!!t)),"linearClosed"===m){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Ii(n,m,{curveTension:v})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===y){let s=!1;t.cache.forEach(((p,f)=>{s||(s=this.drawSegmentItem(e,p,!!h,!!c,u,d,r[f],[l,t.attribute],y,b,i,n,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=y*s;let f=0,g=!1;t.cache.forEach(((s,v)=>{if(g)return;const m=s.getLength(),y=(p-f)/m;f+=m,y>0&&(g=this.drawSegmentItem(e,s,!!h,!!c,u,d,r[v],[l,t.attribute],Et(y,1),b,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,y,b,i,n,t,o,a)}},t.DefaultCanvasLineRender=Ru([g()],t.DefaultCanvasLineRender);const Ou=new yu,Lu=Hc;var Iu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Du=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ju=function(t,e){return function(i,n){e(i,n,t)}};function Uu(t,e,i){var n,r;switch(e){case"linear":default:return hi(t,i);case"basis":return fi(t,i);case"monotoneX":return Ai(t,i);case"monotoneY":return Ti(t,i);case"step":return _i(t,.5,i);case"stepBefore":return _i(t,0,i);case"stepAfter":return _i(t,1,i);case"catmullRom":return Oi(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Li(t,null!==(r=null==i?void 0:i.curveTension)&&void 0!==r?r:.5,i);case"linearClosed":return Ri(t,i)}}t.DefaultCanvasAreaRender=class extends Ic{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=Zo,this.builtinContributions=[Ou,Lu],this.init(t)}drawLinearAreaHighPerformance(t,e,i,n,r,s,o,a,l,h,c,u,d){var p,f,g,v,m;const{points:y}=t.attribute;if(y.length<2)return;e.beginPath();const b=null!==(p=this.z)&&void 0!==p?p:0,x=y[0];e.moveTo(x.x+o,x.y+a,b);for(let t=1;t<y.length;t++){const i=y[t];e.lineTo(i.x+o,i.y+a,b)}for(let t=y.length-1;t>=0;t--){const i=y[t];e.lineTo((null!==(f=i.x1)&&void 0!==f?f:i.x)+o,(null!==(g=i.y1)&&void 0!==g?g:i.y)+a,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,o,a,!!r,!1,i,!1,l,h,u,null,{attribute:t.attribute});const{x:w=0,x:A=0}=t.attribute;if(!1!==i&&(u?u(e,t.attribute,l):r&&(e.setCommonStyle(t,t.attribute,w-o,A-a,l),e.fill())),this.afterRenderStep(t,e,o,a,!!r,!1,i,!1,l,h,u,null,{attribute:t.attribute}),n){const{stroke:i=l&&l.stroke}=t.attribute;if(nt(i)&&(i[0]||i[2])&&!1===i[1])if(e.beginPath(),i[0]){e.moveTo(x.x+o,x.y+a,b);for(let t=1;t<y.length;t++){const i=y[t];e.lineTo(i.x+o,i.y+a,b)}}else if(i[2]){const t=y[y.length-1];e.moveTo(t.x+o,t.y+a,b);for(let t=y.length-2;t>=0;t--){const i=y[t];e.lineTo((null!==(v=i.x1)&&void 0!==v?v:i.x)+o,(null!==(m=i.y1)&&void 0!==m?m:i.y)+a,b)}}d?d(e,t.attribute,l):(e.setStrokeStyle(t,t.attribute,w-o,A-a,l),e.stroke())}}drawShape(t,e,i,n,r,s,o,a){var l,h,c,u,d,p;const f=Tr(t,null==s?void 0:s.theme).area,{fill:g=f.fill,stroke:v=f.stroke,fillOpacity:m=f.fillOpacity,z:y=f.z,strokeOpacity:b=f.strokeOpacity,curveTension:x=f.curveTension}=t.attribute,w=this.valid(t,f,o,a);if(!w)return;const{doFill:A}=w,S=w.doStroke&&w.sVisible,{clipRange:T=f.clipRange,closePath:C,points:_,segments:B}=t.attribute;let{curveType:P=f.curveType}=t.attribute;if(C&&"linear"===P&&(P="linearClosed"),1===T&&!B&&!_.some((t=>!1===t.defined))&&"linear"===P)return this.drawLinearAreaHighPerformance(t,e,!!g,S,m,b,i,n,f,r,s,o,a);if(t.shouldUpdateShape()){if(B&&B.length){let e,i;const n=B.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===n?e={x:i.endX,y:i.endY}:n>1&&(e.x=i.endX,e.y=i.endY);const r=Uu(t.points,P,{startPoint:e,curveTension:x});return i=r,r})).filter((t=>!!t));let r;const s=[];for(let t=B.length-1;t>=0;t--){const e=B[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=B[t-1].points,n=e[e.length-1];n&&i.push({x:null!==(c=n.x1)&&void 0!==c?c:n.x,y:null!==(u=n.y1)&&void 0!==u?u:n.y})}i.length>1&&(r=Uu(i,"stepBefore"===P?"stepAfter":"stepAfter"===P?"stepBefore":P,{curveTension:x}),s.unshift(r))}t.cacheArea=s.map(((t,e)=>({top:n[e],bottom:t})))}else{if(!_||!_.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=_,i=[];for(let t=_.length-1;t>=0;t--)i.push({x:null!==(d=_[t].x1)&&void 0!==d?d:_[t].x,y:null!==(p=_[t].y1)&&void 0!==p?p:_[t].y});const n=Uu(e,P,{curveTension:x}),r=Uu(i,"stepBefore"===P?"stepAfter":"stepAfter"===P?"stepBefore":P,{curveTension:x});t.cacheArea={top:n,bottom:r}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===T){let l=!1;t.cacheArea.forEach(((h,c)=>{l||(l=this.drawSegmentItem(e,h,A,m,S,b,s[c],[f,t.attribute],T,i,n,y,t,r,o,a))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=T*l;let c=0,u=!1;t.cacheArea.forEach(((l,d)=>{if(u)return;const p=l.top.getLength(),g=(h-c)/p;c+=p,g>0&&(u=this.drawSegmentItem(e,l,A,m,S,b,s[d],[f,t.attribute],Et(g,1),i,n,y,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,A,m,S,b,t.attribute,f,T,i,n,y,t,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f,g){let v=!1;return v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,!1,f,g),v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,!0,f,g),v}_drawSegmentItem(e,i,n,r,s,o,a,l,h,c,u,d,p,f,g,v,m){var y,b,x,w;if(!(i&&i.top&&i.bottom&&i.top.curves&&i.top.curves.length&&i.bottom.curves&&i.bottom.curves.length))return;let{connectedType:A,connectedX:S,connectedY:T,connectedStyle:C}=a;const _=[];if(g&&(nt(l)?(A=null!==(y=null!=A?A:l[0].connectedType)&&void 0!==y?y:l[1].connectedType,S=null!==(b=null!=S?S:l[0].connectedX)&&void 0!==b?b:l[1].connectedX,T=null!==(x=null!=T?T:l[0].connectedY)&&void 0!==x?x:l[1].connectedY,C=null!==(w=null!=C?C:l[0].connectedStyle)&&void 0!==w?w:l[1].connectedStyle):(A=null!=A?A:l.connectedType,S=null!=S?S:l.connectedX,T=null!=T?T:l.connectedY,C=null!=C?C:l.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),nt(l)?l.forEach((t=>_.push(t))):_.push(l),_.push(a)),g&&"none"===A)return!1;e.beginPath();const{points:B,segments:P}=p.attribute;let R,M,k=t.Direction.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],R=t.points[t.points.length-1]}else M=B[0],R=B[B.length-1];const E=Pt(R.x-M.x),O=Pt(R.y-M.y);k=null==R.x1?t.Direction.ROW:null==R.y1?t.Direction.COLUMN:Number.isFinite(E+O)?E>O?t.Direction.ROW:t.Direction.COLUMN:t.Direction.ROW,Mu(e.camera?e:e.nativeContext,i,h,{offsetX:c,offsetY:u,offsetZ:d,direction:k,drawConnect:g,mode:A,zeroX:S,zeroY:T}),this.beforeRenderStep(p,e,c,u,!!r,!1,n,!1,l,f,v,null,{attribute:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(p,a,l);const{x:L=0,x:I=0}=a;if(!1!==n&&(v?v(e,a,l):r&&(e.setCommonStyle(p,g?C:a,L-c,I-u,g?_:l),e.fill())),this.afterRenderStep(p,e,c,u,!!r,!1,n,!1,l,f,v,null,{attribute:a}),!1!==s)if(m)m(e,a,l);else{const{stroke:n=l&&l[1]&&l[1].stroke}=a;nt(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),_u(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,h,k===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d,drawConnect:g,mode:A,zeroX:S,zeroY:T})),e.setStrokeStyle(p,g?C:a,L-c,I-u,g?_:l),e.stroke()}return!1}},t.DefaultCanvasAreaRender=Iu([g(),ju(0,p(E)),ju(0,v(Xa)),Du("design:paramtypes",[Object])],t.DefaultCanvasAreaRender);const Wu=Yc,Nu=Hc;var Fu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},zu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gu=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPathRender=class extends Ic{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=na,this.builtinContributions=[Nu,Wu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){var l,h,c;const u=null!==(l=this.tempTheme)&&void 0!==l?l:Tr(t,null==s?void 0:s.theme).path,{x:d=u.x,y:p=u.y}=t.attribute,f=null!==(h=this.z)&&void 0!==h?h:0,g=this.valid(t,u,o,a);if(!g)return;const{fVisible:v,sVisible:m,doFill:y,doStroke:b}=g;if(e.beginPath(),t.pathShape)$e(t.pathShape.commandList,e,i,n,1,1,f);else{$e((null!==(c=t.attribute.path)&&void 0!==c?c:u.path).commandList,e,i,n,1,1,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,y,b,v,m,u,r,o,a),b&&(a?a(e,t.attribute,u):m&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,u),e.stroke())),y&&(o?o(e,t.attribute,u):v&&(e.setCommonStyle(t,t.attribute,d-i,p-n,u),e.fill())),this.afterRenderStep(t,e,i,n,y,b,v,m,u,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasPathRender=Fu([g(),Gu(0,p(E)),Gu(0,v(Za)),zu("design:paramtypes",[Object])],t.DefaultCanvasPathRender);var Hu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Vu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yu=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasRectRender=class extends Ic{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=oa,this.builtinContributions=[au,hu,lu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){var l;const h=null!==(l=this.tempTheme)&&void 0!==l?l:Tr(t,null==s?void 0:s.theme).rect,{fill:c=h.fill,background:u,stroke:d=h.stroke,cornerRadius:p=h.cornerRadius,opacity:f=h.opacity,fillOpacity:g=h.fillOpacity,lineWidth:v=h.lineWidth,strokeOpacity:m=h.strokeOpacity,visible:y=h.visible,x1:b,y1:x,x:w=h.x,y:A=h.y}=t.attribute;let{width:S,height:T}=t.attribute;S=(null!=S?S:b-w)||0,T=(null!=T?T:x-A)||0;const C=La(f,g,S,T,c),_=Da(f,m,S,T),B=ka(c,u),P=Ea(d,v);if(!t.valid||!y)return;if(!B&&!P)return;if(!(C||_||o||a||u))return;0===p||nt(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(i,n,S,T)):(e.beginPath(),ru(e,i,n,S,T,p));const R={doFill:B,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,B,P,C,_,h,r,o,a,R),R.doFill&&(o?o(e,t.attribute,h):C&&(e.setCommonStyle(t,t.attribute,w-i,A-n,h),e.fill())),R.doStroke&&(a?a(e,t.attribute,h):_&&(e.setStrokeStyle(t,t.attribute,w-i,A-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,B,P,C,_,h,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasRectRender=Hu([g(),Yu(0,p(E)),Yu(0,v(Qa)),Vu("design:paramtypes",[Object])],t.DefaultCanvasRectRender);var Xu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$u=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qu=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasSymbolRender=class extends Ic{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=ha,this.builtinContributions=[gu,mu,vu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){var l;const h=Tr(t,null==s?void 0:s.theme).symbol,{size:c=h.size,x:u=h.x,y:d=h.y,scaleX:p=h.scaleX,scaleY:f=h.scaleY}=t.attribute,g=this.valid(t,h,o,a);if(!g)return;const{fVisible:v,sVisible:m,doFill:y,doStroke:b}=g,x=t.getParsedPath();if(!x)return;const{keepDirIn3d:w=h.keepDirIn3d}=t.attribute,A=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),w&&e.camera&&e.project){const r=e.project(i,n,A),s=e.camera;e.camera=null,!1===x.draw(e,nt(c)?[c[0]*p,c[1]*f]:c*p,r.x,r.y,void 0,((r,s)=>{var l,c,g;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(l=s.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(c=s.fill)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=s.stroke)&&void 0!==g?g:t.attribute.stroke,s=e}s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,u-i,d-n,h),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f,h),e.stroke()))}))&&e.closePath(),e.camera=s}else!1===x.draw(e,c,i,n,A,((r,s)=>{var l,c,g;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(l=s.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(c=s.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=s.stroke)&&void 0!==g?g:t.attribute.stroke,s=e}s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,u-i,d-n,h),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f,h),e.stroke()))}))&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,y,b,v,m,h,r,o,a),y&&!x.isSvg&&(o?o(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill())),b&&!x.isSvg&&(a?a(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(d-n)/f,h),e.stroke())),this.afterRenderStep(t,e,i,n,y,b,v,m,h,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}},t.DefaultCanvasSymbolRender=Xu([g(),qu(0,p(E)),qu(0,v(tl)),$u("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender);const Ku=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Vt)}allocate(t,e,i,n){if(!this.pools.length)return(new Vt).setValue(t,e,i,n);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=n,r}allocateByObj(t){if(!this.pools.length)return new Vt(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Zu=new class extends Gc{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){var d,p,f,g,v,m,y,b,x,w;const{backgroundMode:A=l.backgroundMode,backgroundFit:S=l.backgroundFit}=t.attribute;let T,{background:C}=t.attribute;if(!C)return;const _=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let B;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=Z(C)&&C.background,R=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(d=C.x)&&void 0!==d?d:e.x1)+(null!==(p=C.dx)&&void 0!==p?p:0),n=(null!==(f=C.y)&&void 0!==f?f:e.y1)+(null!==(g=C.dy)&&void 0!==g?g:0),r=null!==(v=C.width)&&void 0!==v?v:e.width(),s=null!==(m=C.height)&&void 0!==m?m:e.height();if(B=Ku.allocate(i,n,i+r,n+s),C=C.background,!R){const t=B.width(),e=B.height();B.set((null!==(y=C.x)&&void 0!==y?y:0)+(null!==(b=C.dx)&&void 0!==b?b:0),(null!==(x=C.y)&&void 0!==x?x:0)+(null!==(w=C.dy)&&void 0!==w?w:0),t,e)}}else B=t.AABBBounds,R||(B=Oc(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(C);if("success"!==r.state||!r.data)return void _();e.highPerformanceSave(),R&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,l),this.doDrawImage(e,r.data,B,A,S),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=C,r?(ru(e,B.x1,B.y1,B.width(),B.height(),r),e.fill()):e.fillRect(B.x1,B.y1,B.width(),B.height()),e.highPerformanceRestore()}P&&Ku.free(B),_()}};var Ju=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Qu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},td=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasTextRender=class extends Ic{constructor(t){super(),this.textRenderContribitions=t,this.numberType=ca,this.builtinContributions=[Zu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){var l,h,c;const u=Tr(t,null==s?void 0:s.theme).text,{text:d,underline:p=u.underline,lineThrough:f=u.lineThrough,keepDirIn3d:g=u.keepDirIn3d,direction:v=u.direction,whiteSpace:m=u.whiteSpace,fontSize:y=u.fontSize,verticalMode:b=u.verticalMode,x:x=u.x,y:w=u.y}=t.attribute;let{textAlign:A=u.textAlign,textBaseline:S=u.textBaseline}=t.attribute;if(!b&&"vertical"===v){const e=A;A=null!==(l=t.getBaselineMapAlign()[S])&&void 0!==l?l:"left",S=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}const T=null!==(c=vs(t.attribute.lineHeight,y))&&void 0!==c?c:y,C=this.valid(t,u,o,a);if(!C)return;const{fVisible:_,sVisible:B,doFill:P,doStroke:R}=C,M=!g,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,P,R,_,B,u,r,o,a),M&&this.transformUseContext2d(t,u,k,e);const E=(r,s,l,h)=>{let c=i+s;const d=n+l;if(h){e.highPerformanceSave(),c+=y;const t=yc.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),yc.free(t)}R&&(a?a(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,x-i,w-n,u),e.strokeText(r,c,d,k))),P&&(o?o(e,t.attribute,u):_&&(e.setCommonStyle(t,t.attribute,x-i,w-n,u),e.fillText(r,c,d,k),this.drawUnderLine(p,f,t,c,d,k,u,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,k),"horizontal"===v){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;R&&(a?a(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,x-i,w-n,u),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+i,(t.topOffset||0)+l+n,k)})))),P&&(o?o(e,t.attribute,u):_&&(e.setCommonStyle(t,t.attribute,x-i,w-n,u),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+i,(r.topOffset||0)+l+n,k),this.drawMultiUnderLine(p,f,t,(r.leftOffset||0)+s+i,(r.topOffset||0)+l+n-ll("bottom",y)-.05*y,k,r.width,u,e)}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:n}=i;e.textAlign="left",e.textBaseline="top";const r=T*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=kt(e,s)}));let o=0,a=0;"bottom"===S?a=-r:"middle"===S&&(a=-r/2),"center"===A?o-=s/2:"right"===A&&(o-=s),n.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),n=s-i;let l=o;"center"===A?l+=n/2:"right"===A&&(l+=n),t.forEach((t=>{const{text:i,width:n,direction:s}=t;E(i,r-(e+1)*T+a,l,s),l+=n}))}))}else if("horizontal"===v){e.setTextStyle(t.attribute,u,k);const i=t.clipedText;let n=0;T!==y&&("top"===S?n=(T-y)/2:"middle"===S||"bottom"===S&&(n=-(T-y)/2)),E(i,0,n,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,u,k);const{verticalList:n}=i;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===S?o=-T:"middle"===S&&(o=-T/2),"center"===A?r-=s/2:"right"===A&&(r-=s),e.textAlign="left",e.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;E(e,o,r,n),r+=i}))}}M&&this.restoreTransformUseContext2d(t,u,k,e),this.afterRenderStep(t,e,i,n,P,R,_,B,u,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,o=!s;this._draw(t,r,o,i,n)}drawUnderLine(t,e,i,n,r,s,o,a){if(e+t<=0)return;const{textAlign:l=o.textAlign,textBaseline:h=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,underlineOffset:p=o.underlineOffset,underlineDash:f=o.underlineDash,fillOpacity:g=o.fillOpacity}=i.attribute,v=i.clipedWidth,m=hl(l,v),y=cl(h,c,c),b={lineWidth:0,stroke:u,opacity:d,strokeOpacity:g};if(t){b.lineWidth=t,a.setStrokeStyle(i,b,n,r,o),f&&a.setLineDash(f),a.beginPath();const e=r+y+c+p;a.moveTo(n+m,e,s),a.lineTo(n+m+v,e,s),a.stroke()}if(e){b.lineWidth=e,a.setStrokeStyle(i,b,n,r,o),a.beginPath();const t=r+y+c/2;a.moveTo(n+m,t,s),a.lineTo(n+m+v,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,l){if(e+t<=0)return;const{fontSize:h=a.fontSize,fill:c=a.fill,opacity:u=a.opacity,underlineOffset:d=a.underlineOffset,underlineDash:p=a.underlineDash,fillOpacity:f=a.fillOpacity}=i.attribute,g=cl("alphabetic",h,h),v={lineWidth:0,stroke:c,opacity:u,strokeOpacity:f};let m=-3;if(t){v.lineWidth=t,l.setStrokeStyle(i,v,n,r,a),p&&l.setLineDash(p),l.beginPath();const e=r+g+h+m+d;l.moveTo(n+0,e,s),l.lineTo(n+0+o,e,s),l.stroke()}if(m=-1,e){v.lineWidth=e,l.setStrokeStyle(i,v,n,r,a),l.beginPath();const t=r+g+h/2+m;l.moveTo(n+0,t,s),l.lineTo(n+0+o,t,s),l.stroke()}}},t.DefaultCanvasTextRender=Ju([g(),td(0,p(E)),td(0,v(el)),Qu("design:paramtypes",[Object])],t.DefaultCanvasTextRender);var ed=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};function id(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function nd(t,e){return Math.sqrt(t*t+e*e)}function rd(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.AbstractGraphicRender=class{},t.AbstractGraphicRender=ed([g()],t.AbstractGraphicRender);const sd=Yc,od=Hc;var ad=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ld=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hd=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPolygonRender=class extends Ic{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=ra,this.builtinContributions=[od,sd],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t,null==s?void 0:s.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath}=t.attribute,f=this.valid(t,l,o,a);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f;e.beginPath(),c<=0||nt(c)&&c.every((t=>0===t))?id(e.camera?e:e.nativeContext,h,i,n):function(t,e,i,n,r){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var o;if(e.length<3)return void id(t,e,i,n);let a=0,l=e.length-1;s||(a+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=a;s<=l;s++){const a=e[0===s?l:(s-1)%e.length],h=e[s%e.length],c=e[(s+1)%e.length],u=h.x-a.x,d=h.y-a.y,p=h.x-c.x,f=h.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,v=Math.abs(Math.tan(g));let m=Array.isArray(r)?null!==(o=r[s%e.length])&&void 0!==o?o:0:r,y=m/v;const b=nd(u,d),x=nd(p,f),w=Math.min(b,x);y>w&&(y=w,m=w*v);const A=rd(h,y,b,u,d),S=rd(h,y,x,p,f),T=2*h.x-A.x-S.x,C=2*h.y-A.y-S.y,_=nd(T,C),B=rd(h,nd(y,m),_,T,C);let P=Math.atan2(A.y-B.y,A.x-B.x);const R=Math.atan2(S.y-B.y,S.x-B.x);let M=R-P;M<0&&(P=R,M=-M),M>Math.PI&&(M-=Math.PI),0===s?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),M&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,m),t.lineTo(S.x+i,S.y+n)}s||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,h,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,m,y,g,v,l,r,o,a),m&&(o?o(e,t.attribute,l):g&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill())),y&&(a?a(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,m,y,g,v,l,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPolygonRender=ad([g(),hd(0,p(E)),hd(0,v(Ja)),ld("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);var cd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ud=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dd=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasGroupRender=class{constructor(t){this.groupRenderContribitions=t,this.numberType=ta}drawShape(e,i,n,r,s,o,a,l){const h=Tr(e,null==o?void 0:o.theme).group,{fill:c=h.fill,background:u,stroke:d=h.stroke,opacity:p=h.opacity,width:f=h.width,height:g=h.height,clip:v=h.clip,fillOpacity:m=h.fillOpacity,strokeOpacity:y=h.strokeOpacity,cornerRadius:b=h.cornerRadius,path:x=h.path,lineWidth:w=h.lineWidth,visible:A=h.visible}=e.attribute,S=La(p,m,f,g,c),T=Da(p,y,f,g),C=ka(c,u),_=Ea(d,w);if(!e.valid||!A)return;if(!v){if(!C&&!_)return;if(!(S||T||a||l||u))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,o)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||nt(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),ru(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(iu));const B={doFill:C,doStroke:_};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,_,S,T,h,s,a,l,B)})),v&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,h),B.doFill&&(a?a(i,e.attribute,h):S&&(i.setCommonStyle(e,e.attribute,n,r,h),i.fill())),B.doStroke&&(l?l(i,e.attribute,h):T&&(i.setStrokeStyle(e,e.attribute,n,r,h),i.stroke())),this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,_,S,T,h,s,a,l)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s,baseOpacity:o=1}=t.attribute;s?r.save():r.highPerformanceSave();const a=r.baseGlobalAlpha;r.baseGlobalAlpha*=o;const l=Tr(t,null==n?void 0:n.theme).group,h=r.modelMatrix;if(r.camera){const e=bc.allocate(),i=bc.allocate();Pc(i,t,l),Bc(e,h||e,i),r.modelMatrix=e,bc.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:c=l.scrollX,scrollY:u=l.scrollY}=t.attribute;let d;(c||u)&&r.translate(c,u),n&&n.drawingCb&&(d=n.drawingCb()),r.modelMatrix!==h&&bc.free(r.modelMatrix),r.modelMatrix=h,r.baseGlobalAlpha=a,d&&d.then?d.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}},t.DefaultCanvasGroupRender=cd([g(),dd(0,p(E)),dd(0,v(qa)),ud("design:paramtypes",[Object])],t.DefaultCanvasGroupRender);var pd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},fd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gd=function(t,e){return function(i,n){e(i,n,t)}};const vd=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class extends Ic{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=ea,this.builtinContributions=[du,pu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t).image,{width:h=l.width,height:c=l.height,repeatX:u=l.repeatX,repeatY:d=l.repeatY,x:p=l.x,y:f=l.y,cornerRadius:g=l.cornerRadius,image:v}=t.attribute,m=this.valid(t,l,o);if(!m)return;const{fVisible:y,sVisible:b,doFill:x,doStroke:w}=m;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,l),this.beforeRenderStep(t,e,i,n,x,!1,y,!1,l,r,o),x)if(o)o(e,t.attribute,l);else if(y){if(!v||!t.resources)return;const r=t.resources.get(v);if("success"!==r.state)return;let s=!1;0===g||nt(g)&&g.every((t=>0===t))||(e.beginPath(),ru(e,i,n,h,c,g),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,i,n,l);let o=0;if("repeat"===u&&(o|=1),"repeat"===d&&(o|=2),o){const t=e.createPattern(r.data,vd[o]);e.fillStyle=t,e.translate(i,n,!0),e.fillRect(0,0,h,c),e.translate(-i,-n,!0)}else e.drawImage(r.data,i,n,h,c);s&&e.restore()}w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,p-i,f-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,x,!1,y,!1,l,r,o)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;const r=t.resources.get(n);if("loading"===r.state&&it(n))return void vo.improveImageLoading(n);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const o=Tr(t).image;this._draw(t,o,!1,i)}},t.DefaultCanvasImageRender=pd([g(),gd(0,p(E)),gd(0,v(Ka)),fd("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const md=Symbol.for("IncrementalDrawContribution"),yd=Symbol.for("ArcRender"),bd=Symbol.for("Arc3dRender"),xd=Symbol.for("AreaRender"),wd=Symbol.for("CircleRender"),Ad=Symbol.for("GraphicRender"),Sd=Symbol.for("GroupRender"),Td=Symbol.for("LineRender"),Cd=Symbol.for("PathRender"),_d=Symbol.for("PolygonRender"),Bd=Symbol.for("RectRender"),Pd=Symbol.for("Rect3DRender"),Rd=Symbol.for("SymbolRender"),Md=Symbol.for("TextRender"),kd=Symbol.for("RichTextRender"),Ed=Symbol.for("Pyramid3dRender"),Od=Symbol.for("GlyphRender"),Ld=Symbol.for("ImageRender"),Id=Symbol.for("RenderSelector"),Dd=Symbol.for("DrawContribution");var jd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ud=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Wd=Symbol.for("DrawItemInterceptor"),Nd=new Vt,Fd=new Vt;class zd{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){Nd.copy(n.dirtyBounds),Fd.copy(n.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e),n.backupDirtyBounds.copy(n.dirtyBounds)}return n.renderGroup(t.shadowRoot,i,yc.allocate(1,0,0,1,0,0)),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&(n.dirtyBounds.copy(Nd),n.backupDirtyBounds.copy(Fd)),!0}}class Gd{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(o.x1,o.y1,o.width(),o.height()),s.highPerformanceRestore(),!0}}t.CommonDrawItemInterceptorContribution=class{constructor(){this.order=1,this.interceptors=[new zd,new Vd,new Hd,new Gd]}afterDrawItem(t,e,i,n,r){for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].afterDrawItem&&this.interceptors[s].afterDrawItem(t,e,i,n,r))return!0;return!1}beforeDrawItem(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].beforeDrawItem&&this.interceptors[s].beforeDrawItem(t,e,i,n,r))return!0;return!1}},t.CommonDrawItemInterceptorContribution=jd([g(),Ud("design:paramtypes",[])],t.CommonDrawItemInterceptorContribution);class Hd{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}beforeSetInteractive(t,e,i,n,r){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(s),!0}if(s){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(s),t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,r){const s=t.baseGraphic;if(!s.stage){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(s){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?n.renderGroup(s,i,s.parent.globalTransMatrix):n.renderItem(s,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Mc.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class Vd{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const l=bc.allocate();_c(l,a);const h=s.modelMatrix;if(h){if(l){const t=bc.allocate();s.modelMatrix=Bc(t,h,l)}}else s.modelMatrix=l;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===Ko,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var i,n,r,s;let o=((null!==(i=t.attribute.startAngle)&&void 0!==i?i:0)+(null!==(n=t.attribute.endAngle)&&void 0!==n?n:0))/2,a=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(s=e.attribute.endAngle)&&void 0!==s?s:0))/2;for(;o<0;)o+=Bt;for(;a<0;)a+=Bt;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)}));const s=t.parent.globalTransMatrix;i.hack_pieFace="outside",n.renderGroup(t,i,s),i.hack_pieFace="inside",n.renderGroup(t,i,s),i.hack_pieFace="top",n.renderGroup(t,i,s),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(r){const e=t.getChildren(),r=e.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));r.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),r.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),r.forEach((e=>{t.add(e.g)})),n.renderGroup(t,i,t.parent.globalTransMatrix,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else n.renderGroup(t,i,t.parent.globalTransMatrix)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==h&&bc.free(s.modelMatrix),s.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Yd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Xd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$d=function(t,e){return function(i,n){e(i,n,t)}};const qd=Symbol.for("RenderService"),Kd=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}},t.DefaultRenderService=Yd([g(),$d(0,p(Dd)),Xd("design:paramtypes",[Object])],t.DefaultRenderService);var Zd=new i((e=>{e(qd).to(t.DefaultRenderService)}));const Jd=Symbol.for("GraphicPicker"),Qd=Symbol.for("PickerService"),tp=Symbol.for("BoundsPicker"),ep=Symbol.for("GlobalPickerService");var ip=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};const np=Symbol.for("PickItemInterceptor");t.ShadowRootPickItemInterceptorContribution=class{constructor(){this.order=1}afterPickItem(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}_pickItem(t,e,i,n,r){var s;if(!t.shadowRoot)return null;const{parentMatrix:o}=r||{};if(!o)return null;const a=e.pickContext;a.highPerformanceSave();const l=null===(s=Tr(t))||void 0===s?void 0:s[t.type],{shadowPickMode:h=(null==l?void 0:l.shadowPickMode)}=t.attribute,c=t.shadowRoot,u=yc.allocateByObj(o),d=new Ft(u.a*i.x+u.c*i.y+u.e,u.b*i.x+u.d*i.y+u.f),p=e.pickGroup(c,d,u,n);return a.highPerformanceRestore(),!p.graphic&&p.group&&"full"===h&&(p.graphic=p.group),p}},t.ShadowRootPickItemInterceptorContribution=ip([g()],t.ShadowRootPickItemInterceptorContribution),t.InteractivePickItemInterceptorContribution=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){const s=t.baseGraphic;if(s&&s.parent){const t=new Ft(i.x,i.y),r=e.pickContext;r.highPerformanceSave();const o=s.parent.globalTransMatrix;o.transformPoint(t,t);const a=s.isContainer?e.pickGroup(s,t.clone(),o,n):e.pickItem(s,t.clone(),o,n);return r.highPerformanceRestore(),a}return null}},t.InteractivePickItemInterceptorContribution=ip([g()],t.InteractivePickItemInterceptorContribution),t.Canvas3DPickItemInterceptor=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,l=!1;if(t.forEachChildren((t=>(a=t.numberType===Ko,!a))),t.forEachChildren((t=>(l=!!t.findFace,!l))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var i,n,r,s;let o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,a=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;o<0;)o+=Bt;for(;a<0;)a+=Bt;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",o=e.pickGroup(t,i,r.parentMatrix,n),o.graphic||(n.hack_pieFace="inside",o=e.pickGroup(t,i,r.parentMatrix,n)),o.graphic||(n.hack_pieFace="top",o=e.pickGroup(t,i,r.parentMatrix,n)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(l){const a=t.getChildren(),l=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));l.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),l.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),l.forEach((e=>{t.add(e.g)})),o=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,n.in3dInterceptor=!1,s.restore(),o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}},t.Canvas3DPickItemInterceptor=ip([g()],t.Canvas3DPickItemInterceptor);var rp=new i(((e,i,n)=>{n(Qd)||(e(ep).toSelf(),e(Qd).toService(ep)),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(np).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(np).toService(t.ShadowRootPickItemInterceptorContribution),e(t.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),e(np).toService(t.InteractivePickItemInterceptorContribution),L(e,np)})),sp=new i((e=>{e(ua).to(t.DefaultGraphicService).inSingletonScope(),e(da).toConstantValue(Mc)}));const op=Symbol.for("AutoEnablePlugins"),ap=Symbol.for("PluginService");var lp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cp=function(t,e){return function(i,n){e(i,n,t)}};let up=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&Bn.isBound(op)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};up=lp([g(),cp(0,p(E)),cp(0,v(op)),hp("design:paramtypes",[Object])],up);var dp=new i((t=>{t(ap).to(up),I(t,op)})),pp=new i((t=>{L(t,U)})),fp=new i((e=>{e(_n).to(t.DefaultTextMeasureContribution).inSingletonScope(),L(e,_n)})),gp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let mp=class{constructor(){this.type="static",this.offscreen=!1,this.global=pn.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Mn({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var n;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};mp=gp([g(),vp("design:paramtypes",[])],mp);var yp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},bp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let xp=class{constructor(){this.offscreen=!1,this.type="virtual",this.global=pn.global}setDpr(t){}init(t,e,i){if(this.layer=t,this.window=e,i.main)throw new Error("virtual layer不能作为main layer");this.main=!1,this.canvas=null,this.context=null}resize(t,e){}resizeView(t,e){}render(t,e,i){this.mainHandler.render(t,e,Object.assign(Object.assign({},i),{clear:!1}))}merge(t){}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return null}release(){}};xp=yp([g(),bp("design:paramtypes",[])],xp);var wp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ap=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Sp=class{constructor(){this.offscreen=!0,this.type="dynamic",this.global=pn.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const n=Mn({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context,viewBox:e.stage.window.getViewBox(),transMatrix:e.stage.window.getViewBoxTransform()},e),{clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"}))}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){const n=t.getContext(),r=t.dpr,{viewBox:s}=i,o=s.x1,a=s.y1,l=s.width(),h=s.height();n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(o,a,l,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,o,a,l,h),n.nativeContext.restore()}merge(t){}};Sp=wp([g(),Ap("design:paramtypes",[])],Sp);var Tp=new i((t=>{t(mp).toSelf(),t(Sp).toSelf(),t(xp).toSelf(),t(Ta).toService(mp),t(Ca).toService(Sp),t(_a).toService(xp)}));var Cp=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};function _p(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s={},o=[];let a=!1;if(r)a=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return a=!0,!0;return!1}),n)}if(a){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],o.push(i))}),n),o.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],l=s[e];r&&l.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<l.length;t++)if(i(l[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}function Bp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Cp(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function Pp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(void 0!==n)return o=!0,!0;return!1}),n);let a=null,l=!1;if(o){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),n),s.sort(((t,e)=>n?e-t:t-e));let o=!1;for(let t=0;t<s.length&&!o;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(l){o=!0,a=n[t];break}n[t]._uid!==e||(l=!0)}}}else t.forEachChildren((t=>l?(a=t,!0):(t._uid===e&&(l=!0),!1)),n);return a}var Rp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Mp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kp=function(t,e){return function(i,n){e(i,n,t)}};let Ep=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Ht,this.backupDirtyBounds=new Ht,this.global=pn.global,this.layerService=pn.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,viewBox:r,transMatrix:s}=e;if(!i)return;const o=this.dirtyBounds.setValue(0,0,r.width(),r.height());if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(a=o,l=n.dirtyBounds,h=!1,null===a?l:null===l?a:(le=a.x1,he=a.x2,ce=a.y1,ue=a.y2,de=l.x1,pe=l.x2,fe=l.y1,ge=l.y2,h&&(le>he&&([le,he]=[he,le]),ce>ue&&([ce,ue]=[ue,ce]),de>pe&&([de,pe]=[pe,de]),fe>ge&&([fe,ge]=[ge,fe])),le>=pe||he<=de||ce>=ge||ue<=fe?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(le,de),y1:Math.max(ce,fe),x2:Math.min(he,pe),y2:Math.min(ue,ge)}));o.x1=Math.floor(t.x1),o.y1=Math.floor(t.y1),o.x2=Math.ceil(t.x2),o.y2=Math.ceil(t.y2)}var a,l,h;const c=i.dpr%1;(c||.5!==c)&&(o.x1=Math.floor(o.x1*i.dpr)/i.dpr,o.y1=Math.floor(o.y1*i.dpr)/i.dpr,o.x2=Math.ceil(o.x2*i.dpr)/i.dpr,o.y2=Math.ceil(o.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(o),i.inuse=!0,i.setClearMatrix(s.a,s.b,s.c,s.d,s.e,s.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(r.x1,r.y1,!0),i.beginPath(),i.rect(o.x1,o.y1,o.width(),o.height()),i.clip(),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:qi.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,yc.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=Pp(e,i,qi.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,n){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!ye(t.AABBBounds,this.dirtyBounds,!1))return;let r,s=i;if(this.useDirtyBounds){r=Ku.allocateByObj(this.dirtyBounds);const e=t.transMatrix;s=yc.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(s.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))})):_p(t,qi.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(r),Ku.free(r),yc.free(s))}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||Bn.get(md);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1})),s.drawContribution=a;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=r.get(l._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(l._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:t.layer,context:i,startAtId:l._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;let r,s=!1;if(t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;if(s=!(!e&&!i),s){r=this.dirtyBounds.clone();const n=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(n),this.dirtyBounds.translate(-e,-i)}}if(this.useDirtyBounds&&!t.isContainer&&!ye(t.AABBBounds,this.dirtyBounds,!1))return void(s&&this.dirtyBounds.copy(r));const o=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=o),o?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),s&&this.dirtyBounds.copy(r),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return yt.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){const n=this.styleRenderMap.get(e.attribute.renderStyle);i=n&&n.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var n,r;const{clear:s,viewBox:o}=i,a=o.width(),l=o.height();if(s){e.clearRect(0,0,a,l);const i=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(i&&(e.globalAlpha=null!==(r=i.attribute.opacity)&&void 0!==r?r:1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(s);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,a,l)}else e.fillStyle=Wc(e,s,{AABBBounds:{x1:0,y1:0,x2:0+a,y2:0+l}},0,0),e.fillRect(0,0,a,l)}}afterDraw(t,e){}};Ep=Rp([g(),kp(0,f(Ad)),kp(1,p(E)),kp(1,v(Wd)),Mp("design:paramtypes",[Array,Object])],Ep);var Op=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Lp=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=ia}drawShape(t,e,i,n,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Tr(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:f=h.strokeOpacity,lineWidth:g=h.lineWidth,visible:v=h.visible}=t.attribute,m=Oa(d,p,c),y=Ia(d,f),b=ka(c),x=Ea(u,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(m||y||o||a))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o,a)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),Bu(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};Lp=Op([g()],Lp);var Ip=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Dp=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=Zo}drawShape(t,e,i,n,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(s>l.length)return;const h=Tr(t).area,{fill:c=h.fill,fillOpacity:u=h.fillOpacity,opacity:d=h.opacity,visible:p=h.visible}=t.attribute,f=Oa(d,u,c),g=ka(c);if(!t.valid||!p)return;if(!g)return;if(!f&&!o)return;for(let r=s;r<s+a;r++)this.drawIncreaseSegment(t,e,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),Pu(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};Dp=Ip([g()],Dp);var jp,Up=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Wp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Np=function(t,e){return function(i,n){e(i,n,t)}},Fp=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(jp||(jp={}));let zp=class extends Ep{constructor(t,e,i,n){super(t,n),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=n,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=jp.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new j([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return Fp(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,viewBox:r}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r.x1,r.y1,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:qi.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return Fp(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return Fp(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Fp(this,void 0,void 0,(function*(){if(2!==t.count)yield Bp(t,qi.zIndex,((i,n)=>{if(this.status===jp.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,yield this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return Fp(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return Fp(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return Fp(this,void 0,void 0,(function*(){this.rendering&&(this.status=jp.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=jp.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return Fp(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Fp(this,void 0,void 0,(function*(){yield Bp(t,qi.zIndex,(t=>Fp(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};zp=Up([g(),Np(0,f(Ad)),Np(1,p(Lp)),Np(2,p(Dp)),Np(3,p(E)),Np(3,v(Wd)),Wp("design:paramtypes",[Array,Object,Object,Object])],zp);var Gp=new i((e=>{e(Gc).toSelf().inSingletonScope(),e(Vc).toSelf().inSingletonScope(),e(Dd).to(Ep),e(md).to(zp),e(Sd).to(t.DefaultCanvasGroupRender).inSingletonScope(),e(Ad).toService(Sd),L(e,qa),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),L(e,nl),L(e,Ad),e(t.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(),e(Wd).toService(t.CommonDrawItemInterceptorContribution),L(e,Wd)}));function Hp(){Hp.__loaded||(Hp.__loaded=!0,Bn.load(Ma),Bn.load(sp),Bn.load(Zd),Bn.load(rp),Bn.load(dp),function(t){t.load(pp),t.load(fp),t.load(Tp)}(Bn),function(t){t.load(Gp)}(Bn))}Hp.__loaded=!1,Hp();const Vp=Bn.get(W);pn.global=Vp;const Yp=Bn.get(Aa);pn.graphicUtil=Yp;const Xp=Bn.get(wa);pn.transformUtil=Xp;const $p=Bn.get(ua);pn.graphicService=$p;const qp=Bn.get(Sa);pn.layerService=qp;class Kp{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,pn.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),pn.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){pn.graphicService.hooks.onAttributeUpdate.taps=pn.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onSetStage.taps=pn.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class Zp{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const o=r/100,a=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+o,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+a,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class Jp{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,pn.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),pn.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){pn.graphicService.hooks.onAddIncremental.taps=pn.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onClearIncremental.taps=pn.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,pn.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class Qp{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onRemove.unTap(this.key),pn.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let n;return n=e?"string"==typeof e?pn.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:pn.global.createDom(Object.assign({tagName:"div",parent:n},i)),nativeContainer:n}}parseDefaultStyleFromGraphic(t){return ul("text"===t.type&&t.attribute?t.attribute:Tr(t).text)}getTransformOfText(t){const e=Tr(t).text,{textAlign:i=e.textAlign,textBaseline:n=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:o,scaleY:a}=r,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${l[i]},${l[n]}) rotate(${s}deg) scaleX(${o}) scaleY(${a})`,transformOrigin:`${h[i]} ${h[n]}`}}updateStyleOfWrapContainer(t,e,i,n,r){const{pointerEvents:s}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none",i.style.position||(i.style.position="absolute",n.style.position="relative");let a=0,l=0;const h=t.globalAABBBounds;let c=r.anchorType;if(q(c)&&(c="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===c&&(c="top-left"),"position"===c||h.empty()){const e=t.globalTransMatrix;a=e.e,l=e.f}else{const t=((t,e)=>{const{x1:i,x2:n,y1:r,y2:s}=t,o=Math.abs(n-i),a=Math.abs(s-r);let l=(i+n)/2,h=(r+s)/2,c=0,u=0;switch(e){case"top":case"inside-top":u=-.5;break;case"bottom":case"inside-bottom":u=.5;break;case"left":case"inside-left":c=-.5;break;case"right":case"inside-right":c=.5;break;case"top-right":c=.5,u=-.5;break;case"top-left":c=-.5,u=-.5;break;case"bottom-right":c=.5,u=.5;break;case"bottom-left":c=-.5,u=.5}return l+=c*o,h+=u*a,{x:l,y:h}})(h,c);a=t.x,l=t.y}const u=pn.global.getElementTopLeft(n,!1),d=e.window.getTopLeft(!1),p=e.viewBox,f=a+d.left-u.left+p.x1,g=l+d.top-u.top+p.y1;if(o.left=`${f}px`,o.top=`${g}px`,"text"===t.type&&"position"===c&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),$(r.style)){const e=r.style({top:g,left:f,width:h.width(),height:h.height()},t,i);e&&(o=Object.assign(Object.assign({},o),e))}else Z(r.style)?o=Object.assign(Object.assign({},o),r.style):it(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const i=e.split(":");if(2===i.length){const e=i[0].trim(),n=i[1].trim();e&&n&&(t[e]=n)}}})),t}(r.style)));pn.global.updateDom(i,{width:r.width,height:r.width,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===pn.global.env&&(t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:qi.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&pn.global.removeDom(e),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const n=t.stage;if(!n)return;const{dom:r,container:s}=i;if(!r)return;const o=q(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[o]&&s&&s!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])"string"==typeof r?this.htmlMap[o].wrapContainer.innerHTML=r:r!==this.htmlMap[o].wrapContainer.firstChild&&(this.htmlMap[o].wrapContainer.removeChild(this.htmlMap[o].wrapContainer.firstChild),this.htmlMap[o].wrapContainer.appendChild(r));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(n,s);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:a,nativeContainer:l}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,n,a,l,i),this.htmlMap[o].renderId=this.renderId}release(){"browser"===pn.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}const tf=new Vt;class ef{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),pn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(tf.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(tf,t.parent&&t.parent.globalTransMatrix)))})),pn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(n.globalAABBBounds))})),pn.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){pn.graphicService.hooks.beforeUpdateAABBBounds.taps=pn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.afterUpdateAABBBounds.taps=pn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onRemove.taps=pn.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const nf=new Vt;class rf{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=e.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new Vt}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pause)return;const i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;const n=Tr(i).group,{display:r=n.display}=i.attribute;if("flex"!==r)return;const{flexDirection:s=n.flexDirection,flexWrap:o=n.flexWrap,alignItems:a=n.alignItems,clip:l=n.clip}=i.attribute,{alignContent:h=(null!=a?a:n.alignContent)}=i.attribute;let{width:c,height:u,justifyContent:d=n.justifyContent}=i.attribute;const p=i.getChildren();if(null==c||null==u){let t=0,e=0,i=0;if(p.forEach((n=>{const r=this.getAABBBounds(n);r.empty()||("column"===s||"column-reverse"===s?(e+=r.height(),t=Math.max(t,r.width())):(t+=r.width(),e=Math.max(e,r.height())),i+=r.x1,i+=r.y1,i+=r.x2,i+=r.y2)})),!isFinite(i))return;c=t,u=e}null==i.attribute.width?i.attribute.width=c:c=i.attribute.width,null==i.attribute.height?i.attribute.height=u:u=i.attribute.height,this.tempBounds.copy(i._AABBBounds);const f={main:{len:c,field:"x"},cross:{len:u,field:"y"}},g=f.main,v=f.cross;"column"!==s&&"column-reverse"!==s||(g.len=u,v.len=c,g.field="y",v.field="x"),"row-reverse"!==s&&"column-reverse"!==s||("flex-start"===d?d="flex-end":"flex-end"===d?d="flex-start":p.reverse());let m=0,y=0;const b=[];p.forEach((t=>{const e=this.getAABBBounds(t);if(e.empty())return;const i="x"===g.field?e.width():e.height(),n="x"===v.field?e.width():e.height();b.push({mainLen:i,crossLen:n}),m+=i,y=Math.max(y,n)}));const x=[];if(m>g.len&&"wrap"===o){let t=0,e=0;b.forEach(((i,n)=>{let{mainLen:r,crossLen:s}=i;t+r>g.len?0===t?(x.push({idx:n,mainLen:t+r,crossLen:s}),t=0,e=0):(x.push({idx:n-1,mainLen:t,crossLen:e}),t=r,e=s):(t+=r,e=Math.max(e,s))})),x.push({idx:b.length-1,mainLen:t,crossLen:e})}else x.push({idx:b.length-1,mainLen:m,crossLen:y});let w=0;if(x.forEach((t=>{this.layoutMain(i,p,d,g,b,w,t),w=t.idx+1})),y=x.reduce(((t,e)=>t+e.crossLen),0),1===x.length){const t={"flex-start":0,"flex-end":v.len,center:v.len/2};this.layoutCross(p,a,v,t,b,x[0],0)}else if("flex-start"===h){w=0;let t=0;x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"flex-start",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("center"===h){w=0;let t=Math.max(0,(v.len-y)/2);x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"center",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){w=0;const t=Math.max(0,(v.len-y)/x.length/2);let e=t;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){w=0;const t=Math.max(0,(v.len-y)/(2*x.length-2));let e=0;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}p.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();const A=this.getAABBBounds(i);l||this.tempBounds.equals(A)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;const e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(null!=e?e:0)-i}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else if("flex-end"===i){let t=n.len;for(let i=o.idx;i>=s;i--){t-=r[i].mainLen;const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`]))}}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/t/2;let a=i;for(let t=s;t<=o.idx;t++){const s=a+(e[t],n.field,0),o=this.getAABBBounds(e[t]);!o.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],o[`${n.field}1`])),a+=r[t].mainLen+2*i}}else if("space-between"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/(2*t-2);let a=0;for(let t=s;t<=o.idx;t++){const s=a+(e[t],n.field,0),o=this.getAABBBounds(e[t]);!o.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],o[`${n.field}1`])),a+=r[t].mainLen+2*i}}else if("center"===i){let t=(n.len-o.mainLen)/2;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}}layoutCross(t,e,i,n,r,s,o){var a;for(let l=o;l<=s.idx;l++){const s=t[l];let{alignSelf:o}=s.attribute;o&&"auto"!==o||(o=e);const h=this.getAABBBounds(s),c=null!==(a=n[o])&&void 0!==a?a:n["flex-start"];"flex-end"===o?!h.empty()&&(s.attribute[i.field]=this.updateChildPos(c-r[l].crossLen+(i.field,0),s.attribute[i.field],h[`${i.field}1`])):"center"===o?!h.empty()&&(s.attribute[i.field]=this.updateChildPos(c-r[l].crossLen/2+(i.field,0),s.attribute[i.field],h[`${i.field}1`])):!h.empty()&&(s.attribute[i.field]=this.updateChildPos(c+(i.field,0),s.attribute[i.field],h[`${i.field}1`]))}}activate(t){this.pluginService=t,pn.graphicService.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===this.pluginService.stage&&this.tryLayout(t,!1)})),pn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&nf.copy(n)})),pn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&(nf.equals(i)||this.tryLayout(t,!1))})),pn.graphicService.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t,!1)}))}deactivate(t){pn.graphicService.hooks.onAttributeUpdate.taps=pn.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.beforeUpdateAABBBounds.taps=pn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.afterUpdateAABBBounds.taps=pn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onSetStage.taps=pn.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const sf=new Gr;sf.addTimeline(Yr),sf.setFPS(60);class of{constructor(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=e,this.color=i,this.colorRgb=Ys.Get(i,t.ColorType.Color1),this.ambient=n;const r=Lt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);this.formatedDir=[e[0]/r,e[1]/r,e[2]/r]}computeColor(e,i){const n=this.formatedDir,r=Et(kt((e[0]*n[0]+e[1]*n[1]+e[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=it(i)?Ys.Get(i,t.ColorType.Color1):i;const o=this.colorRgb;return`rgb(${o[0]*s[0]*r}, ${o[1]*s[1]*r}, ${o[2]*s[2]*r})`}}function af(t,e,i,n){let r,s,o,a,l,h,c,u,d,p;const f=e[0],g=e[1],v=e[2],m=n[0],y=n[1],b=n[2],x=i[0],w=i[1],A=i[2];return Math.abs(f-x)<St&&Math.abs(g-w)<St&&Math.abs(v-A)<St?mc.identity(t):(c=f-x,u=g-w,d=v-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=y*d-b*u,s=b*c-m*d,o=m*u-y*c,p=Math.hypot(r,s,o),p?(p=1/p,r*=p,s*=p,o*=p):(r=0,s=0,o=0),a=u*o-d*s,l=d*r-c*o,h=c*s-u*r,p=Math.hypot(a,l,h),p?(p=1/p,a*=p,l*=p,h*=p):(a=0,l=0,h=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=l,t[6]=u,t[7]=0,t[8]=o,t[9]=h,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+o*v),t[13]=-(a*f+l*g+h*v),t[14]=-(c*f+u*g+d*v),t[15]=1,t)}function lf(t,e,i,n,r,s,o){const a=1/(e-i),l=1/(n-r),h=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(o+s)*h,t[15]=1,t}function hf(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*l+w*d+A*v,t[2]=b*s+x*h+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*l+w*d+A*v,t[6]=b*s+x*h+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*l+w*d+A*v,t[10]=b*s+x*h+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*l+w*d+A*v,t[14]=b*s+x*h+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function cf(t,e,i){const n=e[0],r=e[1],s=e[2];let o=i[3]*n+i[7]*r+i[11]*s+i[15];return o=o||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/o,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/o,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/o,t}class uf{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=bc.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=bc.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return af(this._viewMatrixCached,t,e,i),this._vp||(this._vp=bc.allocate()),this._vp=hf(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=bc.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=bc.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return lf(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=bc.allocate()),this._vp=hf(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return cf(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;cf(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}let df;function pf(){if(null==df)try{const t=document.createElement("canvas"),e=t.getContext("2d");df=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),df&&(df=!!document.createElement)}catch(t){df=!1}}function ff(){pf();const t=pn.global&&pn.global.env;return t?"browser"===t:df}function gf(){pf();const t=pn.global&&pn.global.env;return t?"node"===t:!df}class vf extends Qp{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i,unmount:n}=this.htmlMap[t];e?pn.global.getRequestAnimationFrame()((()=>{e.unmount()})):n&&n(),i&&pn.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const n=t.stage;if(!n)return;const r=n.params.ReactDOM,{element:s,container:o}=i;if(!s||!r||!r.createRoot&&!r.render)return;const a=q(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&o&&o!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])r.createRoot?this.htmlMap[a].root.render(s):r.render(s,this.htmlMap[a].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(n,o);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const i=r.createRoot(t);i.render(s),this.htmlMap[a]={root:i,wrapContainer:t,nativeContainer:e,container:o,renderId:this.renderId}}else r.render(s,t),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:o,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,n,l,h,i),this.htmlMap[a].renderId=this.renderId}}const mf="white";class yf extends ya{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:mf}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new Ar,this.hooks={beforeRender:new j(["stage"]),afterRender:new j(["stage"])},this.global=pn.global,!this.global.env&&ff()&&this.global.setEnv("browser"),this.window=Bn.get(cr),this.renderService=Bn.get(qd),this.pluginService=Bn.get(ap),this.layerService=Bn.get(Sa),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:mf,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||sf,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Vr,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&it(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(){this._skipRender=-1}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new Ur(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:o=1,fieldDepth:a}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:o,fieldDepth:a})}set3dOptions(t){var e,i,n,r,s,o;this.option3d=t;const a=this.get3dOptions(t),{light:l,center:h,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=a,{dir:g=[1,1,-1],color:v="white",ambient:m}=l,y=(null!==(e=h.x)&&void 0!==e?e:this.width/2)+(null!==(i=h.dx)&&void 0!==i?i:0),b=(null!==(n=h.y)&&void 0!==n?n:this.height/2)+(null!==(r=h.dy)&&void 0!==r?r:0),x=[y,b,(null!==(s=h.z)&&void 0!==s?s:0)+(null!==(o=h.dz)&&void 0!==o?o:0)];let w=0,A=0,S=0;c||(w=Math.sin(u)+y,A=Math.sin(d)+b,S=Math.cos(u)*Math.cos(d)*1),this.light=new of(g,v,m);const T={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[w,A,S],center:x,up:[0,1,0]}};this.camera?this.camera.params=T:this.camera=new uf(T),t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new Zp))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new Kp))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Jp))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Ht;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new ef,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new rf))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new Qp))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){this.reactAttribute||(this.reactAttribute=t,this.pluginService.register(new vf))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e<t.length;e++){let n=t[e];"virtual"===n.layerMode&&(n=n.getNativeHandler().mainHandler.layer),i.includes(n)||i.push(n)}i.forEach((t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e))}resizeWindow(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),i&&this.render()}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;this.pickerService||(this.pickerService=Bn.get(Qd));const i=this.pickerService.pick(this.children,new Ft(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(){let t=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const e=Bn.get(cr),i=t?-t.x1:0,n=t?-t.y1:0,r=t?t.x2:this.viewWidth,s=t?t.y2:this.viewHeight,o=t?t.width():this.viewWidth,a=t?t.height():this.viewHeight;return e.create({viewBox:{x1:i,y1:n,x2:r,y2:s},width:o,height:a,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}toCanvas(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}}var bf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const wf=new $t(1,0,0,1,0,0),Af={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new $t(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new $t(1,0,0,1,0,0),this.path=new Di,this._clearMatrix=new $t(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return yc.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(yc.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(yc.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,o,a){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},Af),function(t,e,i){return sr(t,0,!1,e,i)}(this.path.commandList,Af.x,Af.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},Af);const i=Uc(this,this.lineWidth,this.dpr);return function(t,e,i,n){return sr(t,e,!0,i,n)}(this.path.commandList,i,Af.x,Af.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(wf,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>yc.free(t))),this.stack.length=0}},t.EmptyContext2d=bf([g(),xf("design:paramtypes",[Object,Number])],t.EmptyContext2d);var Sf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Tf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Cf={WIDTH:500,HEIGHT:500,DPR:1};t.BaseCanvas=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:n=Cf.WIDTH,height:r=Cf.HEIGHT,dpr:s=Cf.DPR,x:o,y:a,id:l,canvasControled:h=!0}=t;this._x=null!=o?o:0,this._y=null!=a?a:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:l,l&&(i.id=l),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BaseCanvas.env="browser",t.BaseCanvas=Sf([g(),Tf("design:paramtypes",[Object])],t.BaseCanvas);var _f=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};t.BaseEnvContribution=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Vt}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}},t.BaseEnvContribution=_f([g()],t.BaseEnvContribution);var Bf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Pf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.BaseWindowHandlerContribution=class{constructor(){this._uid=e.GenAutoIncrementId(),this.viewBox=new Vt,this.modelMatrix=new $t(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,n,r,s){this.modelMatrix.setValue(t,e,i,n,r,s)}getViewBoxTransform(){return this.modelMatrix}},t.BaseWindowHandlerContribution=Bf([g(),Pf("design:paramtypes",[])],t.BaseWindowHandlerContribution);var Rf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Mf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kf=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultPickService=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=pn.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;const r=i.bounds.width(),s=i.bounds.height();if(!(new Vt).setValue(0,0,r,s).containsPoint(e))return n;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new $t(1,0,0,1,0,0);let a;for(let r=t.length-1;r>=0&&(n=t[r].isContainer?this.pickGroup(t[r],e,o,i):this.pickItem(t[r],e,o,i),!n.graphic);r--)a||(a=n.group);if(n.graphic||(n.group=a),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){var n;return!!(null===(n=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===n?void 0:n.graphic)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=bc.allocate();if(_c(i,e),o){if(i){const t=bc.allocate();s.modelMatrix=Bc(t,o,i),bc.free(i)}}else _c(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const a=this.InterceptorContributions[r];if(a.beforePickItem){const r=a.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==o&&bc.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,l=yc.allocateByObj(i),h=new Ft(e.x,e.y);l.transformPoint(h,h);const c=t.AABBBounds.containsPoint(h);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,h.clone(),i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params);const d=!1!==t.attribute.pickable&&c;return l.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u&&u.graphic||_p(t,qi.zIndex,(s=>{if(s.isContainer){const i=new Ft(e.x,e.y),o=Tr(t).group,{scrollX:a=o.scrollX,scrollY:h=o.scrollY}=t.attribute;i.x-=a,i.y-=h,r=this.pickGroup(s,i,l,n)}else{const o=new Ft(e.x,e.y);l.transformPoint(o,o);const a=Tr(t).group,{scrollX:h=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=h,o.y-=c;const u=this.pickItem(s,o,i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params)}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&bc.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),yc.free(l),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}},t.DefaultPickService=Rf([g(),kf(0,p(E)),kf(0,v(np)),Mf("design:paramtypes",[Object])],t.DefaultPickService);var Ef=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Of=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function Lf(t,e,i,n,r){let s=n,o=e;const a=t[e].x,l=t[e].y,h=t[i].x-a,c=t[i].y-l,u=h*h+c*c;let d,p,f,g,v;for(let n=e+1,r=i-1;n<r;n++)g=t[n].x-a,v=t[n].y-l,d=g*c-h*v,p=d*d,f=p/u,f>s&&(s=f,o=n);s>n&&(o-e>2&&Lf(t,e,o,n,r),r.push(t[o],t[o+1]),i-o>2&&Lf(t,o,i,n,r))}function If(t,e){const i=t.length-1,n=[t[0]];return Lf(t,0,i,e,n),n.push(t[i]),n}function Df(t,e){let i=0;for(i=0;i<t.length;i++){const n=t[i];if(n.text&&"\n"===n.text||e--,e<0)break}return i}t.DefaultGlobalPickerService=class{constructor(){this.global=pn.global,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new $t(1,0,0,1,0,0);let s;for(let o=0;o<t.length;o++){if(t[o].isContainer)n=this.pickGroup(t[o],e,r,i);else{const s=this.pickItem(t[o],e,r,i);s&&(n.graphic=s.graphic,n.params=s.params)}if(n.graphic)break;s||(s=n.group)}if(n.graphic||(n.group=s),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,o=new Ft(e.x,e.y);i.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const l=!1!==t.attribute.pickable&&a;return i.multiply(s.a,s.b,s.c,s.d,s.e,s.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)r=this.pickGroup(t,e,i,n);else{const s=new Ft(e.x,e.y);i.transformPoint(s,s);const o=this.pickItem(t,s,i,n);o&&(r.graphic=o.graphic,r.params=o.params)}return!!r.graphic||!!r.group})),r.graphic||r.group||!l||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=Ef([g(),Of("design:paramtypes",[])],t.DefaultGlobalPickerService);class jf{constructor(t){this.handleKeyDown=t=>{"Delete"!==t.key&&"Backspace"!==t.key||this.handleInput({data:null,type:"Backspace"})},this.handleCompositionStart=()=>{const{textConfig:t=[]}=this.currRt.attribute,e=Df(t,this.cursorIndex),i=t[e];t.splice(e+1,0,Object.assign(Object.assign({},i),{text:""})),this.isComposing=!0},this.handleCompositionEnd=()=>{this.isComposing=!1;const{textConfig:t=[]}=this.currRt.attribute,e=Df(t,this.cursorIndex+1),i=t[e];t.splice(e,1);const n=i.text,r=Array.from(n.toString());for(let n=0;n<r.length;n++)t.splice(n+e,0,Object.assign(Object.assign({},i),{text:r[n]}));this.currRt.setAttributes({textConfig:t}),this.onChangeCbList.forEach((t=>{t(n,this.isComposing,this.cursorIndex+r.length,this.currRt,"right")}))},this.handleInput=t=>{if(!this.currRt)return;let e=t.data;"Backspace"===t.type||e||(e="\n");const{textConfig:i=[]}=this.currRt.attribute;let n=this.selectionStartCursorIdx,r=this.cursorIndex;n>r&&([n,r]=[r,n]),this.selectionStartCursorIdx=n,this.cursorIndex=n,n=Df(i,n);const s=this.selectionStartCursorIdx-n;r=Df(i,r);const o=i[n+(this.isComposing?1:0)];let a=o;"Backspace"!==t.type||this.isComposing?(n!==r&&i.splice(n+1,r-n),this.isComposing||(a=Object.assign(Object.assign({},o),{text:""}),n+=1,i.splice(n,0,a)),a.text=e):n!==r?i.splice(n+1,r-n):(i.splice(n,1),n-=1),this.currRt.setAttributes({textConfig:i}),this.isComposing?this.onInputCbList.forEach((t=>{t(e,this.isComposing,n+s,this.currRt,"\n"===e?"left":"right")})):this.onChangeCbList.forEach((t=>{t(e,this.isComposing,n+s,this.currRt,"\n"===e?"left":"right")}))},this.container=null!=t?t:document.body;const e=document.createElement("textarea");e.autocomplete="off",e.innerText="",this.applyStyle(e),this.container.append(e),this.textAreaDom=e,this.isComposing=!1,this.onInputCbList=[],this.onChangeCbList=[]}onInput(t){this.onInputCbList.push(t)}onChange(t){this.onChangeCbList.push(t)}applyStyle(t){t.setAttribute("style","width: 100px; height: 30px; left: 0; position: absolute; z-index: -1; outline: none; resize: none; border: none; overflow: hidden; color: transparent; user-select: none; caret-color: transparent;background-color: transparent;"),t.addEventListener("input",this.handleInput),t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd),window.addEventListener("keydown",this.handleKeyDown)}moveTo(t,e,i,n,r){this.textAreaDom.style.left=`${t}px`,this.textAreaDom.style.top=`${e}px`,setTimeout((()=>{this.textAreaDom.focus(),this.textAreaDom.setSelectionRange(0,0)})),this.currRt=i,this.cursorIndex=n,this.selectionStartCursorIdx=r}release(){this.textAreaDom.removeEventListener("input",this.handleInput),this.textAreaDom.removeEventListener("compositionstart",this.handleCompositionStart),this.textAreaDom.removeEventListener("compositionend",this.handleCompositionEnd),window.removeEventListener("keydown",this.handleKeyDown)}}class Uf{constructor(t,e,i,n,r){this.curCursorIdx=n,this.selectionStartCursorIdx=i,this.cacheCurCursorIdx=e,this.cacheSelectionStartCursorIdx=t,this.rt=r}hasFormat(t){return null!=this.getFormat(t)}getFormat(t){if(!this.rt)return null;const e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t];if(null==i)return null;for(let n=this.selectionStartCursorIdx+2;n<=this.curCursorIdx;n++)if(i!==e[n][t])return null;return i}getAllFormat(t){if(!this.rt)return[];const e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t],n=new Set;n.add(i);for(let i=this.selectionStartCursorIdx+2;i<=this.curCursorIdx;i++){const r=e[i];n.add(r[t])}return Array.from(n.values())}}const Wf="FORMAT_TEXT_COMMAND";class Nf{constructor(){this.pools=[]}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class Ff extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.rect(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.rect(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const zf=new Ff;class Gf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.arc(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.arc(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Hf=new Gf;class Vf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.area(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.area(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Yf=new Vf;class Xf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.circle(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.circle(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const $f=new Xf;class qf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.line(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.line(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Kf=new qf;class Zf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.path(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.path(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Jf=new Zf;class Qf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.symbol(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.symbol(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const tg=new Qf;class eg extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.text(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.text(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const ig=new eg;class ng{constructor(){this.map={text:ig,symbol:tg}}gc(t){t.isContainer?t.forEachChildren((t=>this.gc(t))):this.gcItem(t)}gcItem(t){const e=this.map[t.type];e&&e.free(t)}}const rg=new ng;let sg=!1;const og=new i((e=>{sg||(sg=!0,e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(yd).to(t.DefaultCanvasArcRender).inSingletonScope(),e(Ad).toService(yd),e(Ya).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Ya))}));let ag=!1;const lg=new i((e=>{ag||(ag=!0,e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(Bd).to(t.DefaultCanvasRectRender).inSingletonScope(),e(Ad).toService(Bd),e(t.SplitRectAfterRenderContribution).toSelf(),e(t.SplitRectBeforeRenderContribution).toSelf(),e(Qa).toService(t.SplitRectAfterRenderContribution),e(Qa).toService(t.SplitRectBeforeRenderContribution),e(Qa).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Qa))}));let hg=!1;const cg=new i((e=>{hg||(hg=!0,e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Lp).toSelf().inSingletonScope(),e(Td).to(t.DefaultCanvasLineRender).inSingletonScope(),e(Ad).toService(Td))}));let ug=!1;const dg=new i((e=>{ug||(ug=!0,e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(xd).to(t.DefaultCanvasAreaRender).inSingletonScope(),e(Ad).toService(xd),e(Xa).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Xa),e(Dp).toSelf().inSingletonScope())}));let pg=!1;const fg=new i((e=>{pg||(pg=!0,e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(Rd).to(t.DefaultCanvasSymbolRender).inSingletonScope(),e(Ad).toService(Rd),e(tl).toService(t.DefaultBaseInteractiveRenderContribution),L(e,tl))}));let gg=!1;const vg=new i((e=>{gg||(gg=!0,e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(wd).to(t.DefaultCanvasCircleRender).inSingletonScope(),e(Ad).toService(wd),e($a).toService(t.DefaultBaseInteractiveRenderContribution),L(e,$a))}));let mg=!1;const yg=new i((e=>{mg||(mg=!0,e(Md).to(t.DefaultCanvasTextRender).inSingletonScope(),e(Ad).toService(Md),e(el).toService(t.DefaultBaseInteractiveRenderContribution),L(e,el))}));let bg=!1;const xg=new i((e=>{bg||(bg=!0,e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(Cd).to(t.DefaultCanvasPathRender).inSingletonScope(),e(Ad).toService(Cd),e(Za).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Za))}));let wg=!1;const Ag=new i((e=>{wg||(wg=!0,e(_d).to(t.DefaultCanvasPolygonRender).inSingletonScope(),e(Ad).toService(_d),e(Ja).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Ja))}));var Sg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Tg=class{constructor(){this.numberType=Qo}drawShape(t,e,i,n,r,s,o,a){r.drawContribution&&t.getSubGraphic().forEach((t=>{const l=r.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,i,n,r,s,o,a)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=Tr(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};Tg=Sg([g()],Tg);let Cg=!1;const _g=new i((t=>{Cg||(Cg=!0,t(Od).to(Tg).inSingletonScope(),t(Ad).toService(Od))}));var Bg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Pg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Rg=class extends Ic{constructor(){super(),this.numberType=la,this.builtinContributions=[Zu],this.init()}drawShape(t,e,i,n,r){const s=Tr(t).richtext,{strokeOpacity:o=s.strokeOpacity,opacity:a=s.opacity,fillOpacity:l=s.fillOpacity,visible:h=s.visible}=t.attribute;if(!t.valid||!h)return;const c=Oa(a,l,!0),u=Oa(a,o,!0);c&&(e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,u,c,u,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,u,c,u,s,r))}drawIcon(t,e,i,n,r){var s;const o=Tr(t).richtextIcon,{width:a=o.width,height:l=o.height,opacity:h=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:p=o.backgroundStroke,backgroundStrokeOpacity:f=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:m=a,backgroundHeight:y=l}=t.attribute;if(v&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(m-a)/2,r=(y-l)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,m,y)):(e.beginPath(),ru(e,i-t,n-r,m,y,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=f,e.strokeStyle=p,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=h,e.drawImage(b.data,i,n,a,l))}draw(t,e,i){const n=Tr(t).richtext;this._draw(t,n,!1,i)}};Rg=Bg([g(),Pg("design:paramtypes",[])],Rg);let Mg=!1;const kg=new i((t=>{Mg||(Mg=!0,t(kd).to(Rg).inSingletonScope(),t(Ad).toService(kd))}));let Eg=!1;const Og=new i((e=>{Eg||(Eg=!0,e(Ld).to(t.DefaultCanvasImageRender).inSingletonScope(),e(Ad).toService(Ld),e(Ka).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Ka))}));var Lg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Ig=class extends Ic{constructor(){super(...arguments),this.type="rect3d",this.numberType=aa}drawShape(t,e,i,n,r,s,o,a){var l;const h=Tr(t,null==s?void 0:s.theme).rect,{fill:c=h.fill,stroke:u=h.stroke,x1:d,y1:p,x:f,y:g,opacity:v=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:b=h.strokeOpacity,visible:x=h.visible}=t.attribute;let{width:w,height:A}=t.attribute;w=(null!=w?w:d-f)||0,A=(null!=A?A:p-g)||0;const S=null!==(l=this.z)&&void 0!==l?l:0,T=La(v,m,w,A,c),C=Da(v,b,w,A),_=ka(c),B=Ea(u,y);if(!t.valid||!x)return;if(!_&&!B)return;if(!(T||C||o||a))return;const{light:P,camera:R}=r.stage||{},M=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,S,M,r,e,P,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,S,M,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a={x:t+o[0],y:e+o[1],z:i+o[2]},l=s[n[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(e,i,n,r,s,o,a,l){const h=Ys.Get(s,t.ColorType.Color255),c=r.vertices,u=c.map((t=>o.view(t[0],t[1],t[2])[2])),d=[];r.polygons.forEach(((t,e)=>{d.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=u[i[0]],s=u[i[1]],o=u[i[2]],a=u[i[3]];t.ave_z=r+s+o+a})),d.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),d.forEach((t=>{const{polygon:r,normal:u}=t.polygon,d=c[r[0]],p=c[r[1]],f=c[r[2]],g=c[r[3]],v={x:e+d[0],y:i+d[1],z:n+d[2]},m={x:e+p[0],y:i+p[1],z:n+p[2]},y={x:e+f[0],y:i+f[1],z:n+f[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]};o.beginPath(),o.moveTo(v.x,v.y,v.z),o.lineTo(m.x,m.y,m.z),o.lineTo(y.x,y.y,y.z),o.lineTo(b.x,b.y,b.z),o.closePath(),l?l(o,null,null):(o.fillStyle=a?a.computeColor(u,h):s,o.fill())}))}draw(t,e,i){const n=Tr(t).rect;this._draw(t,n,!1,i)}};Ig=Lg([g()],Ig);let Dg=!1;const jg=new i((t=>{Dg||(Dg=!0,t(Pd).to(Ig).inSingletonScope(),t(Ad).toService(Pd))}));var Ug=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Wg=class extends Ic{constructor(){super(...arguments),this.numberType=Ko}drawShape(e,i,n,r,s,o,a,l){var h;const c=Tr(e,null==o?void 0:o.theme).arc,{fill:u=c.fill}=e.attribute,d=this.valid(e,c,a,l);if(!d)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:v}=d,m=null!==(h=this.z)&&void 0!==h?h:0,{outerPadding:y=c.outerPadding,innerPadding:b=c.innerPadding,height:x=10}=e.attribute;let{outerRadius:w=c.outerRadius,innerRadius:A=c.innerRadius}=e.attribute;w+=y,A-=b;const S=Ys.Get(u,t.ColorType.Color255),{light:T}=s.stage||{},C=s.hack_pieFace,_={top:m,bottom:m+x},B={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===C||"top"===C?(i.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=Pt(l-a),c=l>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=St)e.moveTo(i,n,r);else if(h>=Bt-St)e.moveTo(i+s*Mt(a),n+s*Ot(a),r),e.arc(i,n,s,a,l,!c,r),o>St&&(e.moveTo(i+o*Mt(l),n+o*Ot(l),r),e.arc(i,n,o,l,a,c,r));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(a,l),m=s*Mt(p),y=s*Ot(p),b=o*Mt(g),x=o*Ot(g);h<.001?u=!0:(e.moveTo(i+m,n+y,r),e.arc(i,n,s,p,f,!c,r)),!(o>St)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,v,c,r))}e.closePath()}(e,i,n,r,_[C],w,A),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,c),g&&(a?a(i,e.attribute,c):p&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=T?T.computeColor(B[C],S):u,i.fill())),v&&(l?l(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke()))):"outside"!==C&&"inside"!==C||("inside"===C&&(i.save(),i.beginPath(),i.arc(n,r,A,0,Bt,!0,_.top),i.clip()),i.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=Pt(h-l),u=h>l;let d=!1;if(o<=St)e.moveTo(i,n,r);else if(c>=Bt-St)e.moveTo(i+o*Mt(l),n+o*Ot(l),r),e.arc(i,n,o,l,h,!u,r),e.lineTo(i+o*Mt(h),n+o*Ot(h),s),e.arc(i,n,o,h,l,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(l,h),f=o*Mt(c),g=o*Ot(c),v=o*Mt(p),m=o*Ot(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!u,r),e.lineTo(i+v,n+m,s),e.arc(i,n,o,p,c,u,s))}e.closePath()}(e,i,n,r,_.top,_.bottom,"outside"===C?w:A,((t,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:l}=e.getParsePadAngle(t,i);return"outside"===C?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:l}})),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,c),g&&(a?a(i,e.attribute,c):p&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=T?T.computeColor(B[C],S):u,i.fill())),v&&(l?l(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())),"inside"===C&&i.restore())}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}};Wg=Ug([g()],Wg);let Ng=!1;const Fg=new i((t=>{Ng||(Ng=!0,t(bd).to(Wg).inSingletonScope(),t(Ad).toService(bd))}));var zg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Gg=class extends Ic{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=sa}drawShape(t,e,i,n,r,s,o,a){var l;const h=Tr(t,null==s?void 0:s.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,o,a))return;const{light:f,camera:g}=r.stage||{},v=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,p,v,d,r,e,f,g,t,h,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,p,v,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a=s[n[1]],l={x:t+o[0],y:e+o[1],z:i+o[2]},h={x:t+a[0],y:e+a[1],z:i+a[2]};r.beginPath(),r.moveTo(l.x,l.y,l.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(e,i,n,r,s,o,a,l,h,c,u,d){const p=Ys.Get(o,t.ColorType.Color255),f=r.vertices,g=f.map((t=>a.view(t[0],t[1],t[2])[2])),v=[];r.polygons.forEach(((t,e)=>{if(!s[e])return;v.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=g[i[0]],o=g[i[1]],a=g[i[2]],l=g[i[3]];t.ave_z=r+o+a+l})),v.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),v.forEach((t=>{const{polygon:r,normal:s}=t.polygon,h=f[r[0]],g=f[r[1]],v=f[r[2]],m=f[r[3]],y={x:e+h[0],y:i+h[1],z:n+h[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]},x={x:e+v[0],y:i+v[1],z:n+v[2]},w={x:e+m[0],y:i+m[1],z:n+m[2]};a.beginPath(),a.moveTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.lineTo(w.x,w.y,w.z),a.closePath(),d?d(a,c.attribute,u):(a.fillStyle=l?l.computeColor(s,p):o,a.fill())}))}draw(t,e,i){const n=Tr(t).polygon;this._draw(t,n,!1,i)}};Gg=zg([g()],Gg);let Hg=!1;const Vg=new i((t=>{Hg||(Hg=!0,t(Ed).to(Gg).inSingletonScope(),t(Ad).toService(Ed))}));function Yg(){Mc.RegisterGraphicCreator("arc",ec)}function Xg(){Mc.RegisterGraphicCreator("arc3d",nc)}function $g(){Mc.RegisterGraphicCreator("area",Jh)}function qg(){Mc.RegisterGraphicCreator("circle",ol)}function Kg(){Mc.RegisterGraphicCreator("glyph",Ih)}function Zg(){Mc.RegisterGraphicCreator("group",ba)}function Jg(){Mc.RegisterGraphicCreator("image",Nh)}function Qg(){Mc.RegisterGraphicCreator("line",Bh)}function tv(){Mc.RegisterGraphicCreator("path",qh)}function ev(){Mc.RegisterGraphicCreator("polygon",oc)}function iv(){Mc.RegisterGraphicCreator("pyramid3d",lc)}function nv(){Mc.RegisterGraphicCreator("rect",Mh)}function rv(){Mc.RegisterGraphicCreator("rect3d",Oh)}function sv(){Mc.RegisterGraphicCreator("richtext",Yh)}function ov(){Mc.RegisterGraphicCreator("symbol",Th)}function av(){Mc.RegisterGraphicCreator("text",gl)}function lv(){Mc.RegisterGraphicCreator("shadowRoot",cc)}function hv(){Mc.RegisterGraphicCreator("wrapText",yl)}function cv(t,e,i){if(t&&t.length){const[n,r]=e,s=Math.PI/180*i,o=Math.cos(s),a=Math.sin(s);t.forEach((t=>{const[e,i]=t;t[0]=(e-n)*o-(i-r)*a+n,t[1]=(e-n)*a+(i-r)*o+r}))}}function uv(t){const e=t[0],i=t[1];return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}function dv(t,e){const i=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);const r=[0,0];if(i)for(const e of t)cv(e,r,i);const s=function(t,e){const i=[];for(const e of t){const t=[...e];t[0].join(",")!==t[t.length-1].join(",")&&t.push([t[0][0],t[0][1]]),t.length>2&&i.push(t)}const n=[];e=Math.max(e,.1);const r=[];for(const t of i)for(let e=0;e<t.length-1;e++){const i=t[e],n=t[e+1];if(i[1]!==n[1]){const t=Math.min(i[1],n[1]);r.push({ymin:t,ymax:Math.max(i[1],n[1]),x:t===i[1]?i[0]:n[0],islope:(n[0]-i[0])/(n[1]-i[1])})}}if(r.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!r.length)return n;let s=[],o=r[0].ymin;for(;s.length||r.length;){if(r.length){let t=-1;for(let e=0;e<r.length&&!(r[e].ymin>o);e++)t=e;r.splice(0,t+1).forEach((t=>{s.push({s:o,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=o))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),s.length>1)for(let t=0;t<s.length;t+=2){const e=t+1;if(e>=s.length)break;const i=s[t].edge,r=s[e].edge;n.push([[Math.round(i.x),o],[Math.round(r.x),o]])}o+=e,s.forEach((t=>{t.edge.x=t.edge.x+e*t.edge.islope}))}return n}(t,n);if(i){for(const e of t)cv(e,r,-i);!function(t,e,i){const n=[];t.forEach((t=>n.push(...t))),cv(n,e,i)}(s,r,-i)}return s}class pv{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const i=dv(t,e);return{type:"fillSketch",ops:this.renderLines(i,e)}}renderLines(t,e){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return i}}class fv extends pv{fillPolygons(t,e){let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);const n=dv(t,Object.assign({},e,{hachureGap:i})),r=Math.PI/180*e.hachureAngle,s=[],o=.5*i*Math.cos(r),a=.5*i*Math.sin(r);for(const[t,e]of n)uv([t,e])&&s.push([[t[0]-o,t[1]+a],[...e]],[[t[0]+o,t[1]-a],[...e]]);return{type:"fillSketch",ops:this.renderLines(s,e)}}}class gv extends pv{fillPolygons(t,e){const i=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),r=this._fillPolygons(t,n);return i.ops=i.ops.concat(r.ops),i}}class vv{constructor(t){this.helper=t}fillPolygons(t,e){const i=dv(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(i,e)}dotsOnLines(t,e){const i=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let r=e.fillWeight;r<0&&(r=e.strokeWidth/2);const s=n/4;for(const o of t){const t=uv(o),a=t/n,l=Math.ceil(a)-1,h=t-l*n,c=(o[0][0]+o[1][0])/2-n/4,u=Math.min(o[0][1],o[1][1]);for(let t=0;t<l;t++){const o=u+h+t*n,a=c-s+2*Math.random()*s,l=o-s+2*Math.random()*s,d=this.helper.ellipse(a,l,r,r,e);i.push(...d.ops)}}return{type:"fillSketch",ops:i}}}class mv{constructor(t){this.helper=t}fillPolygons(t,e){const i=dv(t,e);return{type:"fillSketch",ops:this.dashedLine(i,e)}}dashedLine(t,e){const i=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,r=[];return t.forEach((t=>{const s=uv(t),o=Math.floor(s/(i+n)),a=(s+n-o*(i+n))/2;let l=t[0],h=t[1];l[0]>h[0]&&(l=t[1],h=t[0]);const c=Math.atan((h[1]-l[1])/(h[0]-l[0]));for(let t=0;t<o;t++){const s=t*(i+n),o=s+i,h=[l[0]+s*Math.cos(c)+a*Math.cos(c),l[1]+s*Math.sin(c)+a*Math.sin(c)],u=[l[0]+o*Math.cos(c)+a*Math.cos(c),l[1]+o*Math.sin(c)+a*Math.sin(c)];r.push(...this.helper.doubleLineOps(h[0],h[1],u[0],u[1],e))}})),r}}class yv{constructor(t){this.helper=t}fillPolygons(t,e){const i=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,n=e.zigzagOffset<0?i:e.zigzagOffset,r=dv(t,e=Object.assign({},e,{hachureGap:i+n}));return{type:"fillSketch",ops:this.zigzagLines(r,n,e)}}zigzagLines(t,e,i){const n=[];return t.forEach((t=>{const r=uv(t),s=Math.round(r/(2*e));let o=t[0],a=t[1];o[0]>a[0]&&(o=t[1],a=t[0]);const l=Math.atan((a[1]-o[1])/(a[0]-o[0]));for(let t=0;t<s;t++){const r=2*t*e,s=2*(t+1)*e,a=Math.sqrt(2*Math.pow(e,2)),h=[o[0]+r*Math.cos(l),o[1]+r*Math.sin(l)],c=[o[0]+s*Math.cos(l),o[1]+s*Math.sin(l)],u=[h[0]+a*Math.cos(l+Math.PI/4),h[1]+a*Math.sin(l+Math.PI/4)];n.push(...this.helper.doubleLineOps(h[0],h[1],u[0],u[1],i),...this.helper.doubleLineOps(u[0],u[1],c[0],c[1],i))}})),n}}const bv={};class xv{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const wv={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Av(t,e){return t.type===e}function Sv(t){const e=[],i=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let n="BOD",r=0,s=i[r];for(;!Av(s,2);){let o=0;const a=[];if("BOD"===n){if("M"!==s.text&&"m"!==s.text)return Sv("M0,0"+t);r++,o=wv[s.text],n=s.text}else Av(s,1)?o=wv[n]:(r++,o=wv[s.text],n=s.text);if(!(r+o<i.length))throw new Error("Path data ended short");for(let t=r;t<r+o;t++){const e=i[t];if(!Av(e,1))throw new Error("Param not a number: "+n+","+e.text);a[a.length]=+e.text}if("number"!=typeof wv[n])throw new Error("Bad segment: "+n);{const t={key:n,data:a};e.push(t),r+=o,s=i[r],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function Tv(t){let e=0,i=0,n=0,r=0;const s=[];for(const{key:o,data:a}of t)switch(o){case"M":s.push({key:"M",data:[...a]}),[e,i]=a,[n,r]=a;break;case"m":e+=a[0],i+=a[1],s.push({key:"M",data:[e,i]}),n=e,r=i;break;case"L":s.push({key:"L",data:[...a]}),[e,i]=a;break;case"l":e+=a[0],i+=a[1],s.push({key:"L",data:[e,i]});break;case"C":s.push({key:"C",data:[...a]}),e=a[4],i=a[5];break;case"c":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"C",data:t}),e=t[4],i=t[5];break}case"Q":s.push({key:"Q",data:[...a]}),e=a[2],i=a[3];break;case"q":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"Q",data:t}),e=t[2],i=t[3];break}case"A":s.push({key:"A",data:[...a]}),e=a[5],i=a[6];break;case"a":e+=a[5],i+=a[6],s.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],e,i]});break;case"H":s.push({key:"H",data:[...a]}),e=a[0];break;case"h":e+=a[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...a]}),i=a[0];break;case"v":i+=a[0],s.push({key:"V",data:[i]});break;case"S":s.push({key:"S",data:[...a]}),e=a[2],i=a[3];break;case"s":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"S",data:t}),e=t[2],i=t[3];break}case"T":s.push({key:"T",data:[...a]}),e=a[0],i=a[1];break;case"t":e+=a[0],i+=a[1],s.push({key:"T",data:[e,i]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,i=r}return s}function Cv(t){const e=[];let i="",n=0,r=0,s=0,o=0,a=0,l=0;for(const{key:h,data:c}of t){switch(h){case"M":e.push({key:"M",data:[...c]}),[n,r]=c,[s,o]=c;break;case"C":e.push({key:"C",data:[...c]}),n=c[4],r=c[5],a=c[2],l=c[3];break;case"L":e.push({key:"L",data:[...c]}),[n,r]=c;break;case"H":n=c[0],e.push({key:"L",data:[n,r]});break;case"V":r=c[0],e.push({key:"L",data:[n,r]});break;case"S":{let t=0,s=0;"C"===i||"S"===i?(t=n+(n-a),s=r+(r-l)):(t=n,s=r),e.push({key:"C",data:[t,s,...c]}),a=c[0],l=c[1],n=c[2],r=c[3];break}case"T":{const[t,s]=c;let o=0,h=0;"Q"===i||"T"===i?(o=n+(n-a),h=r+(r-l)):(o=n,h=r);const u=n+2*(o-n)/3,d=r+2*(h-r)/3,p=t+2*(o-t)/3,f=s+2*(h-s)/3;e.push({key:"C",data:[u,d,p,f,t,s]}),a=o,l=h,n=t,r=s;break}case"Q":{const[t,i,s,o]=c,h=n+2*(t-n)/3,u=r+2*(i-r)/3,d=s+2*(t-s)/3,p=o+2*(i-o)/3;e.push({key:"C",data:[h,u,d,p,s,o]}),a=t,l=i,n=s,r=o;break}case"A":{const t=Math.abs(c[0]),i=Math.abs(c[1]),s=c[2],o=c[3],a=c[4],l=c[5],h=c[6];0===t||0===i?(e.push({key:"C",data:[n,r,l,h,l,h]}),n=l,r=h):n===l&&r===h||(Bv(n,r,l,h,t,i,s,o,a).forEach((function(t){e.push({key:"C",data:t})})),n=l,r=h);break}case"Z":e.push({key:"Z",data:[]}),n=s,r=o}i=h}return e}function _v(t,e,i){return[t*Math.cos(i)-e*Math.sin(i),t*Math.sin(i)+e*Math.cos(i)]}function Bv(t,e,i,n,r,s,o,a,l,h){const c=(u=o,Math.PI*u/180);var u;let d=[],p=0,f=0,g=0,v=0;if(h)[p,f,g,v]=h;else{[t,e]=_v(t,e,-c),[i,n]=_v(i,n,-c);const o=(t-i)/2,h=(e-n)/2;let u=o*o/(r*r)+h*h/(s*s);u>1&&(u=Math.sqrt(u),r*=u,s*=u);const d=r*r,m=s*s,y=d*m-d*h*h-m*o*o,b=d*h*h+m*o*o,x=(a===l?-1:1)*Math.sqrt(Math.abs(y/b));g=x*r*h/s+(t+i)/2,v=x*-s*o/r+(e+n)/2,p=Math.asin(parseFloat(((e-v)/s).toFixed(9))),f=Math.asin(parseFloat(((n-v)/s).toFixed(9))),t<g&&(p=Math.PI-p),i<g&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),l&&p>f&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}let m=f-p;if(Math.abs(m)>120*Math.PI/180){const t=f,e=i,a=n;f=l&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=Bv(i=g+r*Math.cos(f),n=v+s*Math.sin(f),e,a,r,s,o,0,l,[f,t,g,v])}m=f-p;const y=Math.cos(p),b=Math.sin(p),x=Math.cos(f),w=Math.sin(f),A=Math.tan(m/4),S=4/3*r*A,T=4/3*s*A,C=[t,e],_=[t+S*b,e-T*y],B=[i+S*w,n-T*x],P=[i,n];if(_[0]=2*C[0]-_[0],_[1]=2*C[1]-_[1],h)return[_,B,P].concat(d);{d=[_,B,P].concat(d);const t=[];for(let e=0;e<d.length;e+=3){const i=_v(d[e][0],d[e][1],c),n=_v(d[e+1][0],d[e+1][1],c),r=_v(d[e+2][0],d[e+2][1],c);t.push([i[0],i[1],n[0],n[1],r[0],r[1]])}return t}}const Pv={randOffset:function(t,e){return Uv(t,e)},randOffsetWithRange:function(t,e,i){return jv(t,e,i)},ellipse:function(t,e,i,n,r){return Ev(t,e,r,kv(i,n,r)).opset},doubleLineOps:function(t,e,i,n,r){return Wv(t,e,i,n,r,!0)}};function Rv(t,e,i,n,r){return{type:"path",ops:Wv(t,e,i,n,r)}}function Mv(t,e,i){const n=(t||[]).length;if(n>2){const r=[];for(let e=0;e<n-1;e++)r.push(...Wv(t[e][0],t[e][1],t[e+1][0],t[e+1][1],i));return e&&r.push(...Wv(t[n-1][0],t[n-1][1],t[0][0],t[0][1],i)),{type:"path",ops:r}}return 2===n?Rv(t[0][0],t[0][1],t[1][0],t[1][1],i):{type:"path",ops:[]}}function kv(t,e,i){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),r=Math.ceil(Math.max(i.curveStepCount,i.curveStepCount/Math.sqrt(200)*n)),s=2*Math.PI/r;let o=Math.abs(t/2),a=Math.abs(e/2);const l=1-i.curveFitting;return o+=Uv(o*l,i),a+=Uv(a*l,i),{increment:s,rx:o,ry:a}}function Ev(t,e,i,n){const[r,s]=Gv(n.increment,t,e,n.rx,n.ry,1,n.increment*jv(.1,jv(.4,1,i),i),i);let o=zv(r,null,i);if(!i.disableMultiStroke&&0!==i.roughness){const[r]=Gv(n.increment,t,e,n.rx,n.ry,1.5,0,i),s=zv(r,null,i);o=o.concat(s)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function Ov(t,e,i,n,r,s,o,a,l){const h=t,c=e;let u=Math.abs(i/2),d=Math.abs(n/2);u+=Uv(.01*u,l),d+=Uv(.01*d,l);let p=r,f=s;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/l.curveStepCount,v=Math.min(g/2,(f-p)/2),m=Hv(v,h,c,u,d,p,f,1,l);if(!l.disableMultiStroke){const t=Hv(v,h,c,u,d,p,f,1.5,l);m.push(...t)}return o&&(a?m.push(...Wv(h,c,h+u*Math.cos(p),c+d*Math.sin(p),l),...Wv(h,c,h+u*Math.cos(f),c+d*Math.sin(f),l)):m.push({op:"lineTo",data:[h,c]},{op:"lineTo",data:[h+u*Math.cos(p),c+d*Math.sin(p)]})),{type:"path",ops:m}}function Lv(t,e){const i=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,r=n.length;if(r>2){i.push({op:"move",data:[n[0][0]+Uv(t,e),n[0][1]+Uv(t,e)]});for(let s=1;s<r;s++)i.push({op:"lineTo",data:[n[s][0]+Uv(t,e),n[s][1]+Uv(t,e)]})}}return{type:"fillPath",ops:i}}function Iv(t,e){return function(t,e){let i=t.fillStyle||"hachure";if(!bv[i])switch(i){case"zigzag":bv[i]||(bv[i]=new fv(e));break;case"cross-hatch":bv[i]||(bv[i]=new gv(e));break;case"dots":bv[i]||(bv[i]=new vv(e));break;case"dashed":bv[i]||(bv[i]=new mv(e));break;case"zigzag-line":bv[i]||(bv[i]=new yv(e));break;default:i="hachure",bv[i]||(bv[i]=new pv(e))}return bv[i]}(e,Pv).fillPolygons(t,e)}function Dv(t){return t.randomizer||(t.randomizer=new xv(t.seed||0)),t.randomizer.next()}function jv(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return i.roughness*n*(Dv(i)*(e-t)+t)}function Uv(t,e){return jv(-t,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function Wv(t,e,i,n,r){const s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?r.disableMultiStrokeFill:r.disableMultiStroke,o=Nv(t,e,i,n,r,!0,!1);if(s)return o;const a=Nv(t,e,i,n,r,!0,!0);return o.concat(a)}function Nv(t,e,i,n,r,s,o){const a=Math.pow(t-i,2)+Math.pow(e-n,2),l=Math.sqrt(a);let h=1;h=l<200?1:l>500?.4:-.0016668*l+1.233334;let c=r.maxRandomnessOffset||0;c*c*100>a&&(c=l/10);const u=c/2,d=.2+.2*Dv(r);let p=r.bowing*r.maxRandomnessOffset*(n-e)/200,f=r.bowing*r.maxRandomnessOffset*(t-i)/200;p=Uv(p,r,h),f=Uv(f,r,h);const g=[],v=()=>Uv(u,r,h),m=()=>Uv(c,r,h),y=r.preserveVertices;return s&&(o?g.push({op:"move",data:[t+(y?0:v()),e+(y?0:v())]}):g.push({op:"move",data:[t+(y?0:Uv(c,r,h)),e+(y?0:Uv(c,r,h))]})),o?g.push({op:"bcurveTo",data:[p+t+(i-t)*d+v(),f+e+(n-e)*d+v(),p+t+2*(i-t)*d+v(),f+e+2*(n-e)*d+v(),i+(y?0:v()),n+(y?0:v())]}):g.push({op:"bcurveTo",data:[p+t+(i-t)*d+m(),f+e+(n-e)*d+m(),p+t+2*(i-t)*d+m(),f+e+2*(n-e)*d+m(),i+(y?0:m()),n+(y?0:m())]}),g}function Fv(t,e,i){const n=[];n.push([t[0][0]+Uv(e,i),t[0][1]+Uv(e,i)]),n.push([t[0][0]+Uv(e,i),t[0][1]+Uv(e,i)]);for(let r=1;r<t.length;r++)n.push([t[r][0]+Uv(e,i),t[r][1]+Uv(e,i)]),r===t.length-1&&n.push([t[r][0]+Uv(e,i),t[r][1]+Uv(e,i)]);return zv(n,null,i)}function zv(t,e,i){const n=t.length,r=[];if(n>3){const s=[],o=1-i.curveTightness;r.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const i=t[e];s[0]=[i[0],i[1]],s[1]=[i[0]+(o*t[e+1][0]-o*t[e-1][0])/6,i[1]+(o*t[e+1][1]-o*t[e-1][1])/6],s[2]=[t[e+1][0]+(o*t[e][0]-o*t[e+2][0])/6,t[e+1][1]+(o*t[e][1]-o*t[e+2][1])/6],s[3]=[t[e+1][0],t[e+1][1]],r.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}if(e&&2===e.length){const t=i.maxRandomnessOffset;r.push({op:"lineTo",data:[e[0]+Uv(t,i),e[1]+Uv(t,i)]})}}else 3===n?(r.push({op:"move",data:[t[1][0],t[1][1]]}),r.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&r.push(...Wv(t[0][0],t[0][1],t[1][0],t[1][1],i));return r}function Gv(t,e,i,n,r,s,o,a){const l=[],h=[];if(0===a.roughness){t/=4,h.push([e+n*Math.cos(-t),i+r*Math.sin(-t)]);for(let s=0;s<=2*Math.PI;s+=t){const t=[e+n*Math.cos(s),i+r*Math.sin(s)];l.push(t),h.push(t)}h.push([e+n*Math.cos(0),i+r*Math.sin(0)]),h.push([e+n*Math.cos(t),i+r*Math.sin(t)])}else{const c=Uv(.5,a)-Math.PI/2;h.push([Uv(s,a)+e+.9*n*Math.cos(c-t),Uv(s,a)+i+.9*r*Math.sin(c-t)]);const u=2*Math.PI+c-.01;for(let o=c;o<u;o+=t){const t=[Uv(s,a)+e+n*Math.cos(o),Uv(s,a)+i+r*Math.sin(o)];l.push(t),h.push(t)}h.push([Uv(s,a)+e+n*Math.cos(c+2*Math.PI+.5*o),Uv(s,a)+i+r*Math.sin(c+2*Math.PI+.5*o)]),h.push([Uv(s,a)+e+.98*n*Math.cos(c+o),Uv(s,a)+i+.98*r*Math.sin(c+o)]),h.push([Uv(s,a)+e+.9*n*Math.cos(c+.5*o),Uv(s,a)+i+.9*r*Math.sin(c+.5*o)])}return[h,l]}function Hv(t,e,i,n,r,s,o,a,l){const h=s+Uv(.1,l),c=[];c.push([Uv(a,l)+e+.9*n*Math.cos(h-t),Uv(a,l)+i+.9*r*Math.sin(h-t)]);for(let s=h;s<=o;s+=t)c.push([Uv(a,l)+e+n*Math.cos(s),Uv(a,l)+i+r*Math.sin(s)]);return c.push([e+n*Math.cos(o),i+r*Math.sin(o)]),c.push([e+n*Math.cos(o),i+r*Math.sin(o)]),zv(c,null,l)}function Vv(t,e,i,n,r,s,o,a){const l=[],h=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let c=[0,0];const u=a.disableMultiStroke?1:2,d=a.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(d?0:Uv(h[0],a)),o[1]+(d?0:Uv(h[0],a))]}),c=d?[r,s]:[r+Uv(h[p],a),s+Uv(h[p],a)],l.push({op:"bcurveTo",data:[t+Uv(h[p],a),e+Uv(h[p],a),i+Uv(h[p],a),n+Uv(h[p],a),c[0],c[1]]});return l}function Yv(t){return[...t]}function Xv(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function $v(t,e,i){const n=Xv(e,i);if(0===n)return Xv(t,e);let r=((t[0]-e[0])*(i[0]-e[0])+(t[1]-e[1])*(i[1]-e[1]))/n;return r=Math.max(0,Math.min(1,r)),Xv(t,qv(e,i,r))}function qv(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function Kv(t,e,i,n){const r=n||[];if(function(t,e){const i=t[e+0],n=t[e+1],r=t[e+2],s=t[e+3];let o=3*n[0]-2*i[0]-s[0];o*=o;let a=3*n[1]-2*i[1]-s[1];a*=a;let l=3*r[0]-2*s[0]-i[0];l*=l;let h=3*r[1]-2*s[1]-i[1];return h*=h,o<l&&(o=l),a<h&&(a=h),o+a}(t,e)<i){const i=t[e+0];r.length?(s=r[r.length-1],o=i,Math.sqrt(Xv(s,o))>1&&r.push(i)):r.push(i),r.push(t[e+3])}else{const n=.5,s=t[e+0],o=t[e+1],a=t[e+2],l=t[e+3],h=qv(s,o,n),c=qv(o,a,n),u=qv(a,l,n),d=qv(h,c,n),p=qv(c,u,n),f=qv(d,p,n);Kv([s,h,d,f],0,i,r),Kv([f,p,u,l],0,i,r)}var s,o;return r}function Zv(t,e){return Jv(t,0,t.length,e)}function Jv(t,e,i,n,r){const s=r||[],o=t[e],a=t[i-1];let l=0,h=1;for(let n=e+1;n<i-1;++n){const e=$v(t[n],o,a);e>l&&(l=e,h=n)}return Math.sqrt(l)>n?(Jv(t,e,h+1,n,s),Jv(t,h,i,n,s)):(s.length||s.push(o),s.push(a)),s}function Qv(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,i=arguments.length>2?arguments[2]:void 0;const n=[],r=(t.length-1)/3;for(let i=0;i<r;i++)Kv(t,3*i,e,n);return i&&i>0?Jv(n,0,n.length,i):n}const tm="none";class em{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,i){return{shape:t,sets:e||[],options:i||this.defaultOptions}}line(t,e,i,n,r){const s=this._o(r);return this._d("line",[Rv(t,e,i,n,s)],s)}rectangle(t,e,i,n,r){const s=this._o(r),o=[],a=function(t,e,i,n,r){return function(t,e){return Mv(t,!0,e)}([[t,e],[t+i,e],[t+i,e+n],[t,e+n]],r)}(t,e,i,n,s);if(s.fill){const r=[[t,e],[t+i,e],[t+i,e+n],[t,e+n]];"solid"===s.fillStyle?o.push(Lv([r],s)):o.push(Iv([r],s))}return s.stroke!==tm&&o.push(a),this._d("rectangle",o,s)}ellipse(t,e,i,n,r){const s=this._o(r),o=[],a=kv(i,n,s),l=Ev(t,e,s,a);if(s.fill)if("solid"===s.fillStyle){const i=Ev(t,e,s,a).opset;i.type="fillPath",o.push(i)}else o.push(Iv([l.estimatedPoints],s));return s.stroke!==tm&&o.push(l.opset),this._d("ellipse",o,s)}circle(t,e,i,n){const r=this.ellipse(t,e,i,i,n);return r.shape="circle",r}linearPath(t,e){const i=this._o(e);return this._d("linearPath",[Mv(t,!1,i)],i)}arc(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7?arguments[7]:void 0;const l=this._o(a),h=[],c=Ov(t,e,i,n,r,s,o,!0,l);if(o&&l.fill)if("solid"===l.fillStyle){const o=Object.assign({},l);o.disableMultiStroke=!0;const a=Ov(t,e,i,n,r,s,!0,!1,o);a.type="fillPath",h.push(a)}else h.push(function(t,e,i,n,r,s,o){const a=t,l=e;let h=Math.abs(i/2),c=Math.abs(n/2);h+=Uv(.01*h,o),c+=Uv(.01*c,o);let u=r,d=s;for(;u<0;)u+=2*Math.PI,d+=2*Math.PI;d-u>2*Math.PI&&(u=0,d=2*Math.PI);const p=(d-u)/o.curveStepCount,f=[];for(let t=u;t<=d;t+=p)f.push([a+h*Math.cos(t),l+c*Math.sin(t)]);return f.push([a+h*Math.cos(d),l+c*Math.sin(d)]),f.push([a,l]),Iv([f],o)}(t,e,i,n,r,s,l));return l.stroke!==tm&&h.push(c),this._d("arc",h,l)}curve(t,e){const i=this._o(e),n=[],r=function(t,e){let i=Fv(t,1*(1+.2*e.roughness),e);if(!e.disableMultiStroke){const n=Fv(t,1.5*(1+.22*e.roughness),function(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}(e));i=i.concat(n)}return{type:"path",ops:i}}(t,i);if(i.fill&&i.fill!==tm&&t.length>=3){const e=Qv(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=t.length;if(i<3)throw new Error("A curve must have at least three points.");const n=[];if(3===i)n.push(Yv(t[0]),Yv(t[1]),Yv(t[2]),Yv(t[2]));else{const i=[];i.push(t[0],t[0]);for(let e=1;e<t.length;e++)i.push(t[e]),e===t.length-1&&i.push(t[e]);const r=[],s=1-e;n.push(Yv(i[0]));for(let t=1;t+2<i.length;t++){const e=i[t];r[0]=[e[0],e[1]],r[1]=[e[0]+(s*i[t+1][0]-s*i[t-1][0])/6,e[1]+(s*i[t+1][1]-s*i[t-1][1])/6],r[2]=[i[t+1][0]+(s*i[t][0]-s*i[t+2][0])/6,i[t+1][1]+(s*i[t][1]-s*i[t+2][1])/6],r[3]=[i[t+1][0],i[t+1][1]],n.push(r[1],r[2],r[3])}}return n}(t),10,(1+i.roughness)/2);"solid"===i.fillStyle?n.push(Lv([e],i)):n.push(Iv([e],i))}return i.stroke!==tm&&n.push(r),this._d("curve",n,i)}polygon(t,e){const i=this._o(e),n=[],r=Mv(t,!0,i);return i.fill&&("solid"===i.fillStyle?n.push(Lv([t],i)):n.push(Iv([t],i))),i.stroke!==tm&&n.push(r),this._d("polygon",n,i)}path(t,e){const i=this._o(e),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=i.fill&&"transparent"!==i.fill&&i.fill!==tm,s=i.stroke!==tm,o=!!(i.simplification&&i.simplification<1),a=function(t,e,i){const n=Cv(Tv(Sv(t))),r=[];let s=[],o=[0,0],a=[];const l=()=>{a.length>=4&&s.push(...Qv(a,1)),a=[]},h=()=>{l(),s.length&&(r.push(s),s=[])};for(const{key:t,data:e}of n)switch(t){case"M":h(),o=[e[0],e[1]],s.push(o);break;case"L":l(),s.push([e[0],e[1]]);break;case"C":if(!a.length){const t=s.length?s[s.length-1]:o;a.push([t[0],t[1]])}a.push([e[0],e[1]]),a.push([e[2],e[3]]),a.push([e[4],e[5]]);break;case"Z":l(),s.push([o[0],o[1]])}if(h(),!i)return r;const c=[];for(const t of r){const e=Zv(t,i);e.length&&c.push(e)}return c}(t,0,o?4-4*i.simplification:(1+i.roughness)/2);return r&&("solid"===i.fillStyle?n.push(Lv(a,i)):n.push(Iv(a,i))),s&&(o?a.forEach((t=>{n.push(Mv(t,!1,i))})):n.push(function(t,e){const i=Cv(Tv(Sv(t))),n=[];let r=[0,0],s=[0,0];for(const{key:t,data:o}of i)switch(t){case"M":{const t=1*(e.maxRandomnessOffset||0),i=e.preserveVertices;n.push({op:"move",data:o.map((n=>n+(i?0:Uv(t,e))))}),s=[o[0],o[1]],r=[o[0],o[1]];break}case"L":n.push(...Wv(s[0],s[1],o[0],o[1],e)),s=[o[0],o[1]];break;case"C":{const[t,i,r,a,l,h]=o;n.push(...Vv(t,i,r,a,l,h,s,e)),s=[l,h];break}case"Z":n.push(...Wv(s[0],s[1],r[0],r[1],e)),s=[r[0],r[1]]}return{type:"path",ops:n}}(t,i))),this._d("path",n,i)}opsToPath(t,e){let i="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":i+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":i+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":i+=`L${t[0]} ${t[1]} `}}return i.trim()}toPaths(t){const e=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:tm};break;case"fillPath":e={d:this.opsToPath(t),stroke:tm,strokeWidth:0,fill:i.fill||tm};break;case"fillSketch":e=this.fillSketch(t,i)}e&&n.push(e)}return n}fillSketch(t,e){let i=e.fillWeight;return i<0&&(i=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||tm,strokeWidth:i,fill:tm}}}class im{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new em(e)}draw(t){const e=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(const s of e)switch(s.type){case"path":n.save(),n.strokeStyle="none"===i.stroke?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,s,r),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,s,r,e),n.restore();break}case"fillSketch":this.fillSketch(n,s,i)}}fillSketch(t,e,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,e,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";t.beginPath();for(const n of e.ops){const e="number"==typeof i&&i>=0?n.data.map((t=>+t.toFixed(i))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,i,n,r){const s=this.gen.line(t,e,i,n,r);return this.draw(s),s}rectangle(t,e,i,n,r){const s=this.gen.rectangle(t,e,i,n,r);return this.draw(s),s}ellipse(t,e,i,n,r){const s=this.gen.ellipse(t,e,i,n,r);return this.draw(s),s}circle(t,e,i,n){const r=this.gen.circle(t,e,i,n);return this.draw(r),r}linearPath(t,e){const i=this.gen.linearPath(t,e);return this.draw(i),i}polygon(t,e){const i=this.gen.polygon(t,e);return this.draw(i),i}arc(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7?arguments[7]:void 0;const l=this.gen.arc(t,e,i,n,r,s,o,a);return this.draw(l),l}curve(t,e){const i=this.gen.curve(t,e);return this.draw(i),i}path(t,e){const i=this.gen.path(t,e);return this.draw(i),i}}var nm=(t,e)=>new im(t,e);const rm={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};var sm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},om=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},am=function(t,e){return function(i,n){e(i,n,t)}};let lm=class{constructor(t){this.canvasRenderer=t,this.style="rough",this.type="arc",this.numberType=qo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s);r.highPerformanceSave();const a=Tr(t).arc;let{x:l=a.x,y:h=a.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=a.dx,dy:i=a.dy}=t.attribute;l+=e,h+=i,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);const c=new Di,{fill:u=a.fill,stroke:d=a.stroke,lineWidth:p=a.lineWidth,outerRadius:f=a.outerRadius,innerRadius:g=a.innerRadius,maxRandomnessOffset:v=rm.maxRandomnessOffset,roughness:m=rm.roughness,bowing:y=rm.bowing,curveFitting:b=rm.curveFitting,curveTightness:x=rm.curveTightness,curveStepCount:w=rm.curveStepCount,fillStyle:A=rm.fillStyle,fillWeight:S=rm.fillWeight,hachureAngle:T=rm.hachureAngle,hachureGap:C=rm.hachureGap,simplification:_=rm.simplification,dashOffset:B=rm.dashOffset,dashGap:P=rm.dashGap,zigzagOffset:R=rm.zigzagOffset,seed:M=rm.seed,fillLineDash:k=rm.fillLineDash,fillLineDashOffset:E=rm.fillLineDashOffset,disableMultiStroke:O=rm.disableMultiStroke,disableMultiStrokeFill:L=rm.disableMultiStrokeFill,preserveVertices:I=rm.preserveVertices,fixedDecimalPlaceDigits:D=rm.fixedDecimalPlaceDigits}=t.attribute;Na(t,c,l,h,f,g),o.path(c.toString(),{fill:u||void 0,stroke:d||void 0,strokeWidth:p,maxRandomnessOffset:v,roughness:m,bowing:y,curveFitting:b,curveTightness:x,curveStepCount:w,fillStyle:A,fillWeight:S,hachureAngle:T,hachureGap:C,simplification:_,dashOffset:B,dashGap:P,zigzagOffset:R,seed:M,fillLineDash:k,fillLineDashOffset:E,disableMultiStroke:O,disableMultiStrokeFill:L,preserveVertices:I,fixedDecimalPlaceDigits:D}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};lm=sm([g(),am(0,p(t.DefaultCanvasArcRender)),om("design:paramtypes",[Object])],lm);var hm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let cm=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.style="rough"}drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f){if(f)return super.drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=nm(g,{}),m=new Di;Mu(m,e,l,{offsetX:h,offsetY:c});const{maxRandomnessOffset:y=rm.maxRandomnessOffset,roughness:b=rm.roughness,bowing:x=rm.bowing,curveFitting:w=rm.curveFitting,curveTightness:A=rm.curveTightness,curveStepCount:S=rm.curveStepCount,fillStyle:T=rm.fillStyle,fillWeight:C=rm.fillWeight,hachureAngle:_=rm.hachureAngle,hachureGap:B=rm.hachureGap,simplification:P=rm.simplification,dashOffset:R=rm.dashOffset,dashGap:M=rm.dashGap,zigzagOffset:k=rm.zigzagOffset,seed:E=rm.seed,fillLineDash:O=rm.fillLineDash,fillLineDashOffset:L=rm.fillLineDashOffset,disableMultiStroke:I=rm.disableMultiStroke,disableMultiStrokeFill:D=rm.disableMultiStrokeFill,preserveVertices:j=rm.preserveVertices,fixedDecimalPlaceDigits:U=rm.fixedDecimalPlaceDigits}=o;let{fill:W,stroke:N,lineWidth:F}=o;return Array.isArray(a)?a.forEach((t=>{W=null!=W?W:t.fill,N=null!=N?N:t.stroke,F=null!=F?F:t.lineWidth})):(W=null!=W?W:a.fill,N=null!=N?N:a.stroke,F=null!=F?F:a.lineWidth),v.path(m.toString(),{fill:i?W:void 0,strokeWidth:F,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:A,curveStepCount:S,fillStyle:T,fillWeight:C,hachureAngle:_,hachureGap:B,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:k,seed:E,fillLineDash:O,fillLineDashOffset:L,disableMultiStroke:I,disableMultiStrokeFill:D,preserveVertices:j,fixedDecimalPlaceDigits:U}),t.highPerformanceRestore(),!1}};cm=hm([g()],cm);var um=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},dm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pm=function(t,e){return function(i,n){e(i,n,t)}};let fm=class{constructor(t){this.canvasRenderer=t,this.style="rough",this.type="circle",this.numberType=Jo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s,{}),a=Tr(t).circle;let{x:l=a.x,y:h=a.y}=t.attribute;t.transMatrix.onlyTranslate()?r.onlyTranslate()||r.clearMatrix():(l=0,h=0,r.transformFromMatrix(t.transMatrix,!0));const{radius:c=a.radius,fill:u=a.fill,stroke:d=a.stroke,lineWidth:p=a.lineWidth}=t.attribute;o.circle(l,h,c,{fill:u||void 0,stroke:d||void 0,strokeWidth:p,fillStyle:"zigzag",roughness:.5})}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};fm=um([g(),pm(0,p(t.DefaultCanvasCircleRender)),dm("design:paramtypes",[Object])],fm);var gm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let vm=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.style="rough"}drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f){if(p||f)return super.drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=nm(g,{}),m=new Di;_u(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u});const{maxRandomnessOffset:y=rm.maxRandomnessOffset,roughness:b=rm.roughness,bowing:x=rm.bowing,curveFitting:w=rm.curveFitting,curveTightness:A=rm.curveTightness,curveStepCount:S=rm.curveStepCount,fillStyle:T=rm.fillStyle,fillWeight:C=rm.fillWeight,hachureAngle:_=rm.hachureAngle,hachureGap:B=rm.hachureGap,simplification:P=rm.simplification,dashOffset:R=rm.dashOffset,dashGap:M=rm.dashGap,zigzagOffset:k=rm.zigzagOffset,seed:E=rm.seed,fillLineDash:O=rm.fillLineDash,fillLineDashOffset:L=rm.fillLineDashOffset,disableMultiStroke:I=rm.disableMultiStroke,disableMultiStrokeFill:D=rm.disableMultiStrokeFill,preserveVertices:j=rm.preserveVertices,fixedDecimalPlaceDigits:U=rm.fixedDecimalPlaceDigits}=o;let{fill:W,stroke:N,lineWidth:F}=o;return Array.isArray(a)?a.forEach((t=>{W=null!=W?W:t.fill,N=null!=N?N:t.stroke,F=null!=F?F:t.lineWidth})):(W=null!=W?W:a.fill,N=null!=N?N:a.stroke,F=null!=F?F:a.lineWidth),v.path(m.toString(),{fill:i?W:void 0,stroke:n?N:void 0,strokeWidth:F,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:A,curveStepCount:S,fillStyle:T,fillWeight:C,hachureAngle:_,hachureGap:B,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:k,seed:E,fillLineDash:O,fillLineDashOffset:L,disableMultiStroke:I,disableMultiStrokeFill:D,preserveVertices:j,fixedDecimalPlaceDigits:U}),t.highPerformanceRestore(),!1}};vm=gm([g()],vm);var mm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ym=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bm=function(t,e){return function(i,n){e(i,n,t)}};let xm=class{constructor(t){this.canvasRenderer=t,this.style="rough",this.type="path",this.numberType=na}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s,{});r.highPerformanceSave();const a=Tr(t).path;r.transformFromMatrix(t.transMatrix,!0);const{fill:l=a.fill,stroke:h=a.stroke,lineWidth:c=a.lineWidth,path:u=a.path,maxRandomnessOffset:d=rm.maxRandomnessOffset,roughness:p=rm.roughness,bowing:f=rm.bowing,curveFitting:g=rm.curveFitting,curveTightness:v=rm.curveTightness,curveStepCount:m=rm.curveStepCount,fillStyle:y=rm.fillStyle,fillWeight:b=rm.fillWeight,hachureAngle:x=rm.hachureAngle,hachureGap:w=rm.hachureGap,simplification:A=rm.simplification,dashOffset:S=rm.dashOffset,dashGap:T=rm.dashGap,zigzagOffset:C=rm.zigzagOffset,seed:_=rm.seed,fillLineDash:B=rm.fillLineDash,fillLineDashOffset:P=rm.fillLineDashOffset,disableMultiStroke:R=rm.disableMultiStroke,disableMultiStrokeFill:M=rm.disableMultiStrokeFill,preserveVertices:k=rm.preserveVertices,fixedDecimalPlaceDigits:E=rm.fixedDecimalPlaceDigits}=t.attribute;"string"==typeof u&&o.path(u,{fill:l||void 0,stroke:h||void 0,strokeWidth:c,maxRandomnessOffset:d,roughness:p,bowing:f,curveFitting:g,curveTightness:v,curveStepCount:m,fillStyle:y,fillWeight:b,hachureAngle:x,hachureGap:w,simplification:A,dashOffset:S,dashGap:T,zigzagOffset:C,seed:_,fillLineDash:B,fillLineDashOffset:P,disableMultiStroke:R,disableMultiStrokeFill:M,preserveVertices:k,fixedDecimalPlaceDigits:E}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};xm=mm([g(),bm(0,p(t.DefaultCanvasPathRender)),ym("design:paramtypes",[Object])],xm);var wm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Am=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sm=function(t,e){return function(i,n){e(i,n,t)}};let Tm=class{constructor(t){this.canvasRenderer=t,this.style="rough",this.type="rect",this.numberType=oa}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s);r.highPerformanceSave();const a=Tr(t).rect;let{x:l=a.x,y:h=a.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=a.dx,dy:i=a.dy}=t.attribute;l+=e,h+=i,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);const{fill:c=a.fill,stroke:u=a.stroke,fillColor:d=a.fill,strokeColor:p=a.stroke,x1:f,y1:g,lineWidth:v=a.lineWidth,maxRandomnessOffset:m=rm.maxRandomnessOffset,roughness:y=rm.roughness,bowing:b=rm.bowing,curveFitting:x=rm.curveFitting,curveTightness:w=rm.curveTightness,curveStepCount:A=rm.curveStepCount,fillStyle:S=rm.fillStyle,fillWeight:T=rm.fillWeight,hachureAngle:C=rm.hachureAngle,hachureGap:_=rm.hachureGap,simplification:B=rm.simplification,dashOffset:P=rm.dashOffset,dashGap:R=rm.dashGap,zigzagOffset:M=rm.zigzagOffset,seed:k=rm.seed,fillLineDash:E=rm.fillLineDash,fillLineDashOffset:O=rm.fillLineDashOffset,disableMultiStroke:L=rm.disableMultiStroke,disableMultiStrokeFill:I=rm.disableMultiStrokeFill,preserveVertices:D=rm.preserveVertices,fixedDecimalPlaceDigits:j=rm.fixedDecimalPlaceDigits}=t.attribute;let{width:U=a.width,height:W=a.height}=t.attribute;U=(null!=U?U:f-l)||0,W=(null!=W?W:g-h)||0,o.rectangle(l,h,U,W,{fill:c?d:void 0,stroke:u?p:void 0,strokeWidth:v,maxRandomnessOffset:m,roughness:y,bowing:b,curveFitting:x,curveTightness:w,curveStepCount:A,fillStyle:S,fillWeight:T,hachureAngle:C,hachureGap:_,simplification:B,dashOffset:P,dashGap:R,zigzagOffset:M,seed:k,fillLineDash:E,fillLineDashOffset:O,disableMultiStroke:L,disableMultiStrokeFill:I,preserveVertices:D,fixedDecimalPlaceDigits:j}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};Tm=wm([g(),Sm(0,p(t.DefaultCanvasRectRender)),Am("design:paramtypes",[Object])],Tm);var Cm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},_m=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bm=function(t,e){return function(i,n){e(i,n,t)}};let Pm=class extends Ic{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ha,this.style="rough"}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s);r.highPerformanceSave();const a=Tr(t).symbol,l=this.transform(t,a,r),{x:h,y:c,z:u,lastModelMatrix:d}=l,p=t.getParsedPath();if(!p)return;const{fill:f=a.fill,stroke:g=a.stroke,fillColor:v=a.fill,strokeColor:m=a.stroke,size:y=a.size,lineWidth:b=a.lineWidth,maxRandomnessOffset:x=rm.maxRandomnessOffset,roughness:w=rm.roughness,bowing:A=rm.bowing,curveFitting:S=rm.curveFitting,curveTightness:T=rm.curveTightness,curveStepCount:C=rm.curveStepCount,fillStyle:_=rm.fillStyle,fillWeight:B=rm.fillWeight,hachureAngle:P=rm.hachureAngle,hachureGap:R=rm.hachureGap,simplification:M=rm.simplification,dashOffset:k=rm.dashOffset,dashGap:E=rm.dashGap,zigzagOffset:O=rm.zigzagOffset,seed:L=rm.seed,fillLineDash:I=rm.fillLineDash,fillLineDashOffset:D=rm.fillLineDashOffset,disableMultiStroke:j=rm.disableMultiStroke,disableMultiStrokeFill:U=rm.disableMultiStrokeFill,preserveVertices:W=rm.preserveVertices,fixedDecimalPlaceDigits:N=rm.fixedDecimalPlaceDigits}=t.attribute;let F="";if(p.drawToSvgPath)F=p.drawToSvgPath(y,h,c);else{const t=new Di;p.draw(t,y,h,c)&&t.closePath(),F=t.toString()}o.path(F,{fill:f?v:void 0,stroke:g?m:void 0,strokeWidth:b,maxRandomnessOffset:x,roughness:w,bowing:A,curveFitting:S,curveTightness:T,curveStepCount:C,fillStyle:_,fillWeight:B,hachureAngle:P,hachureGap:R,simplification:M,dashOffset:k,dashGap:E,zigzagOffset:O,seed:L,fillLineDash:I,fillLineDashOffset:D,disableMultiStroke:j,disableMultiStrokeFill:U,preserveVertices:W,fixedDecimalPlaceDigits:N}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};Pm=Cm([g(),Bm(0,p(t.DefaultCanvasSymbolRender)),_m("design:paramtypes",[Object])],Pm);var Rm=new i((t=>{t(fm).toSelf().inSingletonScope(),t(Ad).to(fm),t(Tm).toSelf().inSingletonScope(),t(Ad).to(Tm),t(xm).toSelf().inSingletonScope(),t(Ad).to(xm),t(Pm).toSelf().inSingletonScope(),t(Ad).to(Pm),t(vm).toSelf().inSingletonScope(),t(Ad).to(vm),t(cm).toSelf().inSingletonScope(),t(Ad).to(cm),t(lm).toSelf().inSingletonScope(),t(Ad).to(lm)}));const Mm=Symbol.for("MathPickerContribution"),km=Symbol.for("MathArcPicker"),Em=Symbol.for("MathAreaPicker"),Om=Symbol.for("MathCirclePicker"),Lm=Symbol.for("MathImagePicker"),Im=Symbol.for("MathLinePicker"),Dm=Symbol.for("MathPathPicker"),jm=Symbol.for("MathRectPicker"),Um=Symbol.for("MathSymbolPicker"),Wm=Symbol.for("MathTextPicker"),Nm=Symbol.for("MathPolygonPicker"),Fm=Symbol.for("MathGlyphPicker"),zm=Symbol.for("CanvasArcPicker"),Gm=Symbol.for("CanvasArc3dPicker"),Hm=Symbol.for("CanvasAreaPicker"),Vm=Symbol.for("CanvasCirclePicker"),Ym=Symbol.for("CanvasImagePicker"),Xm=Symbol.for("CanvasLinePicker"),$m=Symbol.for("CanvasPathPicker"),qm=Symbol.for("CanvasRectPicker"),Km=Symbol.for("CanvasRect3dPicker"),Zm=Symbol.for("CanvasSymbolPicker"),Jm=Symbol.for("CanvasTextPicker"),Qm=Symbol.for("CanvasPolygonPicker"),ty=Symbol.for("CanvasPyramid3dPicker"),ey=Symbol.for("CanvasRichTextPicker"),iy=Symbol.for("CanvasGlyphPicker"),ny=Symbol.for("CanvasGroupPicker"),ry=Symbol.for("CanvasPickerContribution"),sy={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},oy=Object.keys(sy);function ay(t){return Mc.richtext(t?t.attribute:{})}ay.Text=function(t){return Object.assign({type:"rich/text"},t)},ay.Image=function(t){return Object.assign({type:"rich/image"},t)};var ly=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i};function hy(t,e){if(nt(t))return t.forEach((t=>hy(t,e)));e.push(t)}const cy=ya;function uy(t){if(!t||!t.$$typeof)return t;const e=t.type,{attribute:i,children:n,stateProxy:r,id:s,name:o}=t.props,a=e({attribute:i}),l=function(t,e,i){let n,r=!1;switch(t.type){case"richtext":break;case"rich/text":n=t.attribute||{},i&&(n.text=i),t.attribute=n;break;case"rich/image":n=t.attribute||{};break;default:r=!0}return r?Object.keys(e).forEach((i=>{const n=sy[i];n&&t.on(n,e[i])})):"richtext"===t.type&&(t.attribute.textConfig=i.map((t=>uy(t))).filter((t=>t))),n}(a,t.props,n);return l||(r&&(a.stateProxy=r),a.id=s,a.name=o,dy(n,a),a)}function dy(t,e){nt(t)?t.forEach((t=>{if(nt(t))dy(t,e);else{const i=uy(t);i&&i.type&&e.add(i)}})):t&&e.add(uy(t))}const py=(t,e)=>{const i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},fy=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};var gy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const my=[0,0,0];let yy=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},Fi),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Gi),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Hi),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new $t(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new $t(1,0,0,1,0,0),this._clearMatrix=new $t(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&yt.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new $t(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return yc.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(yc.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(yc.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,n,r,s,o){if(o=o||0,this.camera){const a=[];((t,e,i,n,r,s,o,a)=>{if(a)for(;i>e;)i-=Bt;else for(;i<e;)i+=Bt;const l=Tt/3*(i>e?1:-1);let h=e,c=h;for(;c!==i;){c=l>0?Math.min(c+l,i):Math.max(c+l,i);const e=Math.abs(c-h),a=4*Math.tan(e/4)/3,u=c<h?-1:1,d=Math.cos(h),p=Math.sin(h),f=Math.cos(c),g=Math.sin(c),v=d*s+n,m=p*o+r,y=f*s+n,b=g*o+r,x=s*a*u,w=o*a*u;t.push([v-x*p,m+w*d,y+x*g,b-w*f,y,b]),h=c}})(a,n,r,t,e,i,i,s);for(let t=0;t<a.length;++t){const e=a[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],o)}}else this.nativeContext.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.nativeContext.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s,o){if(o=o||0,this.camera){let a=o,l=o;this.modelMatrix&&(cf(my,[t,e,o],this.modelMatrix),t=my[0],e=my[1],a=my[2],cf(my,[i,n,o],this.modelMatrix),i=my[0],n=my[1],l=my[2],cf(my,[r,s,o],this.modelMatrix),r=my[0],s=my[1],o=my[2]);let h=this.camera.vp(r,s,o);r=h.x,s=h.y,h=this.camera.vp(t,e,a),t=h.x,e=h.y,h=this.camera.vp(i,n,l),i=h.x,n=h.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,o,a){null==a?this.nativeContext.ellipse(t,e,i,n,r,s,o):this.nativeContext.ellipse(t,e,i,n,r,s,o,a)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(cf(my,[t,e,i],this.modelMatrix),t=my[0],e=my[1],i=my[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(cf(my,[t,e,i],this.modelMatrix),t=my[0],e=my[1],i=my[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,n,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(cf(my,[t,e,r],this.modelMatrix),t=my[0],e=my[1],s=my[2],cf(my,[i,n,r],this.modelMatrix),i=my[0],n=my[1],r=my[2]);let o=this.camera.vp(i,n,r);i=o.x,n=o.y,o=this.camera.vp(t,e,s),t=o.x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+n,r),this.lineTo(t,e+n,r),this.closePath()):this.nativeContext.rect(t,e,i,n)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,n){return this.nativeContext.createLinearGradient(t,e,i,n)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createRadialGradient(t,e,i,n,r,s)}createConicGradient(t,e,i,n){let r,s=!1;const o=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(a,l,h){return s&&(h||(h=n-i),r=Va(o,this.stops,t,e,h,i,n,a,l),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,n){this.nativeContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){this.nativeContext.clearRect(t,e,i,n)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(cf(my,[t,e,i],this.modelMatrix),t=my[0],e=my[1],i=my[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(cf(my,[t,e,i],this.modelMatrix),t=my[0],e=my[1],i=my[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(cf(my,[e,i,n],this.modelMatrix),e=my[0],i=my[1],n=my[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,n){return this.nativeContext.getImageData(t,e,i,n)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn.global.measureTextMethod;var i,n;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=pn.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const r=null!==(i=this.fontFamily)&&void 0!==i?i:Hi.fontFamily,s=null!==(n=this.fontSize)&&void 0!==n?n:Hi.fontSize;return this.mathTextMeasure.textSpec.fontFamily===r&&this.mathTextMeasure.textSpec.fontSize===s||(this.mathTextMeasure.textSpec.fontFamily=r,this.mathTextMeasure.textSpec.fontSize=s,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,n){this.nativeContext.strokeRect(t,e,i,n)}strokeText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(cf(my,[e,i,n],this.modelMatrix),e=my[0],i=my[1],n=my[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setCommonStyle(t,e,i,n,s)}return this._setCommonStyle(t,e,i,n,r)}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,o>1e-12&&a>1e-12&&(s.fillStyle=Wc(this,l,t,i,n))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const n=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(n,t)})),this._setShadowBlendStyle(t,e,n)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:o=i.shadowColor,shadowOffsetX:a=i.shadowOffsetX,shadowOffsetY:l=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:c=i.globalCompositeOperation}=e;r<=1e-12||(s||a||l?(n.shadowBlur=s*this.dpr,n.shadowColor=o,n.shadowOffsetX=a*this.dpr,n.shadowOffsetY=l*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),h?(n.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(n.filter="blur(0px)",this._clearFilterStyle=!1),c?(n.globalCompositeOperation=c,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(n.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setStrokeStyle(t,e,i,n,s)}return this._setStrokeStyle(t,e,i,n,r)}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(s.globalAlpha=o*a*this.baseGlobalAlpha,o>1e-12&&a>1e-12){const{lineWidth:o=r.lineWidth,stroke:a=r.stroke,lineJoin:l=r.lineJoin,lineDash:h=r.lineDash,lineCap:c=r.lineCap,miterLimit:u=r.miterLimit}=e;s.lineWidth=Uc(this,o,this.dpr),s.strokeStyle=Wc(this,a,t,i,n),s.lineJoin=l,h&&s.setLineDash(h),s.lineCap=c,s.miterLimit=u}}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?n.font=t.font:n.font=al(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=al(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>yc.free(t))),this.stack.length=0}};yy.env="browser",yy=gy([g(),vy("design:paramtypes",[Object,Number])],yy);var by=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let wy=class extends t.BaseCanvas{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=pn.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new yy(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:n=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:o}=this;o.width=e*n,o.height=i*n,!o.style||this.setCanvasStyle(o,r,s,e,i),t.id&&(o.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,n,r){this.controled&&(t.style.width=`${n}px`,t.style.height=`${r}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Ay(t,e){return new i((i=>{i(Pn).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(Rn).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}wy.env="browser",wy=by([g(),xy("design:paramtypes",[Object])],wy);const Sy=Ay(wy,yy);var Ty=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Cy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_y=function(t,e){return function(i,n){e(i,n,t)}};let By=class extends t.DefaultPickService{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=ar.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),o=s?t:null,a={graphic:o,params:s};if(o)return a;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}return a}};By=Ty([g(),_y(0,p(E)),_y(0,v(ry)),_y(1,p(Dd)),_y(2,p(E)),_y(2,v(np)),Cy("design:paramtypes",[Object,Object,Object])],By);var Py=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Ry=class{constructor(){this.type="group",this.numberType=ta}contains(t,e,i){return!1}};Ry=Py([g()],Ry);const My=new i(((t,e,i,n)=>{My.__vloaded||(My.__vloaded=!0,t(ny).to(Ry).inSingletonScope(),t(ry).toService(ny),L(t,ry))}));My.__vloaded=!1;var ky=My;const Ey=new i(((t,e,i,n)=>{i(By)||t(By).toSelf().inSingletonScope(),i(Qd)?n(Qd).toService(By):t(Qd).toService(By)}));function Oy(t){t.load(ky),t.load(Ey)}var Ly,Iy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Dy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jy=Ly=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Ly.idprefix}_${Ly.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=pn.global,this.viewBox=new Vt,this.modelMatrix=new $t(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>n)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:Ly.GenerateCanvasId(),canvasControled:!0};this.canvas=new wy(n)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let n=t.width,r=t.height;if(null==n||null==r||!t.canvasControled){const t=i.getBoundingClientRect();n=t.width,r=t.height}let s=t.dpr;null==s&&(s=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/n),this.canvas=new wy({width:n,height:r,dpr:s,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};jy.env="browser",jy.idprefix="visactor_window",jy.prefix_count=0,jy=Ly=Iy([g(),Dy("design:paramtypes",[])],jy);const Uy=new i((t=>{t(jy).toSelf(),t(ur).toDynamicValue((t=>t.container.get(jy))).whenTargetNamed(jy.env)}));var Wy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ny=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Fy{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function zy(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}t.BrowserEnvContribution=class extends t.BaseEnvContribution{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,n;let r=0,s=0,o=0,a=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=e.clientX||0,s=e.clientY||0,o=r,a=s}else r=t.clientX||0,s=t.clientY||0,o=t.offsetX||0,a=t.offsetY||0;if(e){const t=r,i=s,o=e.getBoundingClientRect(),a=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;let l,h;return a&&(l=o.width/a.offsetWidth,h=o.height/a.offsetHeight),{x:(t-o.left)/(ot(l)?l:1),y:(i-o.top)/(ot(h)?h:1)}}return{x:o,y:a}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Fy(t)}return new Vt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:n,style:r}=e;return r&&(it(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=i&&(t.style.width=`${i}px`),null!=n&&(t.style.height=`${n}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,n=document.createElement(e);if(this.updateDom(n,t),i){const t=it(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(n)}return n}loadImage(t){return zy(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return zy(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var i,n;const r=document.createElement("canvas");t.id&&(r.id=null!==(i=t.id)&&void 0!==i?i:e.GenAutoIncrementId().toString());const s=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.width=t.width*s,r.height=t.height*s),r}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let i=t.offsetTop,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,n=n.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetLeft,n=n.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,n=t.offsetLeft,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{top:i,left:n}}},t.BrowserEnvContribution=Wy([g(),Ny("design:paramtypes",[])],t.BrowserEnvContribution);const Gy=new i((e=>{Gy.isBrowserBound||(Gy.isBrowserBound=!0,e(t.BrowserEnvContribution).toSelf().inSingletonScope(),e(U).toService(t.BrowserEnvContribution))}));function Hy(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Hy.__loaded||(Hy.__loaded=!0,t.load(Gy),t.load(Sy),t.load(Uy),e&&Oy(t))}Gy.isBrowserBound=!1,Hy.__loaded=!1;var Vy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Yy=class extends yy{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}getImageData(t,e,i,n){return new Promise(((r,s)=>{var o;try{tt.canvasGetImageData({canvasId:null!==(o=this.canvas.nativeCanvas.id)&&void 0!==o?o:this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}createPattern(t,e){return null}};Yy.env="feishu",Yy=Vy([g()],Yy);var Xy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$y=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let qy=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Yy(this,this._dpr)}release(){}};qy.env="feishu",qy=Xy([g(),$y("design:paramtypes",[Object])],qy);const Ky=Ay(qy,Yy);var Zy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Jy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qy=function(t,e){return function(i,n){e(i,n,t)}};let tb=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new qy(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new qy({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};tb.env="feishu",tb=Zy([g(),Qy(0,p(W)),Jy("design:paramtypes",[Object])],tb);const eb=new i((t=>{t(tb).toSelf(),t(ur).toDynamicValue((t=>t.container.get(tb))).whenTargetNamed(tb.env)}));var ib=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},nb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rb=function(t,e){return function(i,n){e(i,n,t)}};let sb=class extends t.DefaultPickService{constructor(t,e){super(e),this.contributions=t,this.pickItemInterceptorContributions=e,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){this.pickContext=new t.EmptyContext2d(null,1)}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),o=s?t:null;return o?{graphic:o,params:s}:null}};sb=ib([g(),rb(0,p(E)),rb(0,v(Mm)),rb(1,p(E)),rb(1,v(np)),nb("design:paramtypes",[Object,Object])],sb);const ob=new i((t=>{ob.__vloaded||(ob.__vloaded=!0,L(t,Mm))}));ob.__vloaded=!1;var ab=ob,lb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cb=function(t,e){return function(i,n){e(i,n,t)}};let ub=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=qo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};ub=lb([g(),cb(0,p(yd)),hb("design:paramtypes",[Object])],ub);let db=!1;const pb=new i(((t,e,i,n)=>{db||(db=!0,t(km).to(ub).inSingletonScope(),t(Mm).toService(km))}));var fb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vb=function(t,e){return function(i,n){e(i,n,t)}};let mb=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Zo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),n.highPerformanceRestore(),a}};mb=fb([g(),vb(0,p(xd)),gb("design:paramtypes",[Object])],mb);let yb=!1;const bb=new i(((t,e,i,n)=>{yb||(yb=!0,t(Em).to(mb).inSingletonScope(),t(Mm).toService(Em))}));var xb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},wb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ab=function(t,e){return function(i,n){e(i,n,t)}};let Sb=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Jo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Sb=xb([g(),Ab(0,p(wd)),wb("design:paramtypes",[Object])],Sb);let Tb=!1;const Cb=new i(((t,e,i,n)=>{Tb||(Tb=!0,t(Om).to(Sb).inSingletonScope(),t(Mm).toService(Om))}));var _b=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Bb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pb=function(t,e){return function(i,n){e(i,n,t)}};let Rb=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=Qo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,null,i))})),n}return!1}};Rb=_b([g(),Pb(0,p(Od)),Bb("design:paramtypes",[Object])],Rb);let Mb=!1;const kb=new i(((t,e,i,n)=>{Mb||(Mb=!0,t(Fm).to(Rb).inSingletonScope(),t(Rb).toService(Fm))}));var Eb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Ob=class{constructor(){this.type="image",this.numberType=ea}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};Ob=Eb([g()],Ob);let Lb=!1;const Ib=new i(((t,e,i,n)=>{Lb||(Lb=!0,t(Lm).to(Ob).inSingletonScope(),t(Ob).toService(Lm))}));var Db=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},jb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ub=function(t,e){return function(i,n){e(i,n,t)}};let Wb=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=ia}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).line;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Wb=Db([g(),Ub(0,p(Td)),jb("design:paramtypes",[Object])],Wb);let Nb=!1;const Fb=new i(((t,e,i,n)=>{Nb||(Nb=!0,t(Im).to(Wb).inSingletonScope(),t(Mm).toService(Im))}));var zb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Gb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hb=function(t,e){return function(i,n){e(i,n,t)}};let Vb=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=ra}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Vb=zb([g(),Hb(0,p(_d)),Gb("design:paramtypes",[Object])],Vb);let Yb=!1;const Xb=new i(((t,e,i,n)=>{Yb||(Yb=!0,t(Nm).to(Vb).inSingletonScope(),t(Mm).toService(Nm))}));var $b=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kb=function(t,e){return function(i,n){e(i,n,t)}};let Zb=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=na}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).path;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Zb=$b([g(),Kb(0,p(Cd)),qb("design:paramtypes",[Object])],Zb);let Jb=!1;const Qb=new i(((t,e,i,n)=>{Jb||(Jb=!0,t(Dm).to(Zb).inSingletonScope(),t(Mm).toService(Dm))}));var tx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ex=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ix=function(t,e){return function(i,n){e(i,n,t)}};const nx=new Vt;let rx=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=oa}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,l=!1,n.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||st(s,!0)&&0!==s||nt(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,r)=>{if(h)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)h=!0;else if(n){const i=t.AABBBounds;nx.setValue(i.x1,i.y1,i.x2,i.y2),nx.expand(-s/2),h=!nx.containsPoint(e)}}return n.highPerformanceRestore(),h}};rx=tx([g(),ix(0,p(Bd)),ex("design:paramtypes",[Object])],rx);let sx=!1;const ox=new i(((t,e,i,n)=>{sx||(sx=!0,t(jm).to(rx).inSingletonScope(),t(Mm).toService(jm))}));let ax=!1;const lx=new i(((t,e,i,n)=>{ax||(ax=!0,t(Lm).to(Ob).inSingletonScope(),t(Ob).toService(Lm))}));var hx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},cx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ux=function(t,e){return function(i,n){e(i,n,t)}};let dx=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=ha}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).symbol;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};dx=hx([g(),ux(0,p(Rd)),cx("design:paramtypes",[Object])],dx);let px=!1;const fx=new i(((t,e,i,n)=>{px||(px=!0,t(Um).to(dx).inSingletonScope(),t(Mm).toService(Um))}));var gx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let vx=class{constructor(){this.type="text",this.numberType=ca}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};vx=gx([g()],vx);let mx=!1;const yx=new i(((t,e,i,n)=>{mx||(mx=!0,t(Wm).to(vx).inSingletonScope(),t(Mm).toService(Wm))})),bx=new i(((t,e,i,n)=>{i(sb)||t(sb).toSelf().inSingletonScope(),i(Qd)?n(Qd).toService(sb):t(Qd).toService(sb)}));function xx(t){t.load(ab),t.load(bx),t.load(pb),t.load(bb),t.load(Cb),t.load(kb),t.load(Ib),t.load(Fb),t.load(Xb),t.load(Qb),t.load(ox),t.load(lx),t.load(fx),t.load(yx)}class Ax{get width(){return this._w*this.dpr}set width(t){}get height(){return this._h*this.dpr}set height(t){}get offsetWidth(){return this._w}set offsetWidth(t){}get offsetHeight(){return this._h}set offsetHeight(t){}constructor(t,e,i,n,r,s){this.nativeCanvas=t,this.ctx=e,this._w=n,this._h=r,this.id=s,t.id=s,this.dpr=i}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}class Sx{get width(){return this._w*this.dpr}set width(t){this._w=t/this.dpr,this.nativeCanvas.width=t}get height(){return this._h*this.dpr}set height(t){this._h=t/this.dpr,this.nativeCanvas.height=t}get offsetWidth(){return this._w}set offsetWidth(t){this._w=t,this.nativeCanvas.width=t*this.dpr}get offsetHeight(){return this._h}set offsetHeight(t){this._h=t,this.nativeCanvas.height=t*this.dpr}constructor(t,e,i,n,r,s){this.nativeCanvas=t,this.ctx=e,this._w=n,this._h=r,this.id=s,t.id=s,this.dpr=i}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}var Tx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Cx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _x=class extends t.BaseEnvContribution{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s){const o=null!=s?s:tt.getSystemInfoSync().pixelRatio;e.forEach(((e,s)=>{const a=tt.createCanvasContext(e),l=new Ax(a.canvas||{},a,o,t.width,t.height,e);a.canvas=l,i.set(e,l),s>=n&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.pixelRatio))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};_x=Tx([g(),Cx("design:paramtypes",[])],_x);const Bx=new i((t=>{Bx.isFeishuBound||(Bx.isFeishuBound=!0,t(_x).toSelf().inSingletonScope(),t(U).toService(_x))}));function Px(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Px.__loaded||(Px.__loaded=!0,t.load(Bx),t.load(Ky),t.load(eb),e&&xx(t))}Bx.isFeishuBound=!1,Px.__loaded=!1;var Rx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Mx=class extends yy{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,s.lineWidth=Uc(this,l,this.dpr),s.strokeStyle=Wc(this,h,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||u&&s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,pn.global.devicePixelRatio),super.measureText(t,e)}createPattern(t,e){return null}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}};Mx.env="lynx",Mx=Rx([g()],Mx);var kx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ex=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ox=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Mx(this,this._dpr)}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._nativeCanvas.nativeCanvas&&(this._nativeCanvas.nativeCanvas.width=this._pixelWidth,this._nativeCanvas.nativeCanvas.height=this._pixelHeight),this._context.dpr=this._dpr}release(){}};Ox.env="lynx",Ox=kx([g(),Ex("design:paramtypes",[Object])],Ox);var Lx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ix=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dx=function(t,e){return function(i,n){e(i,n,t)}};let jx=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Ox(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Ox({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};jx.env="lynx",jx=Lx([g(),Dx(0,p(W)),Ix("design:paramtypes",[Object])],jx);const Ux=new i((t=>{t(jx).toSelf(),t(ur).toDynamicValue((t=>t.container.get(jx))).whenTargetNamed(jx.env)})),Wx=Ay(Ox,Mx);var Nx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Fx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zx=!1;try{zx=!!lynx.createCanvasNG}catch(t){}let Gx=class extends t.BaseEnvContribution{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s,o){const a=null!=o?o:SystemInfo.pixelRatio;if(e.forEach(((e,o)=>{let l;s?l=lynx.createOffscreenCanvas():(l=zx?lynx.createCanvasNG(e):lynx.createCanvas(e),zx&&l.attachToCanvasView(e)),l.width=t.width*a,l.height=t.height*a;const h=l.getContext("2d"),c=new Sx(l,h,a,t.width,t.height,e);i.set(e,c),o>n&&r.push(c)})),!r.length&&lynx.createOffscreenCanvas){const e=lynx.createOffscreenCanvas();e.width=t.width*a,e.height=t.height*a;const n=e.getContext("2d"),s=Math.random().toString(),o=new Sx(e,n,a,t.width,t.height,s);i.set(s,o),r.push(o)}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,!!e.offscreen,e.pixelRatio))}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}loadImage(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();const e=lynx.createImage(t);return new Promise(((t,i)=>{e.onload=()=>{t(e)},e.onerror=()=>{i(new Error("加载失败"))}}))}(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};Gx=Nx([g(),Fx("design:paramtypes",[])],Gx);const Hx=new i((t=>{Hx.isLynxBound||(Hx.isLynxBound=!0,t(Gx).toSelf().inSingletonScope(),t(U).toService(Gx))}));function Vx(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Vx.__loaded||(Vx.__loaded=!0,t.load(Hx),t.load(Wx),t.load(Ux),e&&xx(t))}Hx.isLynxBound=!1,Vx.__loaded=!1;var Yx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Xx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let $x=class extends yy{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new $t(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};$x.env="node",$x=Yx([g(),Xx("design:paramtypes",[Object,Number])],$x);var qx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Kx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Zx=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new $x(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(){this._nativeCanvas.release&&$(this._nativeCanvas.release)&&this._nativeCanvas.release()}};Zx.env="node",Zx=qx([g(),Kx("design:paramtypes",[Object])],Zx);const Jx=Ay(Zx,$x);var Qx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},tw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ew=function(t,e){return function(i,n){e(i,n,t)}};let iw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Zx(n)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,n=t.height;null!=i&&null!=n&&t.canvasControled||(i=e.width,n=e.height),this.canvas=new Zx({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};iw.env="node",iw=Qx([g(),ew(0,p(W)),tw("design:paramtypes",[Object])],iw);const nw=new i((t=>{t(iw).toSelf(),t(ur).toDynamicValue((t=>t.container.get(iw))).whenTargetNamed(iw.env)}));var rw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let sw=class extends t.BaseEnvContribution{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};sw=rw([g()],sw);const ow=new i((t=>{ow.isNodeBound||(ow.isNodeBound=!0,t(sw).toSelf().inSingletonScope(),t(U).toService(sw))}));function aw(t){aw.__loaded||(aw.__loaded=!0,t.load(ow),t.load(Jx),t.load(nw))}ow.isNodeBound=!1,aw.__loaded=!1;var lw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let hw=class extends yy{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,i){}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;o>1e-12&&a>1e-12&&(s.setGlobalAlpha(o*a),s.setFillStyle(Wc(this,l,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(Uc(this,l,this.dpr)),s.setStrokeStyle(Wc(this,h,t,i,n)),s.setLineJoin(c),u&&s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){var i;const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=al(t,e),n.setFontSize(null!==(i=t.fontSize)&&void 0!==i?i:e.fontSize)}setTextStyle(t,e){var i,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=al(t,e),r.setTextAlign(null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign),r.setTextBaseline(null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}getImageData(t,e,i,n){const r=this.nativeContext,s=r.taro;if(r&&s)return!r.getImageData&&s.canvasGetImageData?new Promise(((r,o)=>{try{s.canvasGetImageData({canvasId:this.canvas.nativeCanvas.id,sx:t,sy:e,sw:i,sh:n,success(t){r(t)}})}catch(t){o(t)}})):void 0}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createCircularGradient&&this.nativeContext.createCircularGradient(t,e,i,n,r,s)}};hw.env="taro",hw=lw([g()],hw);var cw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},uw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let dw=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new hw(this,this._dpr)}release(){}};dw.env="taro",dw=cw([g(),uw("design:paramtypes",[Object])],dw);const pw=Ay(dw,hw);var fw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vw=function(t,e){return function(i,n){e(i,n,t)}};let mw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new dw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new dw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,i)=>{t.changedTouches[i]=Object.assign(Object.assign({},t.changedTouches[i]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,i)=>{t.touches[i]=Object.assign(Object.assign({},t.touches[i]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};mw.env="taro",mw=fw([g(),vw(0,p(W)),gw("design:paramtypes",[Object])],mw);const yw=new i((t=>{t(mw).toSelf(),t(ur).toDynamicValue((t=>t.container.get(mw))).whenTargetNamed(mw.env)}));var bw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ww=class extends t.BaseEnvContribution{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}configure(t,e){var i,n,r,s,o,a,l;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,o=this.freeCanvasList,a=e.taro,l=e.pixelRatio,n.forEach(((t,e)=>{const n=a.createCanvasContext(t),h=new Ax(n.canvas||{},n,l,i.width,i.height,t);return n.canvas=h,r.set(t,h),e>=s&&o.push(h),h})),this.taro=e.taro,this.pixelRatio=e.pixelRatio)}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const i=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],n=(new XMLSerializer).serializeToString(i),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const i=new e.Blob([t],{type:"image/svg+xml"}),n=e.URL.createObjectURL(i);return Promise.resolve({data:n,loadState:"success"})}return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return this.pixelRatio}getRequestAnimationFrame(){return requestAnimationFrame}getCancelAnimationFrame(){return cancelAnimationFrame}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};ww=bw([g(),xw("design:paramtypes",[])],ww);const Aw=new i((t=>{Aw.isTaroBound||(Aw.isTaroBound=!0,t(ww).toSelf().inSingletonScope(),t(U).toService(ww))}));function Sw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Sw.__loaded||(Sw.__loaded=!0,t.load(Aw),t.load(pw),t.load(yw),e&&xx(t))}Aw.isTaroBound=!1,Sw.__loaded=!1;var Tw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Cw=class extends yy{draw(){}createPattern(t,e){return null}};Cw.env="wx",Cw=Tw([g()],Cw);var _w=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Bw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Pw=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Cw(this,this._dpr)}release(){}};Pw.env="wx",Pw=_w([g(),Bw("design:paramtypes",[Object])],Pw);const Rw=Ay(Pw,Cw);var Mw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},kw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ew=function(t,e){return function(i,n){e(i,n,t)}};let Ow=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Pw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Pw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){var e,i,n,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(i=t.changedTouches[0].x)&&void 0!==i?i:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(n=t.changedTouches[0].y)&&void 0!==n?n:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};Ow.env="wx",Ow=Mw([g(),Ew(0,p(W)),kw("design:paramtypes",[Object])],Ow);const Lw=new i((t=>{t(Ow).toSelf(),t(ur).toDynamicValue((t=>t.container.get(Ow))).whenTargetNamed(Ow.env)}));var Iw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Dw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jw=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};let Uw=class extends t.BaseEnvContribution{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r,s){return jw(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let l=wx.createSelectorQuery();s&&(l=l.in(s)),l.select(`#${a}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const l=s[0].node,h=s[0].width,c=s[0].height;l.width=h*t,l.height=c*t,i.set(a,l),o>=n&&r.push(l),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return wx.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};Uw=Iw([g(),Dw("design:paramtypes",[])],Uw);const Ww=new i((t=>{Ww._isWxBound||(Ww._isWxBound=!0,t(Uw).toSelf().inSingletonScope(),t(U).toService(Uw))}));function Nw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Nw.__loaded||(Nw.__loaded=!0,t.load(Ww),t.load(Rw),t.load(Lw),e&&xx(t))}function Fw(t){zw(t)}function zw(t){zw.__loaded||(zw.__loaded=!0,Hy(t,!1),Px(t,!1),Vx(t,!1),aw(t),Sw(t,!1),Nw(t,!1),Oy(t),Vp.hooks.onSetEnv.tap("loadMathPicker",((e,i)=>{"browser"!==i&&xx(t)})))}Ww._isWxBound=!1,Nw.__loaded=!1,zw.__loaded=!1;var Gw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Hw=class extends Yy{};Hw.env="tt",Hw=Gw([g()],Hw);var Vw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Yw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Xw=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Hw(this,this._dpr)}release(){}};Xw.env="tt",Xw=Vw([g(),Yw("design:paramtypes",[Object])],Xw);const $w=Ay(Xw,Hw);var qw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Kw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zw=function(t,e){return function(i,n){e(i,n,t)}};let Jw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="tt",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Xw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Xw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};Jw.env="tt",Jw=qw([g(),Zw(0,p(W)),Kw("design:paramtypes",[Object])],Jw);const Qw=new i((t=>{t(Jw).toSelf(),t(ur).toDynamicValue((t=>t.container.get(Jw))).whenTargetNamed(Jw.env)}));var tA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},eA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iA=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};let nA=class extends t.BaseEnvContribution{constructor(){super(),this.type="tt",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r,s){return iA(this,void 0,void 0,(function*(){const t=tt.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let l=tt.createSelectorQuery();s&&(l=l.in(s)),l.select(`#${a}`).node().exec((s=>{const l=s[0].node,h=l.width,c=l.height;l.width=h*t,l.height=c*t,i.set(a,l),o>=n&&r.push(l),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};nA=tA([g(),eA("design:paramtypes",[])],nA);const rA=new i((t=>{rA.isTTBound||(rA.isTTBound=!0,t(nA).toSelf().inSingletonScope(),t(U).toService(nA))}));function sA(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];sA.__loaded||(sA.__loaded=!0,t.load(rA),t.load($w),t.load(Qw),e&&xx(t))}rA.isTTBound=!1,sA.__loaded=!1;var oA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let aA=class extends yy{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,s.lineWidth=Uc(this,l,this.dpr),s.strokeStyle=Wc(this,h,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||u&&s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,pn.global.devicePixelRatio),super.measureText(t,e)}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;let s="";s=t.font?t.font:al(t,e,r&&this.camera&&this.camera.getProjectionScale(i)),n.font=(s||"").replace("px","vp");const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes);let o="";o=t.font?t.font:al(t,e,this.camera&&this.camera.getProjectionScale(i)),s.font=(o||"").replace("px","vp");const{fontFamily:a=e.fontFamily,fontSize:l=e.fontSize}=t;this.fontFamily=a,this.fontSize=l,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}createPattern(t,e){return null}drawImage(){const t=this.nativeContext,e=arguments;e[0].drawImage&&(e[0]=e[0].transferToImageBitmap()),3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}draw(){}};aA.env="harmony",aA=oA([g()],aA);var lA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let cA=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new aA(this,this._dpr)}resize(t,e){}release(){}};cA.env="harmony",cA=lA([g(),hA("design:paramtypes",[Object])],cA);var uA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},dA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pA=function(t,e){return function(i,n){e(i,n,t)}};class fA{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}let gA=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="harmony",this.eventManager=new fA}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new cA(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}this.canvas=new cA({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};gA.env="harmony",gA=uA([g(),pA(0,p(W)),dA("design:paramtypes",[Object])],gA);const vA=new i((t=>{t(gA).toSelf(),t(ur).toDynamicValue((t=>t.container.get(gA))).whenTargetNamed(gA.env)})),mA=Ay(cA,aA);var yA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},bA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let xA=class extends t.BaseEnvContribution{constructor(){super(),this.type="harmony",this.supportEvent=!0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0,this.rafSTO=new fs(0)}configure(t,e){t.env===this.type&&t.setActiveEnvContribution(this)}getDynamicCanvasCount(){return 9999}getStaticCanvasCount(){return 9999}loadImage(t){}loadSvg(t){return Promise.reject()}createCanvas(t){return function(t,e,i){const n=new OffscreenCanvas(t,e),r=n.getContext("2d");return new Ax({width:t,height:e,context:r,_c:n,getBoundingClientRect:()=>({width:t,height:e}),getContext:()=>r},r,1,t,e,i)}(t.width,t.height,t.id)}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return t=>this.rafSTO.call(t)}getCancelAnimationFrame(){return t=>{this.rafSTO.clear(t)}}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return null}getRootElement(){return null}getDocument(){return null}release(){}};xA=yA([g(),bA("design:paramtypes",[])],xA);const wA=new i((t=>{wA.isHarmonyBound||(wA.isHarmonyBound=!0,t(xA).toSelf().inSingletonScope(),t(U).toService(xA))}));function AA(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];AA.__loaded||(AA.__loaded=!0,t.load(wA),t.load(mA),t.load(vA),e&&xx(t))}wA.isHarmonyBound=!1,AA.__loaded=!1;var SA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},TA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},CA=function(t,e){return function(i,n){e(i,n,t)}};let _A=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=qo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};_A=SA([g(),CA(0,p(yd)),TA("design:paramtypes",[Object])],_A);let BA=!1;const PA=new i(((t,e,i,n)=>{BA||(BA=!0,t(zm).to(_A).inSingletonScope(),t(ry).toService(zm))}));var RA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},MA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kA=function(t,e){return function(i,n){e(i,n,t)}};const EA=new Vt;let OA=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=oa}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,l=!1,n.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||st(s,!0)&&0!==s||nt(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,r)=>{if(h)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)h=!0;else if(n){const i=t.AABBBounds;EA.setValue(i.x1,i.y1,i.x2,i.y2),EA.expand(-s/2),h=!EA.containsPoint(e)}}return n.highPerformanceRestore(),h}};OA=RA([g(),kA(0,p(Bd)),MA("design:paramtypes",[Object])],OA);let LA=!1;const IA=new i(((t,e,i,n)=>{LA||(LA=!0,t(qm).to(OA).inSingletonScope(),t(ry).toService(qm))}));var DA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let jA=class extends Ic{};jA=DA([g()],jA);var UA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},WA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},NA=function(t,e){return function(i,n){e(i,n,t)}};let FA=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=ia}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const r=Tr(t).line,s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Uc(n,r+s,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};FA=UA([g(),NA(0,p(Td)),WA("design:paramtypes",[Object])],FA);let zA=!1;const GA=new i(((t,e,i,n)=>{zA||(zA=!0,t(Xm).to(FA).inSingletonScope(),t(ry).toService(Xm))}));var HA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},VA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},YA=function(t,e){return function(i,n){e(i,n,t)}};let XA=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Zo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;const{fillPickable:a=r.fillPickable,strokePickable:l=r.strokePickable}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let h=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!h||!!a&&(h=t.isPointInPath(e.x,e.y),h)),((t,i,r)=>{if(h)return!0;if(!l)return!1;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),h=t.isPointInStroke(e.x,e.y),h})),n.highPerformanceRestore(),h}};XA=HA([g(),YA(0,p(xd)),VA("design:paramtypes",[Object])],XA);let $A=!1;const qA=new i(((t,e,i,n)=>{$A||($A=!0,t(Hm).to(XA).inSingletonScope(),t(ry).toService(Hm))}));var KA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ZA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},JA=function(t,e){return function(i,n){e(i,n,t)}};let QA=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ha}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const s=Tr(t).symbol,o=this.transform(t,s,n),{x:a,y:l,z:h,lastModelMatrix:c}=o;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,a,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Uc(n,r+s,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&bc.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};QA=KA([g(),JA(0,p(Rd)),ZA("design:paramtypes",[Object])],QA);let tS=!1;const eS=new i(((t,e,i,n)=>{tS||(tS=!0,t(Zm).to(QA).inSingletonScope(),t(ry).toService(Zm))}));var iS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},nS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rS=function(t,e){return function(i,n){e(i,n,t)}};let sS=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Jo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};sS=iS([g(),rS(0,p(wd)),nS("design:paramtypes",[Object])],sS);let oS=!1;const aS=new i(((t,e,i,n)=>{oS||(oS=!0,t(Vm).to(sS).inSingletonScope(),t(ry).toService(Vm))}));var lS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cS=function(t,e){return function(i,n){e(i,n,t)}};let uS=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=ca}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=Tr(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,l=this.transform(t,s,n,a),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,h,c,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:o=s.textBaseline,textAlign:a=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),v=cl(o,d,r),m=hl(a,g);return e.rect(m+h,v+c,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&bc.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};uS=lS([g(),cS(0,p(Md)),hS("design:paramtypes",[Object])],uS);let dS=!1;const pS=new i(((t,e,i,n)=>{dS||(dS=!0,t(Jm).to(uS).inSingletonScope(),t(ry).toService(Jm))}));var fS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vS=function(t,e){return function(i,n){e(i,n,t)}};let mS=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=na}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).path;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Uc(n,r+s,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};mS=fS([g(),vS(0,p(Cd)),gS("design:paramtypes",[Object])],mS);let yS=!1;const bS=new i(((t,e,i,n)=>{yS||(yS=!0,t($m).to(mS).inSingletonScope(),t(ry).toService($m))}));var xS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},wS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},AS=function(t,e){return function(i,n){e(i,n,t)}};let SS=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=ra}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};SS=xS([g(),AS(0,p(_d)),wS("design:paramtypes",[Object])],SS);let TS=!1;const CS=new i(((t,e,i,n)=>{TS||(TS=!0,t(Qm).to(SS).inSingletonScope(),t(ry).toService(Qm))}));var _S=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},BS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},PS=function(t,e){return function(i,n){e(i,n,t)}};let RS=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=Qo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{if(n)return;const s=r.pickItem(t,e,null,i);n=!(!s||!s.graphic)})),n}return!1}};RS=_S([g(),PS(0,p(Od)),BS("design:paramtypes",[Object])],RS);let MS=!1;const kS=new i(((t,e,i,n)=>{MS||(MS=!0,t(iy).to(RS).inSingletonScope(),t(ry).toService(iy))}));var ES=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},OS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},LS=function(t,e){return function(i,n){e(i,n,t)}};let IS=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=la}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};IS=ES([g(),LS(0,p(kd)),OS("design:paramtypes",[Object])],IS);let DS=!1;const jS=new i(((t,e,i,n)=>{DS||(DS=!0,t(ey).to(IS).inSingletonScope(),t(ry).toService(ey))}));var US=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let WS=class{constructor(){this.type="image",this.numberType=ea}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};WS=US([g()],WS);let NS=!1;const FS=new i(((t,e,i,n)=>{NS||(NS=!0,t(Ym).to(WS).inSingletonScope(),t(ry).toService(Ym))}));var zS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},GS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},HS=function(t,e){return function(i,n){e(i,n,t)}};new Vt;let VS=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=aa}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).rect;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};VS=zS([g(),HS(0,p(Pd)),GS("design:paramtypes",[Object])],VS);let YS=!1;const XS=new i(((t,e,i,n)=>{YS||(YS=!0,t(Km).to(VS).inSingletonScope(),t(ry).toService(Km))}));var $S=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},qS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},KS=function(t,e){return function(i,n){e(i,n,t)}};let ZS=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Ko}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).arc;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};ZS=$S([g(),KS(0,p(bd)),qS("design:paramtypes",[Object])],ZS);let JS=!1;const QS=new i(((t,e,i,n)=>{JS||(JS=!0,t(Gm).to(ZS).inSingletonScope(),t(ry).toService(Gm))}));var tT=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},eT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iT=function(t,e){return function(i,n){e(i,n,t)}};let nT=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=sa}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).polygon;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};nT=tT([g(),iT(0,p(Ed)),eT("design:paramtypes",[Object])],nT);let rT=!1;const sT=new i(((t,e,i,n)=>{rT||(rT=!0,t(ty).to(nT).inSingletonScope(),t(ry).toService(ty))})),oT=ff();function aT(){aT.__loaded||(aT.__loaded=!0,Yg(),Bn.load(og),Bn.load(oT?PA:pb))}aT.__loaded=!1;const lT=aT;function hT(){hT.__loaded||(hT.__loaded=!0,Xg(),Bn.load(Fg),Bn.load(QS))}hT.__loaded=!1;const cT=hT;function uT(){uT.__loaded||(uT.__loaded=!0,$g(),Bn.load(dg),Bn.load(oT?qA:bb))}uT.__loaded=!1;const dT=uT;function pT(){pT.__loaded||(pT.__loaded=!0,qg(),Bn.load(vg),Bn.load(oT?aS:Cb))}pT.__loaded=!1;const fT=pT;function gT(){gT.__loaded||(gT.__loaded=!0,Kg(),Bn.load(_g),Bn.load(oT?kS:kb))}gT.__loaded=!1;const vT=gT;function mT(){mT.__loaded||(mT.__loaded=!0,Zg())}mT.__loaded=!1;const yT=mT;function bT(){bT.__loaded||(bT.__loaded=!0,Jg(),Bn.load(Og),Bn.load(oT?FS:Ib))}bT.__loaded=!1;const xT=bT;function wT(){wT.__loaded||(wT.__loaded=!0,Qg(),Bn.load(cg),Bn.load(oT?GA:Fb))}wT.__loaded=!1;const AT=wT;function ST(){ST.__loaded||(ST.__loaded=!0,tv(),Bn.load(xg),Bn.load(oT?bS:Qb))}ST.__loaded=!1;const TT=ST;function CT(){CT.__loaded||(CT.__loaded=!0,ev(),Bn.load(Ag),Bn.load(oT?CS:Xb))}CT.__loaded=!1;const _T=CT;function BT(){BT.__loaded||(BT.__loaded=!0,iv(),Bn.load(Vg),Bn.load(sT))}BT.__loaded=!1;const PT=BT;function RT(){RT.__loaded||(RT.__loaded=!0,nv(),Bn.load(lg),Bn.load(oT?IA:ox))}RT.__loaded=!1;const MT=RT;function kT(){kT.__loaded||(kT.__loaded=!0,rv(),Bn.load(jg),Bn.load(XS))}kT.__loaded=!1;const ET=kT;function OT(){OT.__loaded||(OT.__loaded=!0,sv(),Bn.load(kg),Bn.load(oT?jS:lx))}OT.__loaded=!1;const LT=OT;function IT(){IT.__loaded||(IT.__loaded=!0,lv())}IT.__loaded=!1;const DT=IT;function jT(){jT.__loaded||(jT.__loaded=!0,ov(),Bn.load(fg),Bn.load(oT?eS:fx))}jT.__loaded=!1;const UT=jT;function WT(){WT.__loaded||(WT.__loaded=!0,av(),Bn.load(yg),Bn.load(oT?pS:yx))}WT.__loaded=!1;const NT=WT;function FT(){FT.__loaded||(FT.__loaded=!0,hv())}FT.__loaded=!1;const zT=FT,GT=Rm;Hp(),ff()?Hy(Bn):gf()&&aw(Bn),lT(),cT(),dT(),fT(),vT(),yT(),xT(),AT(),TT(),_T(),PT(),MT(),ET(),LT(),DT(),UT(),NT(),zT(),t.ACustomAnimate=Xr,t.ARC3D_NUMBER_TYPE=Ko,t.ARC_NUMBER_TYPE=qo,t.AREA_NUMBER_TYPE=Zo,t.Animate=qr,t.AnimateGroup=class extends Xr{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Hr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Xr{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Hr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Application=dn,t.Arc=tc,t.Arc3d=ic,t.Arc3dRender=bd,t.ArcRender=yd,t.ArcRenderContribution=Ya,t.Area=Zh,t.AreaRender=xd,t.AreaRenderContribution=Xa,t.AttributeAnimate=class extends Xr{constructor(t,e,i){super({},t,e,i)}getEndProps(){return this.to}onBind(){Object.keys(this.to).forEach((t=>{this.from[t]=this.target.getComputedAttribute(t)}))}onEnd(){}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this.to,this.from)}},t.AutoEnablePlugins=op,t.BaseRender=Ic,t.Basis=di,t.BeforeRenderConstribution=Kd,t.BoundsContext=Se,t.BoundsPicker=tp,t.CIRCLE_NUMBER_TYPE=Jo,t.Canvas3DDrawItemInterceptor=Vd,t.CanvasArc3dPicker=Gm,t.CanvasArcPicker=zm,t.CanvasAreaPicker=Hm,t.CanvasCirclePicker=Vm,t.CanvasFactory=Pn,t.CanvasGlyphPicker=iy,t.CanvasGroupPicker=ny,t.CanvasImagePicker=Ym,t.CanvasLinePicker=Xm,t.CanvasPathPicker=$m,t.CanvasPickerContribution=ry,t.CanvasPolygonPicker=Qm,t.CanvasPyramid3dPicker=ty,t.CanvasRect3dPicker=Km,t.CanvasRectPicker=qm,t.CanvasRichTextPicker=ey,t.CanvasSymbolPicker=Zm,t.CanvasTextLayout=dl,t.CanvasTextPicker=Jm,t.CbAnimate=$r,t.Circle=sl,t.CircleRender=wd,t.CircleRenderContribution=$a,t.ClipAngleAnimate=class extends ys{constructor(t,e,i,n,r){var s,o,a,l,h,c,u,d,p,f,g,v;const m=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},y=null!==(a=m.width)&&void 0!==a?a:0,b=null!==(l=m.height)&&void 0!==l?l:0,x=null!==(h=null==r?void 0:r.animationType)&&void 0!==h?h:"in",w=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,A=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let S=0,T=0;"anticlockwise"===A?(T="in"===x?w+2*Math.PI:w,T=w+2*Math.PI):(S=w,T="out"===x?w+2*Math.PI:w);const C=pn.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:b/2,outerRadius:null!==(v=null==r?void 0:r.radius)&&void 0!==v?v:(y+b)/2,innerRadius:0,startAngle:S,endAngle:T,fill:!0});let _,B;"anticlockwise"===A?(_={startAngle:w+2*Math.PI},B={startAngle:w}):(_={endAngle:w},B={endAngle:w+2*Math.PI}),super("in"===x?_:B,"in"===x?B:_,i,n,{group:null==r?void 0:r.group,clipGraphic:C})}},t.ClipDirectionAnimate=class extends ys{constructor(t,e,i,n,r){var s,o,a,l,h,c,u,d,p;const f=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},g=null!==(l=null!==(a=null==r?void 0:r.width)&&void 0!==a?a:f.width)&&void 0!==l?l:0,v=null!==(c=null!==(h=null==r?void 0:r.height)&&void 0!==h?h:f.height)&&void 0!==c?c:0,m=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",y=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",b=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=pn.graphicService.creator.rect({x:0,y:0,width:"in"===m&&"x"===y?0:g,height:"in"===m&&"y"===y?0:v,fill:!0});let w={},A={};"y"===y?"negative"===b?(w={y:v,height:0},A={y:0,height:v}):(w={height:0},A={height:v}):"negative"===b?(w={x:g,width:0},A={x:0,width:g}):(w={width:0},A={width:g}),super("in"===m?w:A,"in"===m?A:w,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=ys,t.ClipRadiusAnimate=class extends ys{constructor(t,e,i,n,r){var s,o,a,l,h,c,u,d,p,f,g;const v=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},m=null!==(a=v.width)&&void 0!==a?a:0,y=null!==(l=v.height)&&void 0!==l?l:0,b=null!==(h=null==r?void 0:r.animationType)&&void 0!==h?h:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,w=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((m/2)**2+(y/2)**2),A=pn.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:m/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:y/2,outerRadius:"out"===b?w:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),S={outerRadius:x},T={outerRadius:w};super("in"===b?S:T,"in"===b?T:S,i,n,{group:null==r?void 0:r.group,clipGraphic:A})}},t.ColorInterpolate=za,t.ColorStore=Ys,t.CommonRenderContribution=il,t.Container=k,t.ContainerModule=i,t.Context2dFactory=Rn,t.ContributionProvider=E,t.CurveContext=class{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new ni(new Ft(this._lastX,this._lastY),new Ft(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new ei(new Ft(this._lastX,this._lastY),new Ft(t,e),new Ft(i,n),new Ft(r,s));this.path.curves.push(o),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,o,a){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}},t.CustomEvent=Er,t.CustomPath2D=Di,t.CustomSymbolClass=mh,t.DebugDrawItemInterceptorContribution=Gd,t.DefaultArcAllocate=Gf,t.DefaultArcAttribute=Ki,t.DefaultArcRenderContribution=Xc,t.DefaultAreaAllocate=Vf,t.DefaultAreaAttribute=Zi,t.DefaultAreaTextureRenderContribution=yu,t.DefaultAttribute=qi,t.DefaultBaseBackgroundRenderContribution=Gc,t.DefaultBaseTextureRenderContribution=Vc,t.DefaultCanvasAllocate=or,t.DefaultCircleAllocate=Xf,t.DefaultCircleAttribute=Ji,t.DefaultCircleRenderContribution=Zc,t.DefaultConnectAttribute=Xi,t.DefaultDebugAttribute=$i,t.DefaultFillStyle=Fi,t.DefaultGlyphAttribute=tn,t.DefaultGraphicAllocate=Nf,t.DefaultGraphicMemoryManager=ng,t.DefaultGroupAttribute=Qi,t.DefaultGroupBackgroundRenderContribution=eu,t.DefaultImageAttribute=cn,t.DefaultImageBackgroundRenderContribution=cu,t.DefaultImageRenderContribution=uu,t.DefaultLayout=Wi,t.DefaultLineAllocate=qf,t.DefaultLineAttribute=en,t.DefaultMat4Allocate=mc,t.DefaultMatrixAllocate=vc,t.DefaultMorphingAnimateConfig=Qr,t.DefaultPathAllocate=Zf,t.DefaultPathAttribute=nn,t.DefaultPickStyle=Vi,t.DefaultPolygonAttribute=rn,t.DefaultRect3dAttribute=on,t.DefaultRectAllocate=Ff,t.DefaultRectAttribute=sn,t.DefaultRectRenderContribution=ou,t.DefaultRichTextAttribute=hn,t.DefaultRichTextIconAttribute=un,t.DefaultStateAnimateConfig=Jr,t.DefaultStrokeStyle=Gi,t.DefaultStyle=Yi,t.DefaultSymbolAllocate=Qf,t.DefaultSymbolAttribute=an,t.DefaultSymbolRenderContribution=fu,t.DefaultTextAllocate=eg,t.DefaultTextAttribute=ln,t.DefaultTextStyle=Hi,t.DefaultTicker=Gr,t.DefaultTimeline=Vr,t.DefaultTransform=Ni,t.DragNDrop=class{constructor(t){this.onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function o(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!n){e.attribute.pickable=!1;const n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.attribute.pickable=!0,r!==n&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),r=n,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",o);const a=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",o)};e.addEventListener("pointerup",a,{once:!0}),e.addEventListener("pointerupoutside",a,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=Dd,t.DrawItemInterceptor=Wd,t.DynamicLayerHandlerContribution=Ca,t.EnvContribution=U,t.EventManager=Ir,t.EventSystem=Ur,t.EventTarget=Dr,t.FORMAT_ELEMENT_COMMAND="FORMAT_ELEMENT_COMMAND",t.FORMAT_TEXT_COMMAND=Wf,t.FadeInPlus=class extends Xr{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=ms.LEFT_TO_RIGHT,fill:o=!0,stroke:a=!0}=r||{};this.direction=s,this.fill=o,this.stroke=a,this.fillGradient={gradient:"linear",stops:[]},this.strokeGradient={gradient:"linear",stops:[]}}getEndProps(){return{fill:this.toFill,stroke:this.toStroke}}onBind(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}onEnd(){}onUpdate(t,e,i){if(this.toFill&&this.toStroke)switch(this.direction){case ms.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case ms.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case ms.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case ms.STROKE:this.strokePath(t,e,i);break;default:this.leftToRight(t,e,i)}}leftToRight(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,6*e),color:"transparent"}],i.stroke=this.strokeGradient}}strokePath(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=300,n=e*t;i.lineDash=[n,t-n]}}rightToLeft(t,e,i){}topToBottom(t,e,i){}bottomToTop(t,e,i){}},t.FederatedEvent=Pr,t.FederatedMouseEvent=Rr,t.FederatedPointerEvent=Mr,t.FederatedWheelEvent=kr,t.Fragment=cy,t.GLYPH_NUMBER_TYPE=Qo,t.GRAPHIC_UPDATE_TAG_KEY=xo,t.GROUP_NUMBER_TYPE=ta,t.Generator=e,t.Gesture=class extends V{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,n,r,s,o,a,l,h,c,u;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.reset(),this.startTime=Or.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:n,y:r}=e[t],s={x:n,y:r};i[t]=s}if(1!==i.length)this.startDistance=fy(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,n=0,r=0;for(;r<e;)i+=t[r].x,n+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(n/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:o}=n;for(let t=0,e=i.length;t<e;t++)if(o===i[t].pointerId){i[t]=n;break}const a={x:r,y:s},l=i.map((t=>({x:t.x,y:t.y}))),h=Or.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=a,1===e.length){const t=e[0],i=r-t.x,o=s-t.y,h=this.direction||py(t,a);this.direction=h;const c=this.getEventType(a);return n.direction=h,n.deltaX=i,n.deltaY=o,n.points=l,this.triggerStartEvent(c,n),void this.triggerEvent(c,n)}const{startDistance:c}=this,u=fy(l[0],l[1]);n.scale=u/c,n.center=this.center,n.points=l,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const i=Or.now(),r=this.lastMoveTime;if(i-r<100){const t=r-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=fy(i,r),o=s/t;o>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=o,e.direction=py(i,r),this.triggerEvent("swipe",e))}}i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0)}for(let t=0,r=i.length;t<r;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),n.splice(t,1);break}this.reset(),i.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(n=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==n?n:251,threshold:null!==(s=null===(r=null==e?void 0:e.press)||void 0===r?void 0:r.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(a=null===(o=null==e?void 0:e.swipe)||void 0===o?void 0:o.threshold)&&void 0!==a?a:10,velocity:null!==(h=null===(l=null==e?void 0:e.swipe)||void 0===l?void 0:l.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(u=null===(c=null==e?void 0:e.tap)||void 0===c?void 0:c.interval)&&void 0!==u?u:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if(e)return e;let r;return r=Or.now()-i>this.config.press.time&&fy(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,n={type:t,ev:e};for(let e=0,r=i.length;e<r;e++)if(i[e].type===t)return void i.splice(e,1,n);i.push(n)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:n}=this;i||(this.throttleTimer=pn.global.getRequestAnimationFrame()((()=>{for(let t=0,e=n.length;t<e;t++){const{type:e,ev:i}=n[t];this.emitEvent(e,i)}this.throttleTimer=0,this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}},t.GlobalPickerService=ep,t.Glyph=Lh,t.GlyphRender=Od,t.Graphic=_o,t.GraphicAnimate=class extends Xr{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0:r.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=da,t.GraphicPicker=Jd,t.GraphicRender=Ad,t.GraphicService=ua,t.GraphicUtil=Aa,t.Group=ya,t.GroupFadeIn=class extends Xr{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends Xr{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupRender=Sd,t.GroupRenderContribution=qa,t.HtmlAttributePlugin=Qp,t.IMAGE_NUMBER_TYPE=ea,t.Image=Wh,t.ImageRender=Ld,t.ImageRenderContribution=Ka,t.IncreaseCount=class extends Xr{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n,r,s,o,a;this.fromNumber=st(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=st(null===(n=this.to)||void 0===n?void 0:n.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(a=null===(o=this.params)||void 0===o?void 0:o.fixed)&&void 0!==a?a:Math.max(Nt(this.fromNumber),Nt(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}},t.IncrementalDrawContribution=md,t.InputText=class extends Xr{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(n=null===(i=this.to)||void 0===i?void 0:i.text)&&void 0!==n?n:"",!this.toText||nt(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=pn.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,o=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,o);const a=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),l=this.target.clipedWidth+2;a.setAttribute("x",l)}},t.InteractiveDrawItemInterceptorContribution=Hd,t.InteractiveSubRenderContribution=nl,t.LINE_NUMBER_TYPE=ia,t.Layer=xa,t.LayerService=Sa,t.Line=_h,t.LineRender=Td,t.Linear=li,t.LinearClosed=Pi,t.ManualTickHandler=Wr,t.ManualTicker=class extends Gr{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Wr;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}tickAt(t){this.tickerHandler.tick(t-this.lastFrameTime,(t=>{this.handleTick(t,{once:!0})}))}ifCanStop(){return!1}},t.Mat4Allocate=fc,t.MathArcPicker=km,t.MathAreaPicker=Em,t.MathCirclePicker=Om,t.MathGlyphPicker=Fm,t.MathImagePicker=Lm,t.MathLinePicker=Im,t.MathPathPicker=Dm,t.MathPickerContribution=Mm,t.MathPolygonPicker=Nm,t.MathRectPicker=jm,t.MathSymbolPicker=Um,t.MathTextPicker=Wm,t.MatrixAllocate=pc,t.Meteor=class extends Xr{get lastPos(){return this.posList[this.posList.length-1]}constructor(t,e,i,n){super(null,null,e,i,n),this.size=t,this.posList=[]}onBind(){const e=this.target.attachShadow();this.root=e;for(let i=0;i<this.size;i++){const n=this.target.clone(),r=Math.min((this.size-i)/this.size*3,1),s=Math.min(.2+.7/this.size);n.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:s},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(n)}}onUpdate(t,e,i){if(t)return this.target.detachShadow(),void(this.posList.length=0);const n=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),s=new Ft(n,r);this.posList.length?(this.target.shadowRoot.forEachChildren(((t,e)=>{const i=this.posList[Math.max(this.posList.length-e-1,0)];t.setAttributes({x:i.x-n,y:i.y-r},!1)})),this.posList.push(s)):this.posList.push(s)}},t.MonotoneX=bi,t.MonotoneY=xi,t.MorphingPath=lo,t.MotionPath=class extends Xr{constructor(t,e,i,n,r){var s;super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=null!==(s=r.initAngle)&&void 0!==s?s:0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=co,t.NOWORK_ANIMATE_ATTR=Co,t.Node=Br,t.PATH_NUMBER_TYPE=na,t.POLYGON_NUMBER_TYPE=ra,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=sa,t.Path=$h,t.PathRender=Cd,t.PathRenderContribution=Za,t.PickItemInterceptor=np,t.PickerService=Qd,t.PluginService=ap,t.Polygon=sc,t.PolygonRender=_d,t.PolygonRenderContribution=Ja,t.Pyramid3d=ac,t.Pyramid3dRender=Ed,t.RAFTickHandler=Fr,t.REACT_TO_CANOPUS_EVENTS=sy,t.REACT_TO_CANOPUS_EVENTS_LIST=oy,t.RECT3D_NUMBER_TYPE=aa,t.RECT_NUMBER_TYPE=oa,t.RICHTEXT_NUMBER_TYPE=la,t.RafBasedSTO=fs,t.ReactAttributePlugin=vf,t.Rect=Rh,t.Rect3DRender=Pd,t.Rect3d=Eh,t.RectRender=Bd,t.RectRenderContribution=Qa,t.ReflectSegContext=si,t.RenderSelector=Id,t.RenderService=qd,t.ResourceLoader=vo,t.RichText=Vh,t.RichTextEditPlugin=class{constructor(){this.name="RichTextEditPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.editing=!1,this.pointerDown=!1,this.handleInput=(t,e,i,n,r)=>{const s=this.getPointByColumnIdx(i,n,r);this.hideSelection(),this.setCursor(s.x,s.y1,s.y2),this.updateCbs.forEach((t=>t("input",this)))},this.handleChange=(t,e,i,n,r)=>{const s=this.getPointByColumnIdx(i,n,r);this.curCursorIdx=i,this.selectionStartCursorIdx=i,this.setCursorAndTextArea(s.x,s.y1,s.y2,n),this.hideSelection(),this.updateCbs.forEach((t=>t("change",this)))},this.handleMove=t=>{this.isRichtext(t)&&(this.currRt=t.target,this.handleEnter(t),t.target.once("pointerleave",this.handleLeave),this.showSelection(t))},this.handlePointerDown=t=>{this.editing?this.onFocus(t):this.deFocus(t),this.applyUpdate(),this.pointerDown=!0,this.updateCbs.forEach((t=>t(this.editing?"onfocus":"defocus",this)))},this.handlePointerUp=t=>{this.pointerDown=!1},this.handleEnter=t=>{this.editing=!0,this.pluginService.stage.setCursor("text")},this.handleLeave=t=>{this.editing=!1,this.pluginService.stage.setCursor("default")},this.commandCbs=new Map,this.commandCbs.set(Wf,[this.formatTextCommandCb]),this.updateCbs=[]}getSelection(){return this.selectionStartCursorIdx&&this.curCursorIdx&&this.selectionStartCursorIdx!==this.curCursorIdx&&this.currRt?new Uf(this.selectionStartCursorIdx,this.curCursorIdx,Df(this.currRt.attribute.textConfig,this.selectionStartCursorIdx),Df(this.currRt.attribute.textConfig,this.curCursorIdx),this.currRt):null}formatTextCommandCb(t,e){const i=e.currRt;if(!i)return;const n=e.getSelection();if(!n)return;const{selectionStartCursorIdx:r,curCursorIdx:s}=n,o=i.attribute.textConfig.slice(r+1,s+1);"bold"===t?o.forEach((t=>t.fontWeight="bold")):"italic"===t?o.forEach((t=>t.fontStyle="italic")):"underline"===t?o.forEach((t=>t.underline=!0)):"lineThrough"===t?o.forEach((t=>t.lineThrough=!0)):Z(t)&&o.forEach((e=>function(t){let e=-1;const i=arguments.length<=1?0:arguments.length-1;for(;++e<i;)ut(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}(e,t))),i.setAttributes(i.attribute)}dispatchCommand(t,e){const i=this.commandCbs.get(t);i&&i.forEach((t=>t(e,this))),this.updateCbs.forEach((t=>t("dispatch",this)))}registerCommand(t,e){(this.commandCbs.get(t)||[]).push(e)}registerUpdateListener(t){(this.updateCbs||[]).push(t)}activate(t){this.pluginService=t,this.editModule=new jf,t.stage.on("pointermove",this.handleMove),t.stage.on("pointerdown",this.handlePointerDown),t.stage.on("pointerup",this.handlePointerUp),t.stage.on("pointerleave",this.handlePointerUp),this.editModule.onInput(this.handleInput),this.editModule.onChange(this.handleChange)}showSelection(t){const e=t.target.getFrameCache();if(e&&this.editBg&&this.pointerDown){let i=this.lastPoint,n=this.getEventPosition(t),r=this.getLineByPoint(e,n);const s=this.getColumnByLinePoint(r,n),o=r.top,a=r.top+r.height;let l=s.left+s.width,h=this.getColumnIndex(e,s);n.x<s.left+s.width/2&&(l=s.left,h-=1),n.x=l,n.y=(o+a)/2;let c=this.getLineByPoint(e,i);if((i.y>n.y||i.y===n.y&&i.x>n.x)&&([i,n]=[n,i],[r,c]=[c,r]),this.editBg.removeAllChild(),c===r){const t=this.getColumnByLinePoint(c,i);this.editBg.setAttributes({x:i.x,y:c.top,width:n.x-i.x,height:t.height,fill:"#336df4",fillOpacity:.2})}else{this.editBg.setAttributes({x:0,y:c.top,width:0,height:0});const t=e.lines.findIndex((t=>t===c)),s=e.lines.findIndex((t=>t===r));let o=0;for(let r=t;r<=s;r++){const a=e.lines[r];if(r===t){const t=a.paragraphs[a.paragraphs.length-1];this.editBg.add(Mh({x:i.x,y:o,width:t.left+t.width-i.x,height:a.height,fill:"#336df4",fillOpacity:.2}))}else if(r===s){const t=a.paragraphs[0];this.editBg.add(Mh({x:t.left,y:o,width:n.x-t.left,height:a.height,fill:"#336df4",fillOpacity:.2}))}else{const t=a.paragraphs[0],e=a.paragraphs[a.paragraphs.length-1];this.editBg.add(Mh({x:t.left,y:o,width:e.left+e.width-t.left,height:a.height,fill:"#336df4",fillOpacity:.2}))}o+=a.height}}this.curCursorIdx=h,this.setCursorAndTextArea(l,o+2,a-2,t.target),this.applyUpdate(),this.updateCbs.forEach((t=>t("selection",this)))}}hideSelection(){this.editBg&&(this.editBg.removeAllChild(),this.editBg.setAttributes({fill:"transparent"}))}isRichtext(t){return!(!t.target||"richtext"!==t.target.type||!t.target.attribute.editable)}getEventPosition(t){const e=this.pluginService.stage.eventPointTransform(t),i={x:0,y:0};return t.target.globalTransMatrix.transformPoint(e,i),i}getLineByPoint(t,e){let i=t.lines[0];for(let n=0;n<t.lines.length&&!(i.top<=e.y&&i.top+i.height>=e.y);n++)i=t.lines[n+1];return i}getColumnByLinePoint(t,e){let i=t.paragraphs[0];for(let n=0;n<t.paragraphs.length&&!(i.left<=e.x&&i.left+i.width>=e.x);n++)i=t.paragraphs[n];return i}onFocus(t){this.deFocus(t);const e=t.target;this.tryUpdateRichtext(e);const i=e.attachShadow();i.setAttributes({shadowRootIdx:-1});const n=e.getFrameCache();if(!n)return;if(!this.editLine){const t=Bh({x:0,y:0,lineWidth:1,stroke:"black"});t.animate().to({opacity:1},10,"linear").wait(700).to({opacity:0},10,"linear").wait(700).loop(1/0),this.editLine=t;const e=ba({x:0,y:0,width:0,height:0});this.editBg=e,i.add(this.editLine),i.add(this.editBg)}const r=this.getEventPosition(t),s=this.getLineByPoint(n,r);if(s){const t=this.getColumnByLinePoint(s,r);if(!t)return;let i=s.top,o=s.top+s.height,a=t.left+t.width;i+=2,o-=2;let l=this.getColumnIndex(n,t);r.x<t.left+t.width/2&&(a=t.left,l-=1),this.lastPoint={x:a,y:(i+o)/2},this.curCursorIdx=l,this.selectionStartCursorIdx=l,this.setCursorAndTextArea(a,i,o,e)}}getPointByColumnIdx(t,e,i){const n=e.getFrameCache(),{lineInfo:r,columnInfo:s}=this.getColumnByIndex(n,t);let o=r.top,a=r.top+r.height;return o+=2,a-=2,{x:s.left+("left"===i?0:s.width),y1:o,y2:a}}getColumnIndex(t,e){let i=-1;for(let n=0;n<t.lines.length;n++){const r=t.lines[n];for(let t=0;t<r.paragraphs.length;t++)if(i++,e===r.paragraphs[t])return i}return-1}getColumnByIndex(t,e){let i=-1;for(let n=0;n<t.lines.length;n++){const r=t.lines[n];for(let t=0;t<r.paragraphs.length;t++){const n=r.paragraphs[t];if(i++,i===e)return{lineInfo:r,columnInfo:n}}}return null}setCursorAndTextArea(t,e,i,n){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]});const r={x:0,y:0};n.globalTransMatrix.getInverse().transformPoint({x:t,y:e},r);const{left:s,top:o}=this.pluginService.stage.window.getBoundingClientRect();r.x+=s,r.y+=o,this.editModule.moveTo(r.x,r.y,n,this.curCursorIdx,this.selectionStartCursorIdx)}setCursor(t,e,i){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]})}applyUpdate(){this.pluginService.stage.renderNextFrame()}deFocus(t){t.target.detachShadow(),this.currRt=null,this.editLine&&(this.editLine.parent.removeChild(this.editLine),this.editLine.release(),this.editLine=null,this.editBg.parent.removeChild(this.editBg),this.editBg.release(),this.editBg=null)}splitText(t){return Array.from(t)}tryUpdateRichtext(t){if(!t.getFrameCache().lines.every((t=>t.paragraphs.every((t=>!(t.text&&it(t.text)&&this.splitText(t.text).length>1)))))){const e=[];t.attribute.textConfig.forEach((t=>{const i=this.splitText(t.text.toString());if(it(t.text)&&i.length>1)for(let n=0;n<i.length;n++){const r=i[n];e.push(Object.assign(Object.assign({},t),{text:r}))}else e.push(t)})),t.setAttributes({textConfig:e}),t.doUpdateFrameCache(e)}}onSelect(){}deactivate(t){t.stage.off("pointermove",this.handleMove),t.stage.off("pointerdown",this.handlePointerDown),t.stage.off("pointerup",this.handlePointerUp),t.stage.off("pointerleave",this.handlePointerUp)}release(){this.editModule.release()}},t.RichTextRender=kd,t.RotateBySphereAnimate=class extends Xr{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),s=Math.acos((n-t.y)/e);let o=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(o=Bt-o),this.theta=o,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r,cb:s}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,a=this.theta+o,l=this.phi,h=r*Math.sin(l)*Math.cos(a)+n.x,c=r*Math.cos(l)+n.y,u=r*Math.sin(l)*Math.sin(a)+n.z;for(i.x=h,i.y=c,i.z=u,i.alpha=a+Tt/2;i.alpha>Bt;)i.alpha-=Bt;i.alpha=Bt-i.alpha,i.zIndex=-1e4*i.z,s&&s(i)}},t.SVG_ATTRIBUTE_MAP=pa,t.SVG_ATTRIBUTE_MAP_KEYS=fa,t.SVG_PARSE_ATTRIBUTE_MAP=ga,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=va,t.SYMBOL_NUMBER_TYPE=ha,t.SegContext=ri,t.ShadowRoot=hc,t.ShadowRootDrawItemInterceptorContribution=zd,t.Stage=yf,t.StaticLayerHandlerContribution=Ta,t.Step=Ci,t.StreamLight=class extends Xr{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}onStartLineOrArea(t){var e;const i=this.target.attachShadow(),n=pn.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=n,n.pathProxy=new Di,i.add(n)}onStartRect(){var t,e,i;const n=this.target.attachShadow(),r=null===(e=null===(t=this.params)||void 0===t?void 0:t.isHorizontal)||void 0===e||e,s=r?"height":"width",o=r?"width":"height",a=this.target.AABBBounds[s](),l=r?0:this.target.AABBBounds.y1,h=pn.graphicService.creator.rect(Object.assign(Object.assign({[s]:a,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(i=this.params)||void 0===i?void 0:i.attribute),{x:0,y:l,[o]:0}));this.rect=h,n.add(h)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){return this.rect?this.onUpdateRect(t,e,i):this.line||this.area?this.onUpdateLineOrArea(t,e,i):void 0}onUpdateRect(e,i,n){var r,s,o,a,l,h,c,u,d,p,f,g,v,m,y,b;const x=null===(s=null===(r=this.params)||void 0===r?void 0:r.isHorizontal)||void 0===s||s,w=this.target.attribute;if(x){const n=null!==(a=null!==(o=w.width)&&void 0!==o?o:Math.abs(w.x1-w.x))&&void 0!==a?a:250,r=null!==(h=null===(l=this.params)||void 0===l?void 0:l.streamLength)&&void 0!==h?h:n,s=null!==(d=null===(u=null===(c=this.params)||void 0===c?void 0:c.attribute)||void 0===u?void 0:u.width)&&void 0!==d?d:60,p=-s,f=p+(r-p)*i,g=Math.max(f,0),v=Math.min(Math.min(f+s,s),r-f),m=v+g>n?Math.max(n-g,0):v;this.rect.setAttributes({x:g,width:m,dx:Math.min(w.x1-w.x,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}else{const n=null!==(f=null!==(p=w.height)&&void 0!==p?p:Math.abs(w.y1-w.y))&&void 0!==f?f:250,r=null!==(v=null===(g=this.params)||void 0===g?void 0:g.streamLength)&&void 0!==v?v:n,s=null!==(b=null===(y=null===(m=this.params)||void 0===m?void 0:m.attribute)||void 0===y?void 0:y.height)&&void 0!==b?b:60,o=n-(r+s)*i;let a=Math.min(o,n);const l=Math.min(n-o,s);let h;a<=0?(h=Math.max(a+l,0),a=0):h=l,this.rect.setAttributes({y:a,height:h,dy:Math.min(w.y1-w.y,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}}onUpdateLineOrArea(t,e,i){const n=this.line||this.area;if(!n)return;const r=n.pathProxy,s=this.target;s.cache||s.cacheArea?this._onUpdateLineOrAreaWithCache(r,s,t,e,i):this._onUpdateLineWithoutCache(r,s,t,e,i);const o=s.attribute;n.setAttributes(Object.assign({stroke:o.stroke},n.attribute)),n.addUpdateBoundTag()}_onUpdateLineOrAreaWithCache(t,e,i,n,r){if(t.clear(),"line"===e.type){let i=e.cache;Array.isArray(i)||(i=[i]);const r=i.reduce(((t,e)=>t+e.getLength()),0),s=[];return i.forEach((t=>{t.curves.forEach((t=>s.push(t)))})),this._updateCurves(t,s,r,n)}if("area"===e.type){const i=e.cacheArea,r=i.top.curves.reduce(((t,e)=>t+e.getLength()),0);return this._updateCurves(t,i.top.curves,r,n)}}_updateCurves(t,e,i,n){var r,s;const o=i*n,a=Math.min(null!==(s=o+(null===(r=this.params)||void 0===r?void 0:r.streamLength))&&void 0!==s?s:10,i);let l=0,h=!1;for(let i=0;i<e.length;i++){const n=e[i],r=n.getLength(),s=1-(l+r-o)/r;let c,u=1-(l+r-a)/r;if(l<o&&l+r>o)if(h=!0,n.p2&&n.p3){const[e,i]=ti(n,s);t.moveTo(i.p0.x,i.p0.y),c=i}else{const e=n.getPointAt(s);t.moveTo(e.x,e.y)}if(l<a&&l+r>a){if(n.p2&&n.p3){c&&(u=(a-o)/c.getLength());const[e]=ti(c||n,u);t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else{const e=n.getPointAt(u);t.lineTo(e.x,e.y)}break}if(h)if(n.p2&&n.p3){const e=c||n;t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else t.lineTo(n.p1.x,n.p1.y);l+=r}}_onUpdateLineWithoutCache(t,e,i,n,r){var s,o;const{points:a,curveType:l}=e.attribute;if(!a||a.length<2||"linear"!==l)return;let h=0;for(let t=1;t<a.length;t++)h+=zt.distancePP(a[t],a[t-1]);const c=h*n,u=Math.min(null!==(o=c+(null===(s=this.params)||void 0===s?void 0:s.streamLength))&&void 0!==o?o:10,h),d=[];let p=0;for(let t=1;t<a.length;t++){const e=zt.distancePP(a[t],a[t-1]);if(p<c&&p+e>c&&d.push(zt.pointAtPP(a[t-1],a[t],1-(p+e-c)/e)),p<u&&p+e>u){d.push(zt.pointAtPP(a[t-1],a[t],1-(p+e-u)/e));break}d.length&&d.push(a[t]),p+=e}if(d.length&&!(d.length<2)){t.clear(),t.moveTo(d[0].x,d[0].y);for(let e=1;e<d.length;e++)t.lineTo(d[e].x,d[e].y)}}},t.SubAnimate=Kr,t.Symbol=Sh,t.SymbolRender=Rd,t.SymbolRenderContribution=tl,t.TEXT_NUMBER_TYPE=ca,t.TagPointsUpdate=class extends Xr{constructor(t,e,i,n,r){var s,o;super(t,e,i,n,r),this.newPointAnimateType=null!==(s=null==r?void 0:r.newPointAnimateType)&&void 0!==s?s:"grow",this.clipRangeByDimension=null!==(o=null==r?void 0:r.clipRangeByDimension)&&void 0!==o?o:"x"}onBind(){var t,e;const i=null===(t=this.from)||void 0===t?void 0:t.points,n=null===(e=this.to)||void 0===e?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=n?Array.isArray(n)?n:[n]:[];const r=new Map;this.fromPoints.forEach((t=>{t.context&&r.set(t.context,t)}));let s,o,a=1/0,l=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(r.has(this.toPoints[t].context)){a=t,s=r.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(r.has(this.toPoints[t].context)){l=t,o=r.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(l)?(this.clipRange=this.toPoints[l][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],ot(this.clipRange)?this.clipRange=At(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let h=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=r.get(t.context);return i?(h=i,[i,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:e<a&&s?[s,t]:e>l&&o?[o,t]:[h,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new Ft(e.x,e.y,e.x1,e.y1);return n.defined=i.defined,n.context=i.context,n}))}onUpdate(t,e,i){this.points=this.points.map(((t,i)=>{const n=hs(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),this.clipRange&&(i.clipRange=this.clipRange+(1-this.clipRange)*e),i.points=this.points}},t.Text=fl,t.TextMeasureContribution=_n,t.TextRender=Md,t.TextRenderContribution=el,t.Theme=Ar,t.TimeOutTickHandler=Nr,t.TransformUtil=wa,t.VArc=function(t){return Mc.arc(t?t.attribute:{})},t.VArc3d=function(t){return Mc.arc3d(t?t.attribute:{})},t.VArea=function(t){return Mc.area(t?t.attribute:{})},t.VCircle=function(t){return Mc.circle(t?t.attribute:{})},t.VGlobal=W,t.VGlyph=function(t){return Mc.glyph(t?t.attribute:{})},t.VGroup=function(t){return Mc.group(t?t.attribute:{})},t.VImage=function(t){return Mc.image(t?t.attribute:{})},t.VLine=function(t){return Mc.line(t?t.attribute:{})},t.VPath=function(t){return Mc.path(t?t.attribute:{})},t.VPolygon=function(t){return Mc.polygon(t?t.attribute:{})},t.VPyramid3d=function(t){return Mc.pyramid3d(t?t.attribute:{})},t.VRect=function(t){return Mc.rect(t?t.attribute:{})},t.VRect3d=function(t){return Mc.rect3d(t?t.attribute:{})},t.VRichText=ay,t.VSymbol=function(t){return Mc.symbol(t?t.attribute:{})},t.VText=function(t){return Mc.text(t?t.attribute:{})},t.VWindow=cr,t.VirtualLayerHandlerContribution=_a,t.WILDCARD="*",t.WindowHandlerContribution=ur,t.WrapText=ml,t.XMLParser=Do,t._interpolateColor=qs,t._registerArc=aT,t.addArcToBezierPath=Ye,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=_s,t.alignSubpath=xs,t.application=pn,t.applyTransformOnBezierCurves=Rs,t.arc3dCanvasPickModule=QS,t.arc3dModule=Fg,t.arcCanvasPickModule=PA,t.arcMathPickModule=pb,t.arcModule=og,t.areaCanvasPickModule=qA,t.areaMathPickModule=bb,t.areaModule=dg,t.bezier=He,t.bezierCurversToPath=Ms,t.binarySplitPolygon=Fs,t.bindContributionProvider=L,t.bindContributionProviderNoSingletonScope=I,t.boundStroke=No,t.browserEnvModule=Gy,t.builtInSymbolStrMap=xh,t.builtinSymbols=yh,t.builtinSymbolsMap=bh,t.calcLineCache=Ii,t.calculateLineHeight=vs,t.canvasAllocate=ar,t.centroidOfSubpath=Ss,t.circleBounds=as,t.circleCanvasPickModule=aS,t.circleMathPickModule=Cb,t.circleModule=vg,t.clock=Or,t.cloneGraphic=fo,t.colorEqual=function(t,e){const i=se.parseColorString(t),n=se.parseColorString(e);return!(!i||!n)&&i.r===n.r&&i.g===n.g&&i.b===n.b&&i.opacity===n.opacity},t.colorStringInterpolationToStr=io,t.container=Bn,t.cornerTangents=Wa,t.createArc=ec,t.createArc3d=nc,t.createArea=Jh,t.createCircle=ol,t.createColor=Wc,t.createConicalGradient=Va,t.createGlyph=Ih,t.createGroup=ba,t.createImage=Nh,t.createImageElement=zy,t.createLine=Bh,t.createMat4=gc,t.createPath=qh,t.createPolygon=oc,t.createPyramid3d=lc,t.createRect=Mh,t.createRect3d=Oh,t.createRectPath=ru,t.createRichText=Yh,t.createShadowRoot=cc,t.createStage=function(t){return new yf(t)},t.createSymbol=Th,t.createText=gl,t.createWrapText=yl,t.cubicCalc=Je,t.cubicLength=Ze,t.cubicPointAt=Qe,t.cubicSubdivide=bs,t.decodeReactDom=uy,t.defaultArcAllocate=Hf,t.defaultArcBackgroundRenderContribution=Kc,t.defaultArcRenderContribution=$c,t.defaultArcTextureRenderContribution=qc,t.defaultAreaAllocate=Yf,t.defaultBaseBackgroundRenderContribution=Hc,t.defaultBaseTextureRenderContribution=Yc,t.defaultCircleAllocate=$f,t.defaultCircleBackgroundRenderContribution=tu,t.defaultCircleRenderContribution=Jc,t.defaultCircleTextureRenderContribution=Qc,t.defaultGraphicMemoryManager=rg,t.defaultGroupBackgroundRenderContribution=iu,t.defaultImageBackgroundRenderContribution=pu,t.defaultImageRenderContribution=du,t.defaultLineAllocate=Kf,t.defaultPathAllocate=Jf,t.defaultRectAllocate=zf,t.defaultRectBackgroundRenderContribution=hu,t.defaultRectRenderContribution=au,t.defaultRectTextureRenderContribution=lu,t.defaultSymbolAllocate=tg,t.defaultSymbolBackgroundRenderContribution=mu,t.defaultSymbolRenderContribution=gu,t.defaultSymbolTextureRenderContribution=vu,t.defaultTextAllocate=ig,t.defaultTicker=sf,t.defaultTimeline=Yr,t.drawArc=Ve,t.drawArcPath=Na,t.drawAreaSegments=Mu,t.drawIncrementalAreaSegments=Pu,t.drawIncrementalSegments=Bu,t.drawPathProxy=ja,t.drawSegments=_u,t.enumCommandMap=Be,t.feishuEnvModule=Bx,t.fillVisible=Oa,t.findBestMorphingRotation=Cs,t.findNextGraphic=Pp,t.flatten_simplify=function(t,e,i){if(t.length<=10)return t;const n=void 0!==e?e*e:1;return If(t=i?t:function(t,e){let i,n,r=t[0].x,s=t[0].y;const o=[t[0]];for(let a=1,l=t.length;a<l;a++)i=t[a].x-r,n=t[a].y-s,i*i+n*n>e&&(r=t[a].x,s=t[a].y,o.push(t[a]));return t[t.length-1].x===r&&t[t.length-1].y===s||o.push(t[t.length-1]),o}(t,n),n)},t.foreach=_p,t.foreachAsync=Bp,t.genBasisSegments=fi,t.genBasisTypeSegments=pi,t.genLinearClosedSegments=Ri,t.genLinearClosedTypeSegments=Mi,t.genLinearSegments=hi,t.genLinearTypeSegments=ci,t.genMonotoneXSegments=Ai,t.genMonotoneXTypeSegments=wi,t.genMonotoneYSegments=Ti,t.genMonotoneYTypeSegments=Si,t.genNumberType=zo,t.genStepSegments=_i,t.genStepTypeSegments=Bi,t.getAttributeFromDefaultAttrList=ps,t.getConicGradientAt=Ha,t.getContextFont=al,t.getCurrentEnv=function(){return ff()?"browser":"node"},t.getExtraModelMatrix=function(t,e,i){const{alpha:n,beta:r}=i.attribute;if(!n&&!r)return null;const{anchor3d:s=i.attribute.anchor}=i.attribute,o=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.AABBBounds;o[0]=e.x1+(e.x2-e.x1)*t}else o[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=i.AABBBounds;o[1]=e.x1+(e.x2-e.x1)*t}else o[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;o[0]+=hl(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=bc.allocate();return Cc(a,a,[o[0],o[1],0]),r&&Sc(a,a,r),n&&Tc(a,a,n),Cc(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=Pc,t.getRichTextBounds=function(t){return Ec||(Ec=Mc.CreateGraphic("richtext",{})),Ec.setAttributes(t),Ec.AABBBounds},t.getScaledStroke=Uc,t.getTextBounds=Oc,t.getTheme=Tr,t.getThemeFromGroup=Cr,t.globalTheme=Sr,t.glyphCanvasPickModule=kS,t.glyphMathPickModule=kb,t.glyphModule=_g,t.graphicCreator=Mc,t.graphicService=$p,t.graphicUtil=Yp,t.harmonyEnvModule=wA,t.imageCanvasPickModule=FS,t.imageMathPickModule=Ib,t.imageModule=Og,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.initAllEnv=function(){Fw(Bn)},t.initBrowserEnv=function(){Hy(Bn)},t.initFeishuEnv=function(){Px(Bn)},t.initHarmonyEnv=function(){AA(Bn)},t.initLynxEnv=function(){Vx(Bn)},t.initNodeEnv=function(){aw(Bn)},t.initTTEnv=function(){sA(Bn)},t.initTaroEnv=function(){Sw(Bn)},t.initWxEnv=function(){Nw(Bn)},t.inject=p,t.injectable=g,t.interpolateColor=$s,t.interpolateGradientConicalColor=Js,t.interpolateGradientLinearColor=Ks,t.interpolateGradientRadialColor=Zs,t.interpolatePureColorArray=Qs,t.intersect=Ua,t.isBrowserEnv=ff,t.isNodeEnv=gf,t.isSvg=jo,t.isTransformKey=ds,t.isXML=Uo,t.jsx=function(t,e){const i=e||{},{key:n,name:r,id:s,attribute:o,stateProxy:a}=i,l=ly(i,["key","name","id","attribute","stateProxy"]);let h=t;it(t)&&(h=Mc[t]);const c=[];for(var u=arguments.length,d=new Array(u>2?u-2:0),p=2;p<u;p++)d[p-2]=arguments[p];d.length&&hy(1===d.length?d[0]:d,c);const f="Group"===h.name?new h(o):h(e);return function(t,e,i){let n,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":n=t.attribute||{},e[0]&&(n.text=e[0]);break;default:r=!0}r?(e.forEach((e=>{e&&t.add(e)})),Object.keys(i).forEach((e=>{const n=sy[e];n&&t.on(n,i[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((t=>t.attribute)).filter((t=>t)))}(f,c,l),a&&(f.stateProxy=a),f},t.layerService=qp,t.lineCanvasPickModule=GA,t.lineMathPickModule=Fb,t.lineModule=cg,t.loadAllEnv=Fw,t.loadAllModule=zw,t.loadBrowserEnv=Hy,t.loadFeishuEnv=Px,t.loadHarmonyEnv=AA,t.loadLynxEnv=Vx,t.loadNodeEnv=aw,t.loadTTEnv=sA,t.loadTaroEnv=Sw,t.loadWxEnv=Nw,t.lookAt=af,t.lynxEnvModule=Hx,t.mat3Tomat4=_c,t.mat4Allocate=bc,t.matrixAllocate=yc,t.morphPath=ho,t.multiInject=f,t.multiToOneMorph=(e,i,n)=>{var r,s,o;const a=e.filter((t=>t.toCustomPath&&t.valid));a.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const l=("clone"===(null==n?void 0:n.splitPath)?fo:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:go)(i,a.length,!0),h=i.attribute;i.setAttribute("visible",!1);const c=a.map(((t,e)=>so(t.toCustomPath(),l[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:l[e].globalTransMatrix}))),u=a.map(((t,e)=>ao(t.attribute,h)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=a.length;const o=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};l.forEach(((t,i)=>{var r,s,l;const h=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,a.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:o}));d.wait(h),d.play(new lo({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:Qr.duration,null!==(l=n.easing)&&void 0!==l?l:Qr.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const a=i.animate(r);(null==n?void 0:n.delay)&&a.wait(n.delay),a.play(new co({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:Qr.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:Qr.easing))}},t.multiply=hf,t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i.a,x=i.b,w=0,A=0;return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*l+w*d+A*v,t[2]=b*s+x*h+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i.c,x=i.d,w=0,A=0,t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*l+w*d+A*v,t[6]=b*s+x*h+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=0,x=0,w=1,A=0,t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*l+w*d+A*v,t[10]=b*s+x*h+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i.e,x=i.f,w=0,A=1,t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*l+w*d+A*v,t[14]=b*s+x*h+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t},t.multiplyMat4Mat4=Bc,t.named=v,t.newThemeObj=br,t.nodeEnvModule=ow,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?fo:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:go)(t,r.length,!1),o=null==i?void 0:i.onEnd;let a=r.length;const l=()=>{a--,0===a&&o&&o()};r.forEach(((e,n)=>{var o;const a=s[n],h=(null!==(o=null==i?void 0:i.delay)&&void 0!==o?o:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,a,e):0);ho(a,e,Object.assign({},i,{onEnd:l,delay:h}),t.globalTransMatrix)}))},t.ortho=lf,t.parsePadding=rs,t.parseStroke=is,t.parseSvgPath=Le,t.pathCanvasPickModule=bS,t.pathMathPickModule=Qb,t.pathModule=xg,t.pathToBezierCurves=Ps,t.point=ui,t.pointEqual=ls,t.pointInterpolation=hs,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=Ut(t.x,t.y,e.x,e.y,i),{x:o,y:a}=Ut(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=o,n.y1=a,n.defined=e.defined,n},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every(((t,i)=>ls(t,e[i]))):!Number.isNaN(t.x+t.y)&&ls(t,e))},t.pointsInterpolation=cs,t.polygonCanvasPickModule=CS,t.polygonMathPickModule=Xb,t.polygonModule=Ag,t.preLoadAllModule=Hp,t.pyramid3dCanvasPickModule=sT,t.pyramid3dModule=Vg,t.rafBasedSto=gs,t.rect3dCanvasPickModule=XS,t.rect3dModule=jg,t.rectCanvasPickModule=IA,t.rectFillVisible=La,t.rectMathPickModule=ox,t.rectModule=lg,t.rectStrokeVisible=Da,t.recursiveCallBinarySplit=zs,t.registerArc=lT,t.registerArc3d=cT,t.registerArc3dGraphic=Xg,t.registerArcGraphic=Yg,t.registerArea=dT,t.registerAreaGraphic=$g,t.registerCircle=fT,t.registerCircleGraphic=qg,t.registerGlyph=vT,t.registerGlyphGraphic=Kg,t.registerGroup=yT,t.registerGroupGraphic=Zg,t.registerImage=xT,t.registerImageGraphic=Jg,t.registerLine=AT,t.registerLineGraphic=Qg,t.registerPath=TT,t.registerPathGraphic=tv,t.registerPolygon=_T,t.registerPolygonGraphic=ev,t.registerPyramid3d=PT,t.registerPyramid3dGraphic=iv,t.registerRect=MT,t.registerRect3d=ET,t.registerRect3dGraphic=rv,t.registerRectGraphic=nv,t.registerRichtext=LT,t.registerRichtextGraphic=sv,t.registerShadowRoot=DT,t.registerShadowRootGraphic=lv,t.registerSymbol=UT,t.registerSymbolGraphic=ov,t.registerText=NT,t.registerTextGraphic=av,t.registerWrapText=zT,t.registerWrapTextGraphic=hv,t.renderCommandList=$e,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.richTextMathPickModule=lx,t.richtextCanvasPickModule=jS,t.richtextModule=kg,t.rotateX=Sc,t.rotateY=Tc,t.roughModule=GT,t.runFill=ka,t.runStroke=Ea,t.segments=Ge,t.shouldUseMat4=Rc,t.snapLength=Ke,t.splitArc=Ls,t.splitArea=js,t.splitCircle=Is,t.splitGraphic=go,t.splitLine=Us,t.splitPath=Hs,t.splitPolygon=Gs,t.splitRect=Os,t.splitToGrids=Es,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=Ia,t.symbolCanvasPickModule=eS,t.symbolMathPickModule=fx,t.symbolModule=fg,t.taroEnvModule=Aw,t.textAttributesToStyle=ul,t.textCanvasPickModule=pS,t.textDrawOffsetX=hl,t.textDrawOffsetY=ll,t.textLayoutOffsetY=cl,t.textMathPickModule=yx,t.textModule=yg,t.transformKeys=us,t.transformMat4=cf,t.transformUtil=Xp,t.translate=Cc,t.ttEnvModule=rA,t.version="0.19.24-alpha.7",t.verticalLayout=Ho,t.vglobal=Vp,t.waitForAllSubLayers=function(t){return Wo(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{pn.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)}))},t.wrapCanvas=Mn,t.wrapContext=function(t,e){return Bn.getNamed(Rn,pn.global.env)(t,e)},t.wxEnvModule=Ww,t.xul=function(t){const e=nt(t)?t[0]:t,i=[];if(!e)return i;if(!0===Uo(e)){const t=(new Do).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};$o(t,e);const i=t["#text"];return i&&(e.text=i),e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};$o(t,e);const i=e.image;return i&&(e.image=i.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">")),e}(t.tc[e]))}))}return i}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VRender={})}(this,(function(t){"use strict";class e{static GenAutoIncrementId(){return e.auto_increment_id++}}e.auto_increment_id=0;class i{constructor(t){this.id=e.GenAutoIncrementId(),this.registry=t}}const n="named",r="inject",s="multi_inject",o="inversify:tagged",a="inversify:paramtypes";class l{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===n?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var h=function(t){var e;return function(t){const e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,n=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,o={__proto__:[]}instanceof Array,a=!s&&!o,l={create:s?function(){return T(Object.create(null))}:o?function(){return T({__proto__:null})}:function(){return T({})},has:a?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:a?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,u=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){const t={},e=[],i=function(){function t(t,e,i){this._index=0,this._keys=t,this._values=e,this._selector=i}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){const t=this._index;if(t>=0&&t<this._keys.length){const i=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(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){const e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){const i=this._find(t,!0);return this._values[i]=e,this},e.prototype.delete=function(e){const i=this._find(e,!1);if(i>=0){const n=this._keys.length;for(let t=i+1;t<n;t++)this._keys[t-1]=this._keys[t],this._values[t-1]=this._values[t];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 i(this._keys,this._values,n)},e.prototype.values=function(){return new i(this._keys,this._values,s)},e.prototype.entries=function(){return new i(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function s(t,e){return e}function o(t,e){return[t,e]}}():Map,d=(c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new u}Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()}}():Set,new(c||"function"!=typeof WeakMap?function(){const t=16,i=l.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){const e=s(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){const e=s(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return s(t,!0)[this._key]=e,this},t.prototype.delete=function(t){const e=s(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){let t;do{t="@@WeakMap@@"+a()}while(l.has(i,t));return i[t]=!0,t}function s(t,i){if(!e.call(t,n)){if(!i)return;Object.defineProperty(t,n,{value:l.create()})}return t[n]}function o(t,e){for(let i=0;i<e;++i)t[i]=255*Math.random()|0;return t}function a(){const e=(i=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(i)):o(new Uint8Array(i),i):o(new Array(i),i));var i;e[6]=79&e[6]|64,e[8]=191&e[8]|128;let n="";for(let i=0;i<t;++i){const t=e[i];4!==i&&6!==i&&8!==i||(n+="-"),t<16&&(n+="0"),n+=t.toString(16).toLowerCase()}return n}}():WeakMap));function p(t,e,i){let n=d.get(t);if(m(n)){if(!i)return;n=new u,d.set(t,n)}let r=n.get(e);if(m(r)){if(!i)return;r=new u,n.set(e,r)}return r}function f(t,e,i){if(g(t,e,i))return!0;const n=S(e);return!y(n)&&f(t,n,i)}function g(t,e,i){const n=p(e,i,!1);return!m(n)&&!!n.has(t)}function v(t,e,i){if(g(t,e,i))return function(t,e,i){const n=p(e,i,!1);if(!m(n))return n.get(t)}(t,e,i);const n=S(e);return y(n)?void 0:v(t,n,i)}function m(t){return void 0===t}function y(t){return null===t}function b(t){return"object"==typeof t?null!==t:"function"==typeof t}function x(t,e){switch(function(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}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const i=3===e?"string":5===e?"number":"default",r=function(t,e){const i=t[e];if(null!=i){if(!A(i))throw new TypeError;return i}}(t,n);if(void 0!==r){const e=r.call(t,i);if(b(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(A(e)){const i=e.call(t);if(!b(i))return i}const i=t.valueOf;if(A(i)){const e=i.call(t);if(!b(e))return e}}else{const e=t.valueOf;if(A(e)){const i=e.call(t);if(!b(i))return i}const i=t.toString;if(A(i)){const e=i.call(t);if(!b(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function w(t){const e=x(t,3);return function(t){return"symbol"==typeof t}(e)?e:function(t){return""+t}(e)}function A(t){return"function"==typeof t}function S(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;const i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}function T(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,i,n){if(!b(i))throw new TypeError;return function(t,e,i,n){p(i,n,!0).set(t,e)}(t,e,i,n)})),t("hasMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),f(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),g(t,e,i)})),t("getMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),v(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function c(t,e,i,n){!function(t,e,i,n){const r=[n];let s={};h.hasOwnMetadata(t,e)&&(s=h.getMetadata(t,e));let o=s[i];void 0===o&&(o=[]),o.push(...r),s[i]=o,h.defineMetadata(t,s,e)}(o,t,i.toString(),n)}function u(t){return(e,i,n)=>{c(e,0,n,t)}}function d(t){return e=>(i,n,r)=>u(new l(t,e))(i,n,r)}const p=d(r),f=d(s);function g(){return function(t){return h.defineMetadata(a,null,t),t}}function v(t){return u(new l(n,t))}const m="Singleton",y="Transient",b="ConstantValue",x="DynamicValue",w="Factory",A="Function",S="Instance",T="Invalid";class C{constructor(t,i){this.id=e.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=i,this.type=T,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new C(this.serviceIdentifier,this.scope);return t.activated=t.scope===m&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class _{getConstructorMetadata(t){return{compilerGeneratedMetadata:h.getMetadata(a,t),userGeneratedMetadata:h.getMetadata(o,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const B=(P=n,t=>{const e=e=>{if(null==e)return!1;if(e.key===P&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===P&&i[e].value===t)return!0;return!1};return e.metaData=new l(P,t),e});var P;class R{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=m,this}inTransientScope(){return this._binding.scope=y,this}whenTargetNamed(t){return this._binding.constraint=B(t),this}}class M{constructor(t){this._binding=t}to(t){return this._binding.type=S,this._binding.implementationType=t,new R(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=x,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new R(this._binding)}toConstantValue(t){return this._binding.type=b,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=m,new R(this._binding)}toFactory(t){return this._binding.type=w,this._binding.factory=t,this._binding.scope=m,new R(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}class k{constructor(t){const i=t||{};i.defaultScope=i.defaultScope||y,this.options=i,this.id=e.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new _}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,n,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new C(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new M(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),r=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:r(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),o=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const a={inject:n[r],multiInject:n[s]},l=a.inject||a.multiInject,h={serviceIdentifier:l,constructorArgsMetadata:e},c={injectIdentifier:l,metadata:e,bindings:this._bindingDictionary.get(l).filter((t=>t.constraint(h)))};o.push(c)}return o}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case b:case A:e=t.cache;break;case S:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===m&&(t.cache=e,t.activated=!0)}}const E=Symbol("ContributionProvider");class O{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function L(t,e){t(E).toDynamicValue((t=>{let{container:i}=t;return new O(e,i)})).inSingletonScope().whenTargetNamed(e)}function I(t,e){t(E).toDynamicValue((t=>{let{container:i}=t;return new O(e,i)})).whenTargetNamed(e)}class D{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class j extends D{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const U=Symbol.for("EnvContribution"),W=Symbol.for("VGlobal");var N=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},F=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},z=function(t,e){return function(i,n){e(i,n,t)}};function G(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}t.DefaultGlobal=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=e.GenAutoIncrementId(),this.hooks={onSetEnv:new j(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const n=this.bindContribution(e);if(n&&n.then)return n.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=N([g(),z(0,p(E)),z(0,v(U)),F("design:paramtypes",[Object])],t.DefaultGlobal);var H={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,r,s,o){var a=i?i+t:t;if(!this._events[a])return!1;var l,h,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,o),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,n);break;case 4:c[h].fn.call(c[h].context,e,n,r);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},a.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var l=0,h=[],c=a.length;l<c;l++)(a[l].fn!==e||r&&!a[l].once||n&&a[l].context!==n)&&h.push(a[l]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(H);var V=G(H.exports);var Y=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var X=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Y(t,"Boolean")};var $=t=>"function"==typeof t;var q=t=>null==t;var K=t=>null!=t;var Z=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var J=t=>"object"==typeof t&&null!==t;var Q=function(t){if(!J(t)||!Y(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var et=t=>void 0===t;var it=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||Y(t,"String")};var nt=t=>Array.isArray?Array.isArray(t):Y(t,"Array");var rt=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var st=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||Y(t,"Number")};var ot=t=>st(t)&&Number.isFinite(t);var at=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var lt=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const ht=Object.prototype.hasOwnProperty;var ct=(t,e)=>null!=t&&ht.call(t,e);function ut(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(K(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:s}=r,o=-1;for(;s--;){const s=r[++o];K(n[s])&&"object"==typeof n[s]?dt(t,e,s,i):pt(t,s,n[s])}}}}function dt(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=t[i],s=e[i];let o=e[i],a=!0;if(nt(s)){if(n)o=[];else if(nt(r))o=r;else if(rt(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else Q(s)?(o=r,"function"!=typeof r&&"object"==typeof r||(o={})):a=!1;a&&ut(o,s,n),pt(t,i,o)}function pt(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function ft(t,e){if(!nt(t)||!nt(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const gt="undefined"!=typeof console;function vt(t,e,i){const n=[e].concat([].slice.call(i));gt&&console[t].apply(console,n)}var mt;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(mt||(mt={}));class yt{static getInstance(t,e){return yt._instance&&st(t)?yt._instance.level(t):yt._instance||(yt._instance=new yt(t,e)),yt._instance}static setInstance(t){return yt._instance=t}static setInstanceLevel(t){yt._instance?yt._instance.level(t):yt._instance=new yt(t)}static clearInstance(){yt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mt.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=mt.Info}canLogDebug(){return this._level>=mt.Debug}canLogError(){return this._level>=mt.Error}canLogWarn(){return this._level>=mt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=mt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):vt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Warn&&vt(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Info&&vt(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Debug&&vt(this._method||"log","DEBUG",e),this}}yt._instance=null;const bt=1e-10,xt=1e-10;function wt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bt,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:xt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var At=function(t,e,i){return t<e?e:t>i?i:t};const St=1e-12,Tt=Math.PI,Ct=Tt/2,_t=2*Tt,Bt=2*Math.PI,Pt=Math.abs,Rt=Math.atan2,Mt=Math.cos,kt=Math.max,Et=Math.min,Ot=Math.sin,Lt=Math.sqrt,It=Math.pow;function Dt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function jt(t){return t>=1?Ct:t<=-1?-Ct:Math.asin(t)}function Ut(t,e,i,n,r){let s=i,o=n;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:s,y:o}}function Wt(t,e){return t[0]*e[1]-t[1]*e[0]}function Nt(t){const e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}class Ft{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new Ft(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return st(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return st(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class zt{static distancePP(t,e){return Lt(It(t.x-e.x,2)+It(t.y-e.y,2))}static distanceNN(t,e,i,n){return Lt(It(t-i,2)+It(e-n,2))}static distancePN(t,e,i){return Lt(It(e-t.x,2)+It(i-t.y,2))}static pointAtPP(t,e,i){return new Ft((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function Gt(t,e,i){const{x1:n,y1:r,x2:s,y2:o}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*o+i.e,i.b*s+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}class Ht{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Ht(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return nt(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Gt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:r,x2:s,y2:o}=this,a=Math.cos(t),l=Math.sin(t),h=e-e*a+i*l,c=i-e*l-i*a;return[a*n-l*r+h,l*n+a*r+c,a*n-l*o+h,l*n+a*o+c,a*s-l*r+h,l*s+a*r+c,a*s-l*o+h,l*s+a*o+c]}scalePoints(t,e,i,n){const{x1:r,y1:s,x2:o,y2:a}=this;return[t*r+(1-t)*i,e*s+(1-e)*n,t*o+(1-t)*i,e*a+(1-e)*n]}}class Vt extends Ht{}const Yt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-_t;)t+=_t;else if(t>0)for(;t>_t;)t-=_t;return t};function Xt(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}class $t{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f,o=new $t,a=t*n-e*i;return o.a=n/a,o.b=-e/a,o.c=-i/a,o.d=t/a,o.e=(i*s-n*r)/a,o.f=-(t*s-e*r)/a,o}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=o,this}rotateByCenter(t,e,i){const n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,o=(1-n)*i-r*e,a=n*this.a-r*this.b,l=r*this.a+n*this.b,h=n*this.c-r*this.d,c=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+o;return this.a=a,this.b=l,this.c=h,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:r,f:s}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}multiply(t,e,i,n,r,s){const o=this.a,a=this.b,l=this.c,h=this.d,c=o*t+l*e,u=a*t+h*e,d=o*i+l*n,p=a*i+h*n,f=o*r+l*s+this.e,g=a*r+h*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}interpolate(t,e){const i=new $t;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:r,d:s,e:o,f:a}=this,l=i*s-n*r,h=s/l,c=-n/l,u=-r/l,d=i/l,p=(r*a-s*o)/l,f=-(i*a-n*o)/l,{x:g,y:v}=t;e.x=g*h+v*u+p,e.y=g*c+v*d+f}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new $t(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){const o=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/o):-Math.acos(i/o)),s.scaleX=r/o,s.scaleY=o,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}class qt{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:n=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<i)return 0;let s=0;const o=e=>{s++,t.delete(e)},a=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<r)return o(e);let i=0;for(;a-t.timestamp[t.timestamp.length-1-i]<n&&(i++,!(i>=r)););if(i<r)return o(e);for(;a-t.timestamp[0]>n;)t.timestamp.shift()})),s}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:n=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>n&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();t.forEach((t=>{for(;n-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();for(;n-t.timestamp[0]>i;)t.timestamp.shift()}}function Kt(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,r=n*(1-Math.abs(t/60%2-1)),s=i-n/2;let o=0,a=0,l=0;return 0<=t&&t<60?(o=n,a=r,l=0):60<=t&&t<120?(o=r,a=n,l=0):120<=t&&t<180?(o=0,a=n,l=r):180<=t&&t<240?(o=0,a=r,l=n):240<=t&&t<300?(o=r,a=0,l=n):300<=t&&t<360&&(o=n,a=0,l=r),o=Math.round(255*(o+s)),a=Math.round(255*(a+s)),l=Math.round(255*(l+s)),{r:o,g:a,b:l}}function Zt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),r=Math.max(t,e,i),s=r-n;let o=0,a=0,l=0;return o=0===s?0:r===t?(e-i)/s%6:r===e?(i-t)/s+2:(t-e)/s+4,o=Math.round(60*o),o<0&&(o+=360),l=(r+n)/2,a=0===s?0:s/(1-Math.abs(2*l-1)),a=+(100*a).toFixed(1),l=+(100*l).toFixed(1),{h:o,s:a,l:l}}const Jt=/^#([0-9a-f]{3,8})$/,Qt={transparent:4294967040},te={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 ee(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ie(t){return st(t)?new oe(t>>16,t>>8&255,255&t,1):nt(t)?new oe(t[0],t[1],t[2]):new oe(255,255,255)}function ne(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function re(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class se{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new se(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new se(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof se?t:new se(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(K(Qt[t]))return function(t){return st(t)?new oe(t>>>24,t>>>16&255,t>>>8&255,255&t):nt(t)?new oe(t[0],t[1],t[2],t[3]):new oe(255,255,255,1)}(Qt[t]);if(K(te[t]))return ie(te[t]);const e=`${t}`.trim().toLowerCase(),i=Jt.exec(e);if(i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new oe((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?ie(t):8===e?new oe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new oe(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Kt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new oe(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=se.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new oe(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,r=Zt(this.color.r,this.color.g,this.color.b),s=Kt(q(t)?r.h:At(t,0,360),q(e)?r.s:e>=0&&e<=1?100*e:e,q(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new oe(s.r,s.g,s.b,n),this}setRGB(t,e,i){return!q(t)&&(this.color.r=t),!q(e)&&(this.color.g=e),!q(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Jt.exec(e),n=parseInt(i[1],16),r=i[1].length;return 3===r?new oe((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):6===r?ie(n):8===r?new oe(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):this}setColorName(t){const e=te[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new se(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ne(t.color.r),this.color.g=ne(t.color.g),this.color.b=ne(t.color.b),this}copyLinearToSRGB(t){return this.color.r=re(t.color.r),this.color.g=re(t.color.g),this.color.b=re(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class oe{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),K(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${ee(this.r)+ee(this.g)+ee(this.b)+(1===this.opacity?"":ee(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=Zt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}function ae(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}let le,he,ce,ue,de,pe,fe,ge;function ve(t,e,i,n){if(!function(t,e,i,n){let r,s=t[0],o=e[0],a=i[0],l=n[0];return o<s&&(r=o,o=s,s=r),l<a&&(r=l,l=a,a=r),!(o<a||l<s||(s=t[1],o=e[1],a=i[1],l=n[1],o<s&&(r=o,o=s,s=r),l<a&&(r=l,l=a,a=r),o<a||l<s))}(t,e,i,n))return!1;const r=[0,0],s=[0,0],o=[0,0];if(ae(r,e,t),ae(s,n,i),function(t,e){return Pt(t[0]-e[0])+Pt(t[1]-e[1])<1e-12}(r,s))return!0;ae(o,i,t);const a=Wt(o,s)/Wt(r,s);return a>=0&&a<=1&&[t[0]+r[0]*a,t[1]+r[1]*a]}var me;function ye(t,e,i){return!(t&&e&&(i?(le=t.x1,he=t.x2,ce=t.y1,ue=t.y2,de=e.x1,pe=e.x2,fe=e.y1,ge=e.y2,le>he&&([le,he]=[he,le]),ce>ue&&([ce,ue]=[ue,ce]),de>pe&&([de,pe]=[pe,de]),fe>ge&&([fe,ge]=[ge,fe]),le>pe||he<de||ce>ge||ue<fe):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(me||(me={}));const be=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};class xe{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),K(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=K(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(q(this._canvas)&&(K(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),q(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&K(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),q(this._context)&&K(this._canvas)){const t=this._canvas.getContext("2d");K(t)&&(t.save(),t.font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{fontStyle:i=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:o=e.fontFamily}=t;return(i?i+" ":"")+(n?n+" ":"")+(r?r+" ":"")+s+"px "+(o||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!q(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:r=n.fontStyle,fontVariant:s=n.fontVariant,fontWeight:o=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:p,limit:f}=this._userSpec;let{lineHeight:g=a}=this._userSpec;if(it(g)&&"%"===g[g.length-1]){const t=Number.parseFloat(g.substring(0,g.length-1))/100;g=a*t}return{fontStyle:r,fontVariant:s,fontFamily:l,fontSize:a,fontWeight:o,textAlign:c,textBaseline:d,ellipsis:p,limit:f,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(q(t))return{width:0,height:0};if(q(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:o,limit:a,lineHeight:l}=this.textSpec;let h;try{const c=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:!!o,maxLineWidth:a||1/0,lineHeight:l});h={width:c.width(),height:c.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:r}=this.textSpec;return{width:i.width,height:null!==(e=r)&&void 0!==e?e:n}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let r=this._measureSpecialChar(n);q(r)&&xe.NUMBERS_CHAR_SET.includes(n)&&(r=this._measureNumberChar()),q(r)&&["F","W"].includes(be(n))&&(r=this._measureFullSizeChar()),q(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let e=0;e<t.length;e++){const r=t[e],s=["F","W"].includes(be(r))?1:.53;i.width+=s*n}return i.height=null!==(e=r)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:r}=this.textSpec,s={width:0,height:0};if(q(t))return s;if(nt(t)){const o=t.filter(K).map((t=>t.toString()));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:o.length*((null!==(i=r)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(q(this._numberCharSize)){const t=this._standardMethod(xe.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/xe.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return q(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(xe.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(q(this._letterCharSize)){const t=this._standardMethod(xe.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/xe.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return K(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){K(this._canvas)&&(this._canvas=null),K(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}xe.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",xe.NUMBERS_CHAR_SET="0123456789",xe.FULL_SIZE_CHAR="字";const we=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),Ae=_t-1e-8;class Se{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Ae)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(f(n),f(r),r!==n)if((n%=_t)<0&&(n+=_t),(r%=_t)<0&&(r+=_t),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=_t,o=n-n%Ct,a=0;a<4&&o>r;++a,o-=Ct)f(o);else for(o=n-n%Ct+Ct,a=0;a<4&&o<r;++a,o+=Ct)f(o);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class Te{constructor(){this.curves=[],this.bounds=new Vt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Ce=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,_e={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Be={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Pe,Re,Me,ke,Ee,Oe;function Le(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const r=[];for(let t=0,s=e.length;t<s;t++)if(Pe=e[t],Re=Pe.slice(1),Me=Pe[0],i=[Me],n=Re.match(Ce),null!==n){for(let t=0,e=n.length;t<e;t++)ke=n[t],Ee=parseFloat(ke),Number.isNaN(Ee)||i.push(Ee);if(Oe=_e[Me],i.length-1>Oe){let t;for(let e=1,n=i.length;e<n;e+=Oe){t=[Me];for(let n=e,r=e+Oe;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Ie,De,je,Ue,We,Ne,Fe,ze;function Ge(t,e,i,n,r,s,o,a,l){const h=o*(Math.PI/180),c=Math.sin(h),u=Math.cos(h),d=u*(a-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(a-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,v=c/i,m=-c/n,y=u/n,b=g*a+v*l,x=m*a+y*l,w=g*t+v*e,A=m*t+y*e;let S=1/((w-b)*(w-b)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);s===r&&(T=-T);const C=.5*(b+w)-T*(A-x),_=.5*(x+A)+T*(w-b),B=Math.atan2(x-_,b-C);let P=Math.atan2(A-_,w-C)-B;P<0&&1===s?P+=_t:P>0&&0===s&&(P-=_t);const R=Math.ceil(Math.abs(P/(Ct+.001))),M=[];for(let t=0;t<R;++t){const e=B+t*P/R,r=B+(t+1)*P/R;M[t]=[C,_,e,r,i,n,c,u]}return M}function He(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=l*s,c=-a*o,u=a*s,d=l*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),m=.5*(r-n),y=Math.sin(.5*m),b=8/3*y*y/Math.sin(m),x=e+p-b*f,w=i+f+b*p,A=e+g,S=i+v,T=A+b*v,C=S-b*g;return[h*x+c*w,u*x+d*w,h*T+c*C,u*T+d*C,h*A+c*S,u*A+d*S]}function Ve(t,e,i,n){const r=Ge(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<r.length;++e){const i=He(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Ie=t.UpdateTag||(t.UpdateTag={}))[Ie.NONE=0]="NONE",Ie[Ie.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Ie[Ie.UPDATE_SHAPE=2]="UPDATE_SHAPE",Ie[Ie.CLEAR_SHAPE=253]="CLEAR_SHAPE",Ie[Ie.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Ie[Ie.INIT=179]="INIT",Ie[Ie.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Ie[Ie.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Ie[Ie.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Ie[Ie.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Ie[Ie.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Ie[Ie.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",Ie[Ie.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",Ie[Ie.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(De=t.IContainPointMode||(t.IContainPointMode={}))[De.GLOBAL=1]="GLOBAL",De[De.LOCAL=16]="LOCAL",De[De.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",De[De.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(je=t.AttributeUpdateType||(t.AttributeUpdateType={}))[je.INIT=0]="INIT",je[je.DEFAULT=1]="DEFAULT",je[je.STATE=2]="STATE",je[je.ANIMATE_BIND=10]="ANIMATE_BIND",je[je.ANIMATE_PLAY=11]="ANIMATE_PLAY",je[je.ANIMATE_START=12]="ANIMATE_START",je[je.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",je[je.ANIMATE_END=14]="ANIMATE_END",je[je.TRANSLATE=20]="TRANSLATE",je[je.TRANSLATE_TO=21]="TRANSLATE_TO",je[je.SCALE=22]="SCALE",je[je.SCALE_TO=23]="SCALE_TO",je[je.ROTATE=24]="ROTATE",je[je.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Ue=t.AnimateStatus||(t.AnimateStatus={}))[Ue.INITIAL=0]="INITIAL",Ue[Ue.RUNNING=1]="RUNNING",Ue[Ue.PAUSED=2]="PAUSED",Ue[Ue.END=3]="END",t.AnimateMode=void 0,(We=t.AnimateMode||(t.AnimateMode={}))[We.NORMAL=0]="NORMAL",We[We.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Ne=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Ne.from="from",Ne.to="to",Ne.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,(Fe=t.CurveTypeEnum||(t.CurveTypeEnum={}))[Fe.CubicBezierCurve=0]="CubicBezierCurve",Fe[Fe.QuadraticBezierCurve=1]="QuadraticBezierCurve",Fe[Fe.ArcCurve=2]="ArcCurve",Fe[Fe.LineCurve=3]="LineCurve",Fe[Fe.EllipseCurve=4]="EllipseCurve",Fe[Fe.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(ze=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[ze.beforeFillStroke=0]="beforeFillStroke",ze[ze.afterFillStroke=1]="afterFillStroke";const Ye=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),l=4*Math.tan(a/4)/3,h=i<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),f=c*s+n,g=u*o+r,v=d*s+n,m=p*o+r,y=s*l*h,b=o*l*h;t.push(f-y*u,g+b*c,v+y*p,m-b*d,v,m)},Xe=[(t,e,i,n,r,s,o)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],o),(t,e,i,n,r,s,o)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,o),(t,e,i,n,r,s,o)=>e.bezierCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*r+i,t[6]*s+n,o),(t,e,i,n)=>e.closePath(),(t,e,i,n,r,s)=>e.ellipse(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,n,r,s,o)=>e.lineTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.moveTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,o),(t,e,i,n,r,s,o)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,o)];function $e(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const l=t[a];Xe[l[0]](l,e,i,n,r,s,o)}}class qe{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ke(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],o=e[r],a=t[(r+1)%n],l=e[(r+1)%n];i+=zt.distanceNN(s,o,a,l)}return i/2}function Ze(t,e,i,n,r){return Ke([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function Je(t,e,i,n,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*i*r*r*s+n*r*r*r}function Qe(t,e,i,n,r){const s=Je(t.x,e.x,i.x,n.x,r),o=Je(t.y,e.y,i.y,n.y,r);return new Ft(s,o)}function ti(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=Qe(i,n,r,s,e),a=zt.pointAtPP(i,n,e),l=zt.pointAtPP(n,r,e),h=zt.pointAtPP(r,s,e),c=zt.pointAtPP(a,l,e),u=zt.pointAtPP(l,h,e);return[new ei(i,a,c,o),new ei(o,u,h,s)]}class ei extends qe{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Qe(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Ze(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Pt(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Pt(this.p0.y-this.p3.y):0}getAngleAt(t){const e=kt(t-.01,0),i=Et(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return Rt(r.y-n.y,r.x-n.x)}}function ii(t,e){const{p0:i,p1:n}=t,r=zt.pointAtPP(i,n,e);return[new ni(i,r),new ni(r,n)]}class ni extends qe{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return zt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=Rt(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?zt.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Pt(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Pt(this.p0.y-this.p1.y):0}}class ri{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,o,a){const l=new ei(new Ft(this._lastX,this._lastY),new Ft(t,e),new Ft(i,n),new Ft(r,s));l.originP1=this._lastOriginP,l.originP2=a,l.defined=o,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,r){const s=new ni(new Ft(this._lastX,this._lastY),new Ft(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){var i,n;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return Pt(t.p0.y-n.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return Pt(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class si extends ri{bezierCurveTo(t,e,i,n,r,s,o,a){return super.bezierCurveTo(e,t,n,i,s,r,o,a)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function oi(t,e){let i=!1;for(let n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function ai(e,i,n){const r=null!=i?i:Pt(n[n.length-1].x-n[0].x)>Pt(n[n.length-1].y-n[0].y)?t.Direction.ROW:t.Direction.COLUMN;return"monotoneY"===e?new si(e,r):new ri(e,r)}class li{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function hi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ai("linear",i,t);return ci(new li(r,n),t),r}function ci(t,e){return oi(t,e)}function ui(t,e,i,n,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class di{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&ui(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:ui(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function pi(t,e){return oi(t,e)}function fi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hi(t,e);const r=ai("basis",i,t);return pi(new di(r,n),t),r}function gi(t){return t<0?-1:1}function vi(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),o=(i-t._y1)/(r||Number(n<0&&-0)),a=(s*r+o*n)/(n+r);return(gi(s)+gi(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function mi(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function yi(t,e,i,n,r){const s=t._x0,o=t._y0,a=t._x1,l=t._y1,h=(a-s)/3;t.context.bezierCurveTo(s+h,o+h*e,a-h,l-h*i,a,l,n,t.lastPoint1)}class bi{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:yi(this,this._t0,mi(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,yi(this,mi(this,e=vi(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:yi(this,this._t0,e=vi(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class xi extends bi{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function wi(t,e){return oi(t,e)}function Ai(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hi(t,e);const r=ai("monotoneX",i,t);return wi(new bi(r,n),t),r}function Si(t,e){return oi(t,e)}function Ti(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hi(t,e);const r=ai("monotoneY",i,t);return Si(new xi(r,n),t),r}let Ci=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function _i(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new ri("step",null!=r?r:Pt(e[e.length-1].x-e[0].x)>Pt(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Bi(new Ci(o,i,s),e),o}function Bi(t,e){return oi(t,e)}class Pi extends li{lineEnd(){this.context.closePath()}}function Ri(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ai("linear",i,t);return Mi(new Pi(r,n),t),r}function Mi(t,e){return oi(t,e)}function ki(t,e,i,n,r){let s=t._x1,o=t._y1,a=t._x2,l=t._y2;if(t._l01_a>St){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>St){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*n+t._x1*t._l23_2a-e*t._l12_2a)/r,l=(l*n+t._y1*t._l23_2a-i*t._l12_2a)/r}t.context.bezierCurveTo(s,o,a,l,t._x2,t._y2,n,t.lastPoint1)}function Ei(t,e){return function(i,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:o}=r;if(i.length<2-Number(!!o))return null;if(i.length<3-Number(!!o))return hi(i,r);const a=ai(t,s,i);return oi(new e(a,n,o),i),a}}const Oi=Ei("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:ki(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Li=Ei("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:ki(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function Ii(t,e,i){var n,r;switch(e){case"linear":default:return hi(t,i);case"basis":return fi(t,i);case"monotoneX":return Ai(t,i);case"monotoneY":return Ti(t,i);case"step":return _i(t,.5,i);case"stepBefore":return _i(t,0,i);case"stepAfter":return _i(t,1,i);case"catmullRom":return Oi(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Li(t,null!==(r=null==i?void 0:i.curveTension)&&void 0!==r?r:.5,i);case"linearClosed":return Ri(t,i)}}class Di extends Te{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Se(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Be.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Be.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Be.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.commandList.push([Be.C,t,e,i,n,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,s),this}arcTo(t,e,i,n,r){return this.commandList.push([Be.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,o,a){return this.commandList.push([Be.E,t,e,i,n,r,s,o,a]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,o,a),this}rect(t,e,i,n){return this.commandList.push([Be.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,s){return this.commandList.push([Be.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Be.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[Be.M]=t=>`M${t[1]} ${t[2]}`,t[Be.L]=t=>`L${t[1]} ${t[2]}`,t[Be.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Be.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Be.A]=t=>{const e=[];Ye(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Be.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Be.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,r){this.clear();const s=Le(t);return this._runCommandStrList(s,e,i,n,r),this._updateBounds(),this}fromLine(e){const{points:i,curveType:n,clipRangeByDimension:r}=e.attribute;if(!i)return;const s=Ii(i,n);"x"===r?this.direction=t.Direction.ROW:"y"===r?this.direction=t.Direction.COLUMN:"auto"===r&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const t=[];t[Be.M]=this.moveToTransform,t[Be.L]=this.lineToTransform,t[Be.Q]=this.quadraticCurveToTransform,t[Be.C]=this.bezierCurveToTransform,t[Be.AT]=this.arcToTransform,t[Be.E]=this.ellipseTransform,t[Be.R]=this.rectTransform,t[Be.A]=this.arcTransform,t[Be.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,r,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(e=t[g],1===l&&1===h||(e=Ui(e,l,h)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+o,d+a);break;case"L":u=e[1],d=e[2],this.lineTo(u+o,d+a);break;case"h":u+=e[1],this.lineTo(u+o,d+a);break;case"H":u=e[1],this.lineTo(u+o,d+a);break;case"v":d+=e[1],this.lineTo(u+o,d+a);break;case"V":d=e[1],this.lineTo(u+o,d+a);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+o,d+a);break;case"M":u=e[1],d=e[2],this.moveTo(u+o,d+a);break;case"c":i=u+e[5],n=d+e[6],p=u+e[3],f=d+e[4],this.bezierCurveTo(u+e[1]+o,d+e[2]+a,p+o,f+a,i+o,n+a),u=i,d=n;break;case"C":u=e[5],d=e[6],p=e[3],f=e[4],this.bezierCurveTo(e[1]+o,e[2]+a,p+o,f+a,u+o,d+a);break;case"s":i=u+e[3],n=d+e[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+o,f+a,u+e[1]+o,d+e[2]+a,i+o,n+a),p=u+e[1],f=d+e[2],u=i,d=n;break;case"S":i=e[3],n=e[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+o,f+a,e[1]+o,e[2]+a,i+o,n+a),u=i,d=n,p=e[1],f=e[2];break;case"q":i=u+e[3],n=d+e[4],p=u+e[1],f=d+e[2],this.quadraticCurveTo(p+o,f+a,i+o,n+a),u=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+o,e[2]+a,i+o,n+a),u=i,d=n,p=e[1],f=e[2];break;case"t":i=u+e[1],n=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-r,f=2*d-s):"q"===c[0]&&(p=2*u-p,f=2*d-f),r=p,s=f,this.quadraticCurveTo(p+o,f+a,i+o,n+a),u=i,d=n,p=u+e[1],f=d+e[2];break;case"T":i=e[1],n=e[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+o,f+a,i+o,n+a),u=i,d=n;break;case"a":Ve(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+u+o,e[7]+d+a]),u+=e[6],d+=e[7];break;case"A":Ve(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+a]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Be.L:this.lineToTransform(o,e,i,n,r);break;case Be.M:this.moveToTransform(o,e,i,n,r);break;case Be.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Be.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Be.A:this.arcToTransform(o,e,i,n,r);break;case Be.E:this.ellipseTransform(o,e,i,n,r);break;case Be.R:this.rectTransform(o,e,i,n,r);break;case Be.AT:this.arcToTransform(o,e,i,n,r);break;case Be.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),$e(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Pt(t.p0.y-e.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Pt(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const ji=["l",0,0,0,0,0,0,0];function Ui(t,e,i){const n=ji[0]=t[0];if("a"===n||"A"===n)ji[1]=e*t[1],ji[2]=i*t[2],ji[3]=t[3],ji[4]=t[4],ji[5]=t[5],ji[6]=e*t[6],ji[7]=i*t[7];else if("h"===n||"H"===n)ji[1]=e*t[1];else if("v"===n||"V"===n)ji[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)ji[n]=(n%2==1?e:i)*t[n];return ji}const Wi={alignSelf:"auto"},Ni={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new $t},Fi={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},zi={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Gi=Object.assign({outerBorder:Object.assign(Object.assign({},zi),{distance:0}),innerBorder:Object.assign(Object.assign({},zi),{distance:0})},zi),Hi={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},Vi={pickStrokeBuffer:0},Yi=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},Fi),Gi),Wi),Vi),Xi={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},$i={_debug_bounds:!1},qi=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic"},$i),Yi),Ni);const Ki=Object.assign(Object.assign({},qi),{startAngle:0,endAngle:Bt,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Zi=Object.assign(Object.assign(Object.assign({},qi),Xi),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Ji=Object.assign(Object.assign({},qi),{radius:1,startAngle:0,endAngle:Bt}),Qi=Object.assign(Object.assign({},qi),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),tn=Object.assign(Object.assign({},qi),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),en=Object.assign(Object.assign(Object.assign({},qi),Xi),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),nn=Object.assign(Object.assign({},qi),{path:new Di,customPath:()=>{yt.getInstance().warn("空函数")}}),rn=Object.assign(Object.assign({},qi),{points:[],cornerRadius:0,closePath:!0}),sn=Object.assign(Object.assign({},qi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),on=Object.assign(Object.assign({},qi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),an=Object.assign(Object.assign({},qi),{symbolType:"circle",size:10,keepDirIn3d:!0}),ln=Object.assign(Object.assign(Object.assign({},qi),Hi),{strokeBoundsBuffer:0,keepDirIn3d:!0}),hn=Object.assign(Object.assign(Object.assign({},qi),Hi),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),cn=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},qi),{fill:!0,cornerRadius:0}),un=Object.assign(Object.assign({},cn),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});class dn{}const pn=new dn,fn={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},gn=!0,vn=!1,mn=/\w|\(|\)|-/,yn=/[.?!,;:/,。?!、;:]/,bn=/\S/;function xn(t,e,i,n,r){if(!e||e<=0)return 0;const s=pn.graphicUtil.textMeasure;let o=n,a=t.slice(0,o),l=Math.floor(s.measureText(a,i).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,i).width);for(;l>e||c<=e;){if(l>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),l=Math.floor(s.measureText(a,i).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,i).width)}return r&&(o=wn(t,o)),o}function wn(t,e){let i=e;for(;mn.test(t[i-1])&&mn.test(t[i])||yn.test(t[i]);)if(i--,i<=0)return e;return i}function An(t,e){const i=pn.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}var Sn=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Tn=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,e){let{fontSize:i=ln.fontSize}=e,n=0,r=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?n++:r++;return{width:~~(.8*n*i+r*i),height:i}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Hi.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Hi.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,s.push(t[a]);if(t[a]&&t[a].text.length>1){const r=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1,"end",!1);if(n&&r.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[a].text;let s=wn(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[a]),{text:r.str,width:r.width})),o+=r.width}return{verticalList:s,width:o}}clipText(t,e,i,n){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const s=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&s.str!==t){const i=wn(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,n,r,s,o){let a;if("start"===s)a=this._clipTextStart(t,e,i,n,r),o&&(a.result=o+a.str);else if("middle"===s){const n=this._clipTextMiddle(t,e,i,"","",0,0,1);a={str:"none",width:n.width,result:n.left+o+n.right}}else a=this._clipTextEnd(t,e,i,n,r),o&&(a.result=a.str+o);return a}_clipTextEnd(t,e,i,n,r){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let l;if(a>i){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return l=this.measureTextWidth(r,e),l<=i?{str:r,width:l}:this._clipTextEnd(t,e,i,n,s)}if(a<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return l=this.measureTextWidth(n,e),l>=i?{str:o,width:a}:this._clipTextEnd(t,e,i,s,r)}return{str:o,width:a}}_clipTextStart(t,e,i,n,r){const s=Math.ceil((n+r)/2),o=t.substring(s-1,t.length-1),a=this.measureTextWidth(o,e);let l;if(a>i){if(o.length<=1)return{str:"",width:0};const n=t.substring(s,t.length-1);return l=this.measureTextWidth(n,e),l<=i?{str:n,width:l}:this._clipTextStart(t,e,i,s,t.length-1)}if(a<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};const r=t.substring(s-2,t.length-1);return l=this.measureTextWidth(r,e),l>=i?{str:o,width:a}:this._clipTextStart(t,e,i,n,s)}return{str:o,width:a}}_clipTextMiddle(t,e,i,n,r,s,o,a){const l=t.substring(0,a),h=this.measureTextWidth(l,e);if(h+o>i)return{left:n,right:r,width:s+o};const c=t.substring(t.length-a,t.length),u=this.measureTextWidth(c,e);return h+u>i?{left:l,right:r,width:h+o}:this._clipTextMiddle(t,e,i,l,c,h,u,a+1)}clipTextWithSuffixVertical(t,e,i,n,r,s){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const o=this.clipTextVertical(t,e,i,r);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;const a=this.measureTextWidth(n,e);if(a>i)return o;let l;if(i-=a,"start"===s){const s=this.revertVerticalList(t);l=this.clipTextVertical(s,e,i,r);const o=this.revertVerticalList(l.verticalList);o.unshift({text:n,direction:1,width:a}),l.verticalList=o}else if("middle"===s){const s=this.clipTextVertical(t,e,i/2,r),o=this.revertVerticalList(t),h=this.clipTextVertical(o,e,i/2,r);s.verticalList.push({text:n,direction:1,width:a}),this.revertVerticalList(h.verticalList).forEach((t=>s.verticalList.push(t))),l={verticalList:s.verticalList,width:s.width+h.width}}else l=this.clipTextVertical(t,e,i,r),l.verticalList.push({text:n,direction:1,width:a});return l.width+=a,l}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const a=this.measureTextWidth(t,e);if(!o&&a<=i)return{str:t,width:a};const l=this.measureTextWidth(n,e);if(l>i)return{str:"",width:0};if(o&&a+l<=i)return{str:t+n,width:a+l};i-=l;const h=this._clipText(t,e,i,0,t.length-1,s,n);if(r&&h.str!==t){const i=wn(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else o&&h.str===t&&(h.result=t+n);return h.str=h.result,h.width+=l,h}};Tn=Sn([g()],Tn);var Cn=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};const _n=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=class extends Tn{},t.DefaultTextMeasureContribution=Cn([g()],t.DefaultTextMeasureContribution);const Bn=new k,Pn=Symbol.for("CanvasFactory"),Rn=Symbol.for("Context2dFactory");function Mn(t){return Bn.getNamed(Pn,pn.global.env)(t)}const kn=1e-4,En=Math.sqrt(3),On=1/3;function Ln(t){return t>-$n&&t<$n}function In(t){return t>$n||t<-$n}const Dn=[0,0],jn=[0,0],Un=[0,0];function Wn(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Nn(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Fn(t,e,i,n,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*n+3*s*i)}function zn(t){return(t%=Bt)<0&&(t+=Bt),t}function Gn(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const o=(s-e)/(n-e);let a=n<e?1:-1;1!==o&&0!==o||(a=n<e?.5:-.5);const l=o*(i-t)+t;return l===r?1/0:l>r?a:0}function Hn(t,e,i,n,r,s,o,a,l){if(0===o)return!1;const h=o;return!(l>e+h&&l>n+h&&l>s+h||l<e-h&&l<n-h&&l<s-h||a>t+h&&a>i+h&&a>r+h||a<t-h&&a<i-h&&a<r-h)&&function(t,e,i,n,r,s,o,a,l){let h=0,c=.005,u=1/0;Dn[0]=o,Dn[1]=a;for(let o=0;o<1;o+=.05){jn[0]=Nn(t,i,r,o),jn[1]=Nn(e,n,s,o);const a=Wn(Dn,jn);a<u&&(h=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<kn);o++){const o=h-c,a=h+c;jn[0]=Nn(t,i,r,o),jn[1]=Nn(e,n,s,o);const l=Wn(jn,Dn);if(o>=0&&l<u)h=o,u=l;else{Un[0]=Nn(t,i,r,a),Un[1]=Nn(e,n,s,a);const o=Wn(Un,Dn);a<=1&&o<u?(h=a,u=o):c*=.5}}return l&&(l[0]=Nn(t,i,r,h),l[1]=Nn(e,n,s,h)),Math.sqrt(u)}(t,e,i,n,r,s,a,l,null)<=h/2}function Vn(t,e,i,n,r,s,o,a,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>n+u&&c>s+u&&c>a+u||c<e-u&&c<n-u&&c<s-u&&c<a-u||h>t+u&&h>i+u&&h>r+u&&h>o+u||h<t-u&&h<i-u&&h<r-u&&h<o-u)&&function(t,e,i,n,r,s,o,a,l,h,c){let u,d,p,f,g=0,v=.005,m=1/0;Dn[0]=l,Dn[1]=h;for(let l=0;l<1;l+=.05)jn[0]=Fn(t,i,r,o,l),jn[1]=Fn(e,n,s,a,l),p=Wn(Dn,jn),p<m&&(g=l,m=p);m=1/0;for(let l=0;l<32&&!(v<kn);l++)u=g-v,d=g+v,jn[0]=Fn(t,i,r,o,u),jn[1]=Fn(e,n,s,a,u),p=Wn(jn,Dn),u>=0&&p<m?(g=u,m=p):(Un[0]=Fn(t,i,r,o,d),Un[1]=Fn(e,n,s,a,d),f=Wn(Un,Dn),d<=1&&f<m?(g=d,m=f):v*=.5);return c&&(c[0]=Fn(t,i,r,o,g),c[1]=Fn(e,n,s,a,g)),Math.sqrt(m)}(t,e,i,n,r,s,o,a,h,c,null)<=u/2}function Yn(t,e,i,n,r,s,o,a,l){if(0===o)return!1;const h=o;a-=t,l-=e;const c=Math.sqrt(a*a+l*l);if(c-h>i||c+h<i)return!1;if(Math.abs(n-r)%Bt<1e-4)return!0;if(s){const t=n;n=zn(r),r=zn(t)}else n=zn(n),r=zn(r);n>r&&(r+=Bt);let u=Math.atan2(l,a);return u<0&&(u+=Bt),u>=n&&u<=r||u+Bt>=n&&u+Bt<=r}function Xn(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,l=r/2;let h=0,c=t;if(o>e+l&&o>n+l||o<e-l&&o<n-l||s>t+l&&s>i+l||s<t-l&&s<i-l)return!1;if(t===i)return Math.abs(s-t)<=a/2;h=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=h*s-o+c;return u*u/(h*h+1)<=a/2*a/2}const $n=1e-4;function qn(t,e,i,n,r){const s=6*i-12*e+6*t,o=9*e+3*n-3*t-9*i,a=3*e-3*t;let l=0;if(Ln(o)){if(In(s)){const t=-a/s;t>=0&&t<=1&&(r[l++]=t)}}else{const t=s*s-4*o*a;if(Ln(t))r[0]=-s/(2*o);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*o),n=(-s-e)/(2*o);i>=0&&i<=1&&(r[l++]=i),n>=0&&n<=1&&(r[l++]=n)}}return l}const Kn=[-1,-1,-1],Zn=[-1,-1];function Jn(){const t=Zn[0];Zn[0]=Zn[1],Zn[1]=t}function Qn(t,e,i,n,r,s,o,a,l,h){if(h>e&&h>n&&h>s&&h>a||h<e&&h<n&&h<s&&h<a)return 0;const c=function(t,e,i,n,r,s){const o=n+3*(e-i)-t,a=3*(i-2*e+t),l=3*(e-t),h=t-r,c=a*a-3*o*l,u=a*l-9*o*h,d=l*l-3*a*h;let p=0;if(Ln(c)&&Ln(u))if(Ln(a))s[0]=0;else{const t=-l/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Ln(t)){const t=u/c,e=-a/o+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*a+1.5*o*(-u+e),n=c*a+1.5*o*(-u-e);i=i<0?-Math.pow(-i,On):Math.pow(i,On),n=n<0?-Math.pow(-n,On):Math.pow(n,On);const r=(-a-(i+n))/(3*o);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-a-2*i*n)/(3*o),l=(-a+i*(n+En*Math.sin(e)))/(3*o),h=(-a+i*(n-En*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[p++]=r),l>=0&&l<=1&&(s[p++]=l),h>=0&&h<=1&&(s[p++]=h)}}return p}(e,n,s,a,h,Kn);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let h=0;h<c;h++){const c=Kn[h],g=0===c||1===c?.5:1;Fn(t,i,r,o,c)<l||(d<0&&(d=qn(e,n,s,a,Zn),Zn[1]<Zn[0]&&d>1&&Jn(),p=Fn(e,n,s,a,Zn[0]),d>1&&(f=Fn(e,n,s,a,Zn[1]))),2===d?c<Zn[0]?u+=p<e?g:-g:c<Zn[1]?u+=f<p?g:-g:u+=a<f?g:-g:c<Zn[0]?u+=p<e?g:-g:u+=a<p?g:-g)}return u}function tr(t,e,i,n,r,s,o,a){if(a>e&&a>n&&a>s||a<e&&a<n&&a<s)return 0;const l=function(t,e,i,n,r){const s=t-2*e+i,o=2*(e-t),a=t-n;let l=0;if(Ln(s)){if(In(o)){const t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{const t=o*o-4*s*a;if(Ln(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-o+e)/(2*s),n=(-o-e)/(2*s);i>=0&&i<=1&&(r[l++]=i),n>=0&&n<=1&&(r[l++]=n)}}return l}(e,n,s,a,Kn);if(0===l)return 0;const h=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(h>=0&&h<=1){let a=0;const c=Nn(e,n,s,h);for(let n=0;n<l;n++){const l=0===Kn[n]||1===Kn[n]?.5:1;Nn(t,i,r,Kn[n])<o||(Kn[n]<h?a+=c<e?l:-l:a+=s<c?l:-l)}return a}const c=0===Kn[0]||1===Kn[0]?.5:1;return Nn(t,i,r,Kn[0])<o?0:s<e?c:-c}function er(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const l=Math.sqrt(i*i-a*a);Kn[0]=-l,Kn[1]=l;const h=Math.abs(n-r);if(h<1e-4)return 0;if(h>=Bt-1e-4){n=0,r=Bt;const e=s?1:-1;return o>=Kn[0]+t&&o<=Kn[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=Bt,r+=Bt);let c=0;for(let e=0;e<2;e++){const i=Kn[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=Bt+t),(t>=n&&t<=r||t+Bt>=n&&t+Bt<=r)&&(t>Tt/2&&t<1.5*Tt&&(e=-e),c+=e)}}return c}function ir(t){return Math.round(t/Tt*1e8)/1e8%2*Tt}function nr(t,e){let i=ir(t[0]);i<0&&(i+=Bt);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=Bt?r=i+Bt:e&&i-r>=Bt?r=i-Bt:!e&&i>r?r=i+(Bt-ir(i-r)):e&&i<r&&(r=i-(Bt-ir(r-i))),t[0]=i,t[1]=r}const rr=[0,0];function sr(t,e,i,n,r){const s=t,o=t.length;let a,l,h=0,c=0,u=0,d=0,p=0;for(let t=0;t<o;t++){const o=s[t],f=0===t;o[0]===Be.M&&t>1&&(i||(h+=Gn(c,u,d,p,n,r))),f&&(c=o[1],u=o[2],d=c,p=u);const g=o[0],v=o[1],m=o[2],y=o[3],b=o[4],x=o[5],w=o[6];let A=b,S=x;rr[0]=A,rr[1]=S,nr(rr,Boolean(o[6])),A=rr[0],S=rr[1];const T=A,C=S-A,_=!!(1-(o[6]?0:1)),B=(n-v)*y/y+v;switch(g){case Be.M:d=v,p=m,c=d,u=p;break;case Be.L:if(i){if(Xn(c,u,v,m,e,n,r))return!0}else h+=Gn(c,u,v,m,n,r)||0;c=v,u=m;break;case Be.C:if(i){if(Vn(c,u,v,m,y,b,x,w,e,n,r))return!0}else h+=Qn(c,u,v,m,y,b,x,w,n,r)||0;c=x,u=w;break;case Be.Q:if(i){if(Hn(c,u,v,m,y,b,e,n,r))return!0}else h+=tr(c,u,v,m,y,b,n,r)||0;c=y,u=b;break;case Be.A:if(a=Math.cos(T)*y+v,l=Math.sin(T)*y+m,f?(d=a,p=l):h+=Gn(c,u,a,l,n,r),i){if(Yn(v,m,y,T,T+C,_,e,B,r))return!0}else h+=er(v,m,y,T,T+C,_,B,r);c=Math.cos(T+C)*y+v,u=Math.sin(T+C)*y+m;break;case Be.R:if(d=c=v,p=u=m,a=d+y,l=p+b,i){if(Xn(d,p,a,p,e,n,r)||Xn(a,p,a,l,e,n,r)||Xn(a,l,d,l,e,n,r)||Xn(d,l,d,p,e,n,r))return!0}else h+=Gn(a,p,a,l,n,r),h+=Gn(d,l,d,p,n,r);break;case Be.Z:if(i){if(Xn(c,u,d,p,e,n,r))return!0}else h+=Gn(c,u,d,p,n,r);c=d,u=p}}return i||function(t,e){return Math.abs(t-e)<$n}(u,p)||(h+=Gn(c,u,d,p,n,r)||0),0!==h}class or{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=Mn(Object.assign({nativeCanvas:pn.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Mn(Object.assign({nativeCanvas:pn.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const ar=new or;var lr=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const cr=Symbol.for("VWindow"),ur=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new j(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(Bn.getNamed(ur,t.env).configure(this,t),this.actived=!0)},this._uid=e.GenAutoIncrementId(),this.global=pn.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const n=this._handler.getWH();this._width=n.width,this._height=n.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,n,r,s){this._handler.setViewBoxTransform(t,e,i,n,r,s)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),n={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},n),n.x-=i.x1,n.y-=i.y1,n}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},t.DefaultWindow=lr([g(),hr("design:paramtypes",[])],t.DefaultWindow);var dr,pr=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},fr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gr=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultGraphicUtil=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=pn.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=ar.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:Hi.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new xe(Object.assign({defaultFontParams:{fontFamily:Hi.fontFamily,fontSize:Hi.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+xe.ALPHABET_CHAR_SET+xe.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const n=Bn.get(cr),r=t.AABBBounds,s=r.width(),o=r.height(),a=-r.x1,l=-r.y1;n.create({viewBox:{x1:a,y1:l,x2:r.x2,y2:r.y2},width:s,height:o,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{transMatrix:n.getViewBoxTransform(),viewBox:n.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const c=n.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}},t.DefaultGraphicUtil=pr([g(),gr(0,p(E)),gr(0,v(_n)),fr("design:paramtypes",[Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(dr||(dr={}));const vr=new $t;t.DefaultTransformUtil=class{constructor(){this.matrix=new $t}init(t){return this.mode=dr.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=dr.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(vr.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:r}=i;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(vr.a,vr.b,vr.c,vr.d,vr.e,vr.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(vr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:n}=e;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(vr.a,vr.b,vr.c,vr.d,vr.e,vr.f),this}scale(t,e,i){return this.mode===dr.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===dr.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return vr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(vr.a,vr.b,vr.c,vr.d,vr.e,vr.f),this}translate(t,e){return this.mode===dr.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===dr.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=pr([g(),fr("design:paramtypes",[])],t.DefaultTransformUtil);const mr={arc:Ki,area:Zi,circle:Ji,line:en,path:nn,symbol:an,text:ln,rect:sn,polygon:rn,richtext:hn,richtextIcon:un,image:cn,group:Qi,glyph:tn},yr=Object.keys(mr);function br(){return{arc:Object.assign({},mr.arc),area:Object.assign({},mr.area),circle:Object.assign({},mr.circle),line:Object.assign({},mr.line),path:Object.assign({},mr.path),symbol:Object.assign({},mr.symbol),text:Object.assign({},mr.text),rect:Object.assign({},mr.rect),polygon:Object.assign({},mr.polygon),richtext:Object.assign({},mr.richtext),richtextIcon:Object.assign({},mr.richtextIcon),image:Object.assign({},mr.image),group:Object.assign({},mr.group),glyph:Object.assign({},mr.glyph)}}function xr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const wr=br();class Ar{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},yr.forEach((t=>{this._defaultTheme[t]=Object.create(wr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,yt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;yr.forEach((n=>{const r=Object.create(wr[n]);t&&t[n]&&xr(r,t[n]),i[n]&&xr(r,i[n]),e[n]&&xr(r,e[n]),this.combinedTheme[n]=r})),e.common&&yr.forEach((t=>{xr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Sr=new Ar;function Tr(t,e){return t.glyphHost?Tr(t.glyphHost):e?(t.isContainer,e):Cr(t)||t.attachedThemeGraphic&&Tr(t.attachedThemeGraphic)||Sr.getTheme()}function Cr(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Sr.getTheme()}return null}var _r=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};class Br extends V{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=e.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return _r(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&yt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=X(i,!0)&&i||Z(i)&&i.capture,r=Z(i)&&i.once,s=$(e)?void 0:e;return t=n?`${t}capture`:t,e=$(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=X(i,!0)&&i||Z(i)&&i.capture,r=$(e)?void 0:e;t=n?`${t}capture`:t,e=$(e)?e:e.handleEvent;const s=Z(i)&&i.once;return super.off(t,e,r,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return Z(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Pr{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Pr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&$(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&$(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Rr extends Pr{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f){throw new Error("Method not implemented.")}}class Mr extends Rr{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new Mr(this.manager);n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice();const r=this.composedDetailPath();return n.detailPath=r&&r.slice(),n.type=this.type,n}}class kr extends Rr{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new kr(this.manager);n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice();const r=this.composedDetailPath();return n.detailPath=r&&r.slice(),n.type=this.type,n}}kr.DOM_DELTA_PIXEL=0,kr.DOM_DELTA_LINE=1,kr.DOM_DELTA_PAGE=2;class Er extends Pr{constructor(t,e){super(),this.type=t,this.detail=e}}const Or="object"==typeof performance&&performance.now?performance:Date;function Lr(t){return"mouse"===t||"pen"===t}class Ir{constructor(t,e){this.dispatch=new V,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(Lr(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,n;if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=Lr(r.pointerType),o=this.trackingData(t.pointerId),a=this.findMountedTarget(o.overTargets);if(o.overTargets&&a&&a!==this.rootTarget&&a!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,a||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(a)){const e=this.createPointerEvent(t,"pointerleave",a||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(a!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let n=null==a?void 0:a.parent;for(;n&&n!==this.rootTarget.parent&&n!==r.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let n=a;for(;n&&n!==this.rootTarget;)i.add(n),n=n.parent;for(;e&&e!==a&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&this.dispatchEvent(r,"touchmove"),s&&(this.dispatchEvent(r,"mousemove"),this.cursorTarget=r.target,this.cursor=(null===(n=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor()),o.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,n;if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),o=Lr(s.pointerType);this.dispatchEvent(s,"pointerover"),o&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursorTarget=s.target,this.cursor=(null===(n=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor());const a=this.clonePointerEvent(s,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),o&&this.notifyTarget(a,"mouseenter"),a.target=a.target.parent;r.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(a)},this.onPointerOut=(t,e)=>{if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=Lr(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=Or.now(),r=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if(Lr(r.pointerType)){const t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}const s=this.trackingData(t.pointerId),o=this.findMountedTarget(s.pressTargetsByButton[t.button]);let a=o;if(o&&!r.composedPath().includes(o)){let e=o;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if(Lr(r.pointerType)){const t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete s.pressTargetsByButton[t.button],a=e}if(a){const e=this.clonePointerEvent(r,"click");e.target=a,e.path=[],e.detailPath=[],s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:n});const o=s.clicksByButton[t.button];o.target===e.target&&n-o.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++o.clickCount:o.clickCount=1,o.target=e.target,o.timeStamp=n,e.detail=o.clickCount,Lr(e.pointerType)?(this.dispatchEvent(e,"click"),2===o.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===o.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(r)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Mr))return void yt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):Lr(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof kr))return void yt.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,n,r,s,o,a;if(!this.rootTarget)return;const l=this.mappingTable[t.type];let h;const c=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[c])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[c])||void 0===n?void 0:n.stage)&&(null===(s=null===(r=this._prePointTargetCache)||void 0===r?void 0:r[c])||void 0===s?void 0:s.stage.renderCount)===(null===(o=this._prePointTargetCache)||void 0===o?void 0:o.stageRenderCount)?h=this._prePointTargetCache[c]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[c]:h,stageRenderCount:null!==(a=null==h?void 0:h.stage.renderCount)&&void 0!==a?a:-1})),l)for(let e=0,i=l.length;e<i;e++)l[e].fn(t,h);else yt.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],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){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){var n,r;const s=this.allocateEvent(Mr);return this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t,s.target=i||this.pickTarget(null!==(n=s.viewX)&&void 0!==n?n:s.global.x,null!==(r=s.viewY)&&void 0!==r?r:s.global.y,s),"string"==typeof e&&(s.type=e),s}createWheelEvent(t,e){var i,n;const r=this.allocateEvent(kr);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget(null!==(i=r.viewX)&&void 0!==i?i:r.global.x,null!==(n=r.viewY)&&void 0!==n?n:r.global.y,r),r}clonePointerEvent(t,e){const i=this.allocateEvent(Mr);i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice();const n=t.composedDetailPath();return i.detailPath=n&&n.slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Mr&&e instanceof Mr&&(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)}copyMouseData(t,e){t instanceof Rr&&e instanceof Rr&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((i=>{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Or.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),n}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}const Dr={dispatchEvent(t){var e;if(!(t instanceof Pr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Er(t,e))}},jr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Ur{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,autoPreventDefault:s=!1,clickInterval:o,supportsTouchEvents:a=r.supportsTouchEvents,supportsPointerEvents:l=r.supportsPointerEvents}=t;this.manager=new Ir(n,{clickInterval:o}),this.globalObj=r,this.supportsPointerEvents=l,this.supportsTouchEvents=a,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=s,this.eventsAdded=!1,this.rootPointerEvent=new Mr,this.rootWheelEvent=new kr,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:n}=this;if(this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];r?"string"==typeof r&&i?n.style.cursor=r:"function"==typeof r?r(t):"object"==typeof r&&i&&Object.assign(n.style,r):i&&it(t)&&!ct(this.cursorStyles,t)&&(n.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const n=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(n)return n;let r=0,s=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=e.clientX||0,s=e.clientY||0}else r=t.clientX||0,s=t.clientY||0;const o=this.domElement.getBoundingClientRect();return{x:r-o.left,y:s-o.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];et(n.button)&&(n.button=0),et(n.buttons)&&(n.buttons=1),et(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),et(n.width)&&(n.width=n.radiusX||1),et(n.height)&&(n.height=n.radiusY||1),et(n.tiltX)&&(n.tiltX=0),et(n.tiltY)&&(n.tiltY=0),et(n.pointerType)&&(n.pointerType="touch"),et(n.pointerId)&&(n.pointerId=n.identifier||0),et(n.pressure)&&(n.pressure=n.force||.5),et(n.twist)&&(n.twist=0),et(n.tangentialPressure)&&(n.tangentialPressure=0),et(n.layerX)&&(n.layerX=n.offsetX=n.clientX),et(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){const i=t;et(i.isPrimary)&&(i.isPrimary=!0),et(i.width)&&(i.width=1),et(i.height)&&(i.height=1),et(i.tiltX)&&(i.tiltX=0),et(i.tiltY)&&(i.tiltY=0),et(i.pointerType)&&(i.pointerType="mouse"),et(i.pointerId)&&(i.pointerId=1),et(i.pressure)&&(i.pressure=.5),et(i.twist)&&(i.twist=0),et(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.x=i,e.global.y=n,e.offset.x=i,e.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){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);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.x=i,t.global.y=n,t.offset.x=i,t.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,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=jr[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Or.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),n=i.width(),r=i.height();return!(e.x<n&&e.y<r&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class Wr{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Wr.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class Nr{static Avaliable(){return!0}avaliable(){return Nr.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Fr{static Avaliable(){return!!pn.global.getRequestAnimationFrame()}avaliable(){return Fr.Avaliable()}tick(t,e){pn.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var zr;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(zr||(zr={}));class Gr{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===zr.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=zr.INITIAL,pn.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),pn.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Fr},{mode:"timeout",cons:Nr},{mode:"manual",cons:Wr}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new Fr;break;case"timeout":t=new Nr;break;case"manual":t=new Wr;break;default:yt.getInstance().warn("非法的计时器模式"),t=new Fr}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==zr.INITIAL&&(this.status=zr.PAUSE,!0)}resume(){return this.status!==zr.INITIAL&&(this.status=zr.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===zr.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===zr.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=zr.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=zr.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Hr{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-Hr.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Hr.bounceIn(2*t):.5*Hr.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/Bt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Bt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/Bt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*Bt/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/Bt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Bt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*Bt/e)*.5+1}}}Hr.quadIn=Hr.getPowIn(2),Hr.quadOut=Hr.getPowOut(2),Hr.quadInOut=Hr.getPowInOut(2),Hr.cubicIn=Hr.getPowIn(3),Hr.cubicOut=Hr.getPowOut(3),Hr.cubicInOut=Hr.getPowInOut(3),Hr.quartIn=Hr.getPowIn(4),Hr.quartOut=Hr.getPowOut(4),Hr.quartInOut=Hr.getPowInOut(4),Hr.quintIn=Hr.getPowIn(5),Hr.quintOut=Hr.getPowOut(5),Hr.quintInOut=Hr.getPowInOut(5),Hr.backIn=Hr.getBackIn(1.7),Hr.backOut=Hr.getBackOut(1.7),Hr.backInOut=Hr.getBackInOut(1.7),Hr.elasticIn=Hr.getElasticIn(1,.3),Hr.elasticOut=Hr.getElasticOut(1,.3),Hr.elasticInOut=Hr.getElasticInOut(1,.3*1.5);class Vr{constructor(){this.id=e.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(e){if(this.paused)return;let i=this.animateHead;for(this.animateCount=0;i;)i.status===t.AnimateStatus.END?this.removeAnimate(i):i.status===t.AnimateStatus.RUNNING||i.status===t.AnimateStatus.INITIAL?(this.animateCount++,i.advance(e)):i.status===t.AnimateStatus.PAUSED&&this.animateCount++,i=i.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const Yr=new Vr;class Xr{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class $r extends Xr{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class qr{constructor(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.GenAutoIncrementId(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yr;this.id=i,this.timeline=n,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Kr(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=kt(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){qr.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qr.mode;e&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}runCb(t){const e=new $r((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=qr.interpolateMap.get(t)||qr.interpolateMap.get("");return!!o&&o(t,e,i,n,r,s)}pause(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}resume(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new Kr(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(this.rawPosition+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===n)return s;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=t.AnimateStatus.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}qr.mode=t.AnimateMode.NORMAL,qr.interpolateMap=new Map;class Kr{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new Zr(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(e){let i=e.duration;(null==i||i<0)&&(i=0);const n=e.easing,r="string"==typeof n?Hr[n]:n,s=this._addStep(i,null,r);return s.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),s,!1),this._appendCustomAnimate(e,s),this}to(e,i,n,r){(null==i||i<0)&&(i=0);const s="string"==typeof n?Hr[n]:n,o=this._addStep(i,null,s);return o.type=t.AnimateStepType.to,this._appendProps(e,o,!!r&&r.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new Zr(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,o,a=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,i<=0)return a=!0,a;if(s=Math.floor(t/i),o=t-s*i,a=t>=n*i+i,a&&(o=i,s=n,t=o*s+i),t===r)return a;const h=!this.reversed!=!(this.bounce&&s%2);return h&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+l,this.updatePosition(a,h),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let o=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return yt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class Zr{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Jr={duration:200,easing:"cubicOut"},Qr={duration:1e3,easing:"quadInOut"};var ts;t.Edge=void 0,(ts=t.Edge||(t.Edge={}))[ts.Top=1]="Top",ts[ts.Right=2]="Right",ts[ts.Bottom=4]="Bottom",ts[ts.Left=8]="Left",ts[ts.ALL=15]="ALL";const es=[!1,!1,!1,!1],is=t=>{var e;let i=!0;if(X(t,!0)){for(let n=0;n<4;n++)es[n]=t,i&&(i=!(null!==(e=es[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)es[e]=!!t[e],i&&(i=!!es[e]);else es[0]=!1,es[1]=!1,es[2]=!1,es[3]=!1;return{isFullStroke:i,stroke:es}},ns=[0,0,0,0],rs=t=>t?nt(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(ns[0]=t[0],ns[2]=t[0],ns[1]=t[1],ns[3]=t[1],ns):t:t:0,ss=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],os=[1,2,3,0,1,2,3,0];function as(t,e,i,n){for(;t>=Bt;)t-=Bt;for(;t<0;)t+=Bt;for(;t>e;)e+=Bt;ss[0].x=i,ss[1].y=i,ss[2].x=-i,ss[3].y=-i;const r=Math.ceil(t/Ct)%4,s=Math.ceil(e/Ct)%4;if(n.add(Mt(t)*i,Ot(t)*i),n.add(Mt(e)*i,Ot(e)*i),r!==s||e-t>Tt){let t=!1;for(let e=0;e<os.length;e++)if(t||r!==os[e]){if(t&&s===os[e])break;if(t){const t=ss[os[e]];n.add(t.x,t.y)}}else{t=!0;const e=ss[r];n.add(e.x,e.y)}}}function ls(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function hs(t,e,i){const{x:n,y:r}=Ut(t.x,t.y,e.x,e.y,i),{x:s,y:o}=Ut(t.x1,t.y1,e.x1,e.y1,i),a=new Ft(n,r,s,o);return a.defined=e.defined,a}function cs(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new Ft(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=hs(t[r],e[r],i)}else{n=e.map((t=>{const e=new Ft(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=hs(t[r],e[r],i)}return n}const us=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],ds=t=>us.includes(t);function ps(t,e){if(nt(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class fs{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fs.TimeOut;this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}fs.TimeOut=1e3/60;const gs=new fs,vs=(t,e)=>it(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t;var ms;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(ms||(ms={}));class ys extends Xr{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0:r.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function bs(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,l=(n-i)*r+i,h=(a-o)*r+o,c=(l-a)*r+a,u=(c-h)*r+h;s[0]=t,s[1]=o,s[2]=h,s[3]=u,s[4]=u,s[5]=c,s[6]=l,s[7]=n}function xs(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],o=i<n?t:e,a=Math.min(i,n),l=Math.abs(n-i)/6,h=(a-2)/6,c=Math.ceil(l/h),u=[o[0],o[1]];let d=l;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],l=o[t+2],h=o[t+3];const p=o[t+4],f=o[t+5];if(d<=0){u.push(n,a,l,h,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const o=t/g;bs(e,n,l,p,o,r),bs(i,a,h,f,o,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],a=s[5],l=r[6],h=s[6]}d-=g-1}return o===t?[u,e]:[t,u]}function ws(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],o=[];for(let t=0;t<e.length;t+=2)o[t]=r,o[t+1]=s;return o}function As(t){const e=[],i=t.length;for(let n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function Ss(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,o=r-2;s<r;o=s,s+=2){const r=t[o],a=t[o+1],l=t[s],h=t[s+1],c=r*h-l*a;e+=c,i+=(r+l)*c,n+=(a+h)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function Ts(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,l=a-2;for(let h=0;h<r;h++){const r=6*h;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%l+2,a=t[o]-i[0],h=t[o+1]-i[1],u=e[s]-n[0]-a,d=e[s+1]-n[1]-h;c+=u*u+d*d}c<s&&(s=c,o=h)}return o}function Cs(t,e,i,n){const r=[];let s;for(let o=0;o<t.length;o++){let a=t[o];const l=e[o],h=Ss(a),c=Ss(l);null==s&&(s=h[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],v=a.length;s&&(a=As(a));const m=6*Ts(a,l,h,c),y=v-2;for(let t=0;t<y;t+=2){const e=(m+t)%y+2;u[t+2]=a[e]-h[0],u[t+3]=a[e+1]-h[1]}if(u[0]=a[m]-h[0],u[1]=a[m+1]-h[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<a.length;e+=2){const r=u[e],s=u[e+1],o=l[e]-c[0],a=l[e+1]-c[1],h=o*i-a*t,d=o*t+a*i;g[e]=h,g[e+1]=d;const p=h-r,f=d-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}else for(let t=0;t<v;t+=2)d[t]=l[t]-c[0],d[t+1]=l[t+1]-c[1];r.push({from:u,to:d,fromCp:h,toCp:c,rotation:-p})}return r}function _s(t,e){let i,n;const r=[],s=[];for(let o=0;o<Math.max(t.length,e.length);o++){const a=t[o],l=e[o];let h,c;a?l?([h,c]=xs(a,l),i=h,n=c):(c=ws(n,a),h=a):(h=ws(i,l),c=l),r.push(h),s.push(c)}return[r,s]}const Bs=(t,e,i,n,r)=>{wt(e,n)&&wt(i,r)||t.push(e,i,n,r,n,r)};function Ps(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const l=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let h,c,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(o=r=i[1],a=s=i[2],[Be.L,Be.C,Be.Q].includes(i[0])&&(n=[o,a])),i[0]){case Be.M:r=o=i[1],s=a=i[2],l(o,a);break;case Be.L:h=i[1],c=i[2],Bs(n,r,s,h,c),r=h,s=c;break;case Be.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Be.Q:h=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(h-r),s+2/3*(c-s),u+2/3*(h-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Be.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],v=!!i[6];h=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(o=h,a=c,l(o,a)):Bs(n,r,s,h,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const m=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=m){const r=v?Math.max(i+m,g):Math.min(i+m,g);Ye(n,i,r,t,e,u,d)}break}case Be.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],v=i[7]+g,m=!!i[8],y=!wt(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,A=Math.sin(g)*d;y?(h=w*b-A*x+t,c=w*x+A*b+e):(h=w+t,c=A+e),p?(o=h,a=c,l(o,a)):Bs(n,r,s,h,c),w=Math.cos(v)*u,A=Math.sin(v)*d,y?(r=w*b-A*x+t,s=w*x+A*b+e):(r=w+t,s=A+e);const S=(m?-1:1)*Math.PI/2;for(let i=g;m?i>v:i<v;i+=S){const r=m?Math.max(i+S,v):Math.min(i+S,v);if(Ye(n,i,r,t,e,u,d),y){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],A=n[r+1],n[r]=(w-t)*b-(A-e)*x+t,n[r+1]=(w-t)*x+(A-e)*b+e}}break}case Be.R:o=r=i[1],a=s=i[2],h=o+i[3],c=a+i[4],l(h,a),Bs(n,h,a,h,c),Bs(n,h,c,o,c),Bs(n,o,c,o,a),Bs(n,o,a,h,a);break;case Be.AT:{const t=i[1],e=i[2],l=i[3],h=i[4],c=i[5],u=zt.distancePP({x:r,y:s},{x:t,y:e}),d=zt.distancePP({x:l,y:h},{x:t,y:e}),p=((r-t)*(l-t)+(s-e)*(h-e))/(u*d),f=c/Math.sin(p/2),g=(r+l-2*t)/2,v=(s+h-2*e)/2,m=zt.distancePP({x:g,y:v},{x:0,y:0}),y=t+f*g/m,b=l+f*v/m,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/u,a=e+x*(s-e)/u,Bs(n,r,s,o,a),r=t+x*(l-t)/d,s=e+x*(h-e)/d;const w=Xt({x:y,y:b},{x:o,y:a}),A=Xt({x:y,y:b},{x:r,y:s});Ye(n,w,A,y,b,c,c);break}case Be.Z:n&&Bs(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function Rs(t,e){for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t+=2){const i=n[t],r=n[t+1],s={x:i,y:r};e.transformPoint({x:i,y:r},s),n[t]=s.x,n[t+1]=s.y}}}function Ms(t){const e=new Di;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}const ks=t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=q(t.width)?t.x1-t.x:t.width,i=q(t.height)?t.y1-t.y:t.height,n=0,r=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(r=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:r,width:e,height:i}};function Es(t,e,i){const n=t/e;let r,s;t>=e?(s=Math.ceil(Math.sqrt(i*n)),r=Math.floor(i/s),0===r&&(r=1,s=i)):(r=Math.ceil(Math.sqrt(i/n)),s=Math.floor(i/r),0===s&&(s=1,r=i));const o=[];for(let t=0;t<r;t++)o.push(s);const a=i-r*s;if(a>0)for(let t=0;t<a;t+=s)t+s<a?o.push(s):o.push(a-t);return o}const Os=(t,e)=>{const{width:i,height:n}=ks(t.attribute),r=Es(i,n,e),s=[],o=n/r.length;for(let t=0,e=r.length;t<e;t++){const e=r[t],n=i/e;for(let i=0;i<e;i++)s.push({x:0+i*n,y:0+t*o,width:n,height:o})}return s},Ls=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),o=t.getComputedAttribute("outerRadius"),a=Math.abs(n-r),l=Math.abs(o-s),h=Es(a*(s+o)/2,l,e),c=[],u=l/h.length,d=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=h.length;t<e;t++){const e=h[t],i=a/e;for(let r=0;r<e;r++)c.push({innerRadius:o-u*t*d,outerRadius:o-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Is=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=Es(s*r,r,e),a=[],l=s/o[0],h=r/o.length,c=n>=i?1:-1;for(let t=0,e=o.length;t<e;t++)for(let e=0,n=o[t];e<n;e++)a.push({innerRadius:h*t,outerRadius:h*(t+1),startAngle:i+l*e*c,endAngle:i+l*(e+1)*c});return a},Ds=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&st(t.x)&&st(t.y)));if(0===i.length)return[];if(1===i.length)return new Array(e).fill(0).map((t=>i[0]));const n=[];if(e<=i.length){const t=i.length/e;let r=0,s=0;for(;r<e;)n.push(i[Math.floor(s)]),s+=t,r++;return n}const r=e-i.length,s=1/(r/(i.length-1)+1);let o=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const a=t[e].x,l=t[e].y,h=t[e+1].x,c=t[e+1].y;for(;i<1&&o<r;)n.push({x:a+(h-a)*i,y:l+(c-l)*i}),i+=s,o+=1}return n},js=(t,e)=>{var i,n;const r=t.attribute;let s=r.points;const o=r.segments;s||(s=o.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const a=s.filter((t=>!1!==t.defined&&st(t.x)&&st(t.y)));if(!a.length)return[];const l=[];a.forEach((t=>{l.push({x:t.x,y:t.y})}));for(let t=a.length-1;t>=0;t--){const e=a[t];l.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const h=[];return zs(s,e,h),h},Us=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Ds(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return Ds(t,e)}return[]};const Ws=t=>t.map((t=>({x:t.x,y:t.y}))),Ns=(t,e,i)=>{const n=t.length,r=[];for(let a=0;a<n;a++){const l=t[a],h=a===n-1?t[0]:t[a+1],c=ve([e.x,e.y],[i.x,i.y],[l.x,l.y],[h.x,h.y]);c&&"boolean"!=typeof c&&r.push({dot:(s=[c[0]-e.x,c[1]-e.x],o=[i.x-e.x,i.y-e.x],s[0]*o[1]-s[1]*o[0]),point:{x:c[0],y:c[1]},edgeIndex:a})}var s,o;if(r.length<2)return[Ws(t),Ws(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],l=r[r.length-1];a.edgeIndex>l.edgeIndex&&([a,l]=[l,a]);const h=a.point,c=l.point,u=[{x:h.x,y:h.y}];for(let e=a.edgeIndex+1;e<=l.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:c.x,y:c.y});const d=[{x:c.x,y:c.y}];for(let e=l.edgeIndex+1,i=a.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:h.x,y:h.y}),[u,d]},Fs=t=>{const e=new Ht;t.forEach((t=>{e.add(t.x,t.y)}));const i=e.width(),n=e.height();if(i>=n){const n=e.x1+i/2;return Ns(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Ns(t,{x:e.x1,y:r},{x:e.x2,y:r})},zs=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Fs(t);zs(r[0],n,i),zs(r[1],e-n,i)}},Gs=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Ws(i)}];const n=[];return zs(i,e,n),n},Hs=(t,e)=>{const i=Ps(t.getParsedPathShape());if(!i.length||e<0)return[];const n=i.length;if(i.length>=e){const t=[],r=Math.floor(i.length/e);for(let s=0;s<e;s++){const o=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:Ms(o)})}return t}const r=[],s=Math.floor(e/n);let o=e;for(let t=0;t<n;t++){const e=[];for(let n=2,r=i[t].length;n<r;n+=2)e.push({x:i[0][n],y:i[0][n+1]});zs(e,t===n-1?o:s,r),o-=s}return r};var Vs;t.ColorType=void 0,(Vs=t.ColorType||(t.ColorType={}))[Vs.Color255=0]="Color255",Vs[Vs.Color1=1]="Color1";class Ys{static Get(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ColorType.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===t.ColorType.Color1){const t=Ys.store1[e];if(t)return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n;const i=se.parseColorString(e);if(i){const t=[i.r/255,i.g/255,i.b/255,i.opacity];Ys.store1[e]=t,Ys.store255[e]=[i.r,i.g,i.b,i.opacity],n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]}return n}const r=Ys.store255[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;const s=se.parseColorString(e);return s&&(Ys.store1[e]=[s.r/255,s.g/255,s.b/255,s.opacity],Ys.store255[e]=[s.r,s.g,s.b,s.opacity],n[0]=s.r,n[1]=s.g,n[2]=s.b,n[3]=s.opacity),n}static Set(e,i,n){if(i===t.ColorType.Color1){if(Ys.store1[e])return;Ys.store1[e]=n,Ys.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Ys.store255[e])return;Ys.store255[e]=n,Ys.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Xs(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&st(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function $s(t,e,i,n,r){return Array.isArray(t)&&!st(t[0])||Array.isArray(e)&&!st(e[0])?new Array(4).fill(0).map(((r,s)=>qs(nt(t)?t[s]:t,nt(e)?e[s]:e,i,n))):qs(t,e,i,n,r)}function qs(e,i,n,r,s){if(!e||!i)return e&&Xs(e)||i&&Xs(i)||!1;let o,a,l=!1,h=!1;if(Array.isArray(e)?o=e:"string"==typeof e?o=Ys.Get(e,t.ColorType.Color255):l=!0,Array.isArray(i)?a=i:"string"==typeof i?a=Ys.Get(i,t.ColorType.Color255):h=!0,l!==h){const t=l?e:i,o=l?i:e,a=Object.assign(Object.assign({},t),{stops:t.stops.map((t=>Object.assign(Object.assign({},t),{color:Xs(o)})))});return l?$s(t,a,n,r,s):$s(a,t,n,r,s)}if(l){if(e.gradient===i.gradient){const t=e,r=i,s=t.stops,o=r.stops;if(s.length!==o.length)return!1;if("linear"===t.gradient)return Ks(t,r,n);if("radial"===t.gradient)return Zs(t,r,n);if("conical"===t.gradient)return Js(t,r,n)}return!1}return s&&s(o,a),Xs(Qs(o,a,n),r)}function Ks(t,e,i){const n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:io(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Zs(t,e,i){const n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:io(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Js(t,e,i){const n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:io(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Qs(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}Ys.store255={},Ys.store1={};const to=[0,0,0,0],eo=[0,0,0,0];function io(e,i,n){return Ys.Get(e,t.ColorType.Color255,to),Ys.Get(i,t.ColorType.Color255,eo),`rgba(${Math.round(to[0]+(eo[0]-to[0])*n)},${Math.round(to[1]+(eo[1]-to[1])*n)},${Math.round(to[2]+(eo[2]-to[2])*n)},${to[3]+(eo[3]-to[3])*n})`}const no=(t,e,i)=>{t.forEach((t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){const n=$s(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},ro=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,l=o.to,h=o.rotation*i,c=o.fromCp,u=o.toCp,d=Math.sin(h),p=Math.cos(h);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<a.length;t+=2){const e=a[t],s=a[t+1],o=e*(1-i)+l[t]*i,h=s*(1-i)+l[t+1]*i;n[t]=o*p-h*d+r[0],n[t+1]=o*d+h*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<a.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],o=n[t+3],a=n[t+4],l=n[t+5];f===i&&g===r&&s===a&&o===l?e.lineTo(a,l):e.bezierCurveTo(i,r,s,o,a,l),f=a,g=l}}},so=(t,e,i)=>{const n=t?Ps(t):[],r=Ps(e);i&&n&&(i.fromTransform&&Rs(n,i.fromTransform.clone().getInverse()),Rs(n,i.toTransfrom));const[s,o]=_s(n,r);return t?Cs(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},oo=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],ao=(e,i)=>{if(!e||!i)return null;const n=[];let r=!1;return Object.keys(e).forEach((s=>{if(!oo.includes(s))return;const o=i[s];q(o)||q(e[s])||o===e[s]||("fill"===s||"stroke"===s?n.push({from:"string"==typeof e[s]?Ys.Get(e[s],t.ColorType.Color255):e[s],to:"string"==typeof o?Ys.Get(o,t.ColorType.Color255):o,key:s}):n.push({from:e[s],to:o,key:s}),r=!0)})),r?n:null};class lo extends Xr{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;ro(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&no(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const ho=(t,e,i,n)=>{var r,s,o;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let a=null==t?void 0:t.globalTransMatrix;n&&a&&(a=n.clone().multiply(a.a,a.b,a.c,a.d,a.e,a.f));const l=so(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:a,toTransfrom:e.globalTransMatrix}),h=ao(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new lo({morphingData:l,otherAttrs:h},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:Qr.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:Qr.easing)),c};class co extends Xr{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{var n;ro(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&no(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const uo=t=>{const e={};return Object.keys(t).forEach((i=>{ds(i)||(e[i]=t[i])})),e},po=(t,e,i)=>{const n=uo(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:n}),e.forEach((t=>{r.appendChild(t)}));else{const s=t.AABBBounds,o=s.width(),a=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=pn.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},fo=(t,e,i)=>{const n=[],r=i?null:uo(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Di).fromCustomPath2D(s)};n.push(pn.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&po(t,n,e),n},go=(t,e,i)=>{const n=[],r=i?null:uo(t.attribute);if("rect"===t.type)Os(t,e).forEach((t=>{n.push(pn.graphicService.creator.rect(i?t:Object.assign({},r,t)))}));else if("arc"===t.type)Ls(t,e).forEach((t=>{n.push(pn.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("circle"===t.type)Is(t,e).forEach((t=>{n.push(pn.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("line"===t.type){const s=Us(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(pn.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else"polygon"===t.type?Gs(t,e).forEach((t=>{n.push(pn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"area"===t.type?js(t,e).forEach((t=>{n.push(pn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"path"===t.type&&Hs(t,e).forEach((t=>{"path"in t?n.push(pn.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(pn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}));return i&&po(t,n,e),n};class vo{static GetImage(t,e){var i;const n=vo.cache.get(t);n?"fail"===n.loadState?pn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):vo.loadImage(t,e)}static GetSvg(t,e){var i;let n=vo.cache.get(t);n?"fail"===n.loadState?pn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},vo.cache.set(t,n),n.dataPromise=pn.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=vo.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},vo.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=pn.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=pn.global.loadBlob(t):"json"===e&&(i.dataPromise=pn.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!vo.isLoading&&vo.toLoadAueue.length){vo.isLoading=!0;const t=vo.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,r={type:"image",loadState:"init"};if(vo.cache.set(i,r),r.dataPromise=pn.global.loadImage(i),r.dataPromise){r.waitingMark=n;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(i,t.data)):(r.loadState="fail",e.imageLoadFail(i))}))}));e.push(t)}else r.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{vo.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),vo.loading()})).catch((t=>{console.error(t),vo.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),vo.loading()}))}}),0)}static loadImage(t,e){const i=mo(t,vo.toLoadAueue);if(-1!==i)return vo.toLoadAueue[i].marks.push(e),void vo.loading();vo.toLoadAueue.push({url:t,marks:[e]}),vo.loading()}static improveImageLoading(t){const e=mo(t,vo.toLoadAueue);if(-1!==e){const t=vo.toLoadAueue.splice(e,1);vo.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function mo(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}vo.cache=new Map,vo.isLoading=!1,vo.toLoadAueue=[],vo.onLoadSuccessCb=[];const yo=new $t,bo=new Vt,xo=["lineWidth","scaleX","scaleY","angle","anchor","visible"],wo=["x","y"],Ao=["scaleX","scaleY"],So=["angle"],To=new Ft,Co={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class _o extends Br{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(_o.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var i;super(),this._AABBBounds=new Vt,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background?this.loadImage(null!==(i=e.background.background)&&void 0!==i?i:e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;To.x=r+(null!==(i=t.scrollX)&&void 0!==i?i:0),To.y=s+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else To.x=r,To.y=s;return To}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;pn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return pn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new $t),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new Ft(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);s?this._setAttributes(s,i,n):q(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xo;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xo;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background?this.loadImage(e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic),this._updateTag=t.UpdateTag.INIT,this.valid=this.isValid(),this.onAttributeUpdate(i)}translate(e,i){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,wo,s);o&&(e=o.x,i=o.y,delete o.x,delete o.y,this._setAttributes(o));const a=this.attribute,l=a.postMatrix;return l?pn.transformUtil.fromMatrix(l,l).translate(e,i):(a.x=(null!==(n=a.x)&&void 0!==n?n:Ni.x)+e,a.y=(null!==(r=a.y)&&void 0!==r?r:Ni.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,wo,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){var r,s;if(1===e&&1===i)return this;const o={type:t.AttributeUpdateType.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,Ao,o);a&&(e=a.scaleX,i=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const l=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new $t,l.postMatrix=t),pn.transformUtil.fromMatrix(t,t).scale(e,i,n)}else l.scaleX=(null!==(r=l.scaleX)&&void 0!==r?r:Ni.scaleX)*e,l.scaleY=(null!==(s=l.scaleY)&&void 0!==s?s:Ni.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,Ao,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}rotate(e,i){var n;if(0===e)return this;const r={type:t.AttributeUpdateType.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:i},this.attribute,So,r);s&&(delete s.angle,this._setAttributes(s,!1,r));const o=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new $t,o.postMatrix=t),pn.transformUtil.fromMatrix(t,t).rotate(e,i)}else o.angle=(null!==(n=o.angle)&&void 0!==n?n:Ni.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}rotateTo(e){const i=this.attribute;if(i.angle===e)return this;const n={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,So,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new qr(null==t?void 0:t.id,this.stage&&this.stage.getTimeline()).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(pn.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!q(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,o,a,l;if(n){const n=Object.keys(e),h=this.getNoWorkAnimateAttr(),c={};let u;n.forEach((t=>{h[t]?(u||(u={}),u[t]=e[t]):c[t]=r&&void 0===e[t]?this.getDefaultAttribute(t):e[t]}));const d=this.animate();d.stateNames=i,d.to(c,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==o?o:Jr.duration,null!==(l=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==l?l:Jr.easing),u&&this.setAttributes(u,!1,{type:t.AttributeUpdateType.STATE})}else this.stopStateAnimates(),this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();ct(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return bo.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(bo),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=n();i[0]=r.x1+(r.x2-r.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=n();i[1]=r.y1+(r.y2-r.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Ni.x,y:e=Ni.y,scaleX:i=Ni.scaleX,scaleY:n=Ni.scaleY,angle:r=Ni.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute;let l=[0,0];const h={};if(o&&(l=this.getAnchor(o,h)),!s||1===i&&1===n)!function(t,e,i,n,r,s,o,a){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,f=Mt(o),g=Ot(o);let v,m;a?(v=a[0],m=a[1]):(v=i,m=n);const y=v-i,b=m-n,x=l*f+c*g,w=h*f+u*g,A=c*f-l*g,S=u*f-h*g;t.a=r*x,t.b=r*w,t.c=s*A,t.d=s*S,t.e=d+l*v+c*m-x*y-A*b,t.f=p+h*v+u*m-w*y-S*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,o&&l);else{const o=this._transMatrix;o.reset(),o.translate(l[0],l[1]),o.rotate(r),o.translate(-l[0],-l[1]),o.translate(t,e),l=this.getAnchor(s,h),pn.transformUtil.fromMatrix(o,o).scale(i,n,{x:l[0],y:l[1]})}const c=this.getOffsetXY(Ni);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,a){const t=yo.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),pn.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const o={};if(n.customAnimate)n.customAnimate.update(s,r,o);else{const t=n.props,a=n.parsedProps,l=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,l)}this.setAttributes(o,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,o,a,l,h){h||(h=Object.keys(o),n.propKeys=h),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):h.forEach((s=>{var h;if(!e.validAttr(s))return;const c=o[s],u=null!==(h=a&&a[s])&&void 0!==h?h:t.getLastPropByName(s,n);if(null==c||null==u)return void(i[s]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,l,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=l}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const o=r.fillColorArray,a=$s(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){r||(r={});const o=r.strokeColorArray,a=$s(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){r||(r={});const o=r.shadowColorArray,a=$s(e,null!=o?o:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(n[i]=a),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return Tr(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:pn.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return it(t,!0)?this.pathProxy=(new Di).fromString(t):this.pathProxy=new Di,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(vo.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(at(t)||t.includes("/")||lt(t))&&(vo.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):Z(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",pn.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Er(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}_o.mixin(Dr);class Bo{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Po(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function Ro(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let r=n.data;const s=n.index,o=r.search(/\s/);let a=r,l=!0;-1!==o&&(a=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));const h=a;if(i){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),l=a!==n.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:l,rawTagName:h}}const Mo=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class ko{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const r=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t<s;t++)r.push(n[t]);i.push(r),n=e.exec(t)}return i}(t,Mo),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],i=r[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Bo("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=Po(t,">",s,"Closing Tag is not closed."),o=r.lastIndexOf(".");r=r.substring(0,o),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",s=e}else if("?"===t[s+1])s=Ro(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=Po(t,"--\x3e",s+4,"Comment is not closed.");else{const o=Ro(t,s,!1);let a=o.tagName,l=o.tagExp;const h=o.attrExpPresent,c=o.closeIndex;if(a!==e.tagname&&(r+=r?"."+a:a),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),l=a):l=l.substr(0,l.length-1);const t=new Bo(a);a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Bo(a);this.tagsNodeStack.push(i),a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(i,t,r),i=t}n="",s=c}else n+=t[s];return e.child}}function Eo(t,e){return Oo(t)}function Oo(t,e){const i={};for(let e=0;e<t.length;e++){const r=t[e],s=Lo(r);if(void 0!==s&&r[s]){const t=Oo(r[s]);n=t,Object.keys(n).length,r[":@"]&&Io(t,r[":@"]),void 0!==i[s]&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(t)):i[s]=t}}var n;return i}function Lo(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Io(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let r=0;r<n;r++){const n=i[r];t[n]=e[n]}}}class Do{constructor(t){this.options=Object.assign({},Do.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Eo(new ko(this.options).parseXml(t),this.options)}}function jo(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function Uo(t){return t.startsWith("<")}Do.defaultOptions={};var Wo=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};function No(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let Fo=0;function zo(){return Fo++}var Go;function Ho(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)Xo(e[s])?n?r+=e[s]:(n=1,r=e[s]):(n&&(i.push({text:r,direction:t.TextDirection.VERTICAL}),r="",n=0),i.push({text:e[s],direction:t.TextDirection.HORIZONTAL}));return r&&i.push({text:r,direction:t.TextDirection.VERTICAL}),i}t.TextDirection=void 0,(Go=t.TextDirection||(t.TextDirection={}))[Go.HORIZONTAL=0]="HORIZONTAL",Go[Go.VERTICAL=1]="VERTICAL";const Vo=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Vo.set(t,!0)));const Yo=new Map;function Xo(t){if(Vo.has(t))return!0;if(Yo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function $o(t,e){const i=t.attribute;i&&i.split(";").forEach((t=>{if(!t)return;const i=t.split(":");if(2===i.length){const t=parseFloat(i[1]);e[i[0].trim()]=isFinite(t)?t:i[1].trim()}else{let t="";for(let e=1;e<i.length;e++)e>1&&(t+=":"),t+=i[e].trim();e[i[0].trim()]=t}}))}[""].forEach((t=>Yo.set(t,!0)));const qo=zo(),Ko=zo(),Zo=zo(),Jo=zo(),Qo=zo(),ta=zo(),ea=zo(),ia=zo(),na=zo(),ra=zo(),sa=zo(),oa=zo(),aa=zo(),la=zo(),ha=zo(),ca=zo(),ua=Symbol.for("GraphicService"),da=Symbol.for("GraphicCreator"),pa={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},fa=Object.keys(pa),ga={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},va=Object.keys(ga);var ma;t.GroupUpdateAABBBoundsMode=void 0,(ma=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[ma.LESS_GROUP=0]="LESS_GROUP",ma[ma.MORE_GROUP=1]="MORE_GROUP";class ya extends _o{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=ta,this._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Ar),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Ar)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren((t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}showAll(){this.setAttribute("visible",!0),this.forEachChildren((t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}containsPoint(e,i,n){if(n===t.IContainPointMode.GLOBAL){const t=new Ft(e,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),this.AABBBounds.contains(t.x,t.y)}return this.AABBBounds.contains(e,i)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;pn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),pn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Ni.x,y:e=Ni.y,dx:i=Ni.dx,dy:n=Ni.dy,scaleX:r=Ni.scaleX,scaleY:s=Ni.scaleY,angle:o=Ni.angle,postMatrix:a}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==r||1!==s||0!==o||a)return super.doUpdateLocalMatrix();this._transMatrix.reset()}doUpdateAABBBounds(){const t=this.attribute,e=Tr(this).group;this._AABBBounds.clear();const i=pn.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=rs(n);return r&&i.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),pn.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),pn.graphicService.onClearIncremental(this,this.stage)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,pn.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{pn.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),pn.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=pn.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new ya(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ya.NOWORK_ANIMATE_ATTR}}function ba(t){return new ya(t)}ya.NOWORK_ANIMATE_ATTR=Co;class xa extends ya{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=n.layerHandler,this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Ar,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{pn.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{pn.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const wa=Symbol.for("TransformUtil"),Aa=Symbol.for("GraphicUtil"),Sa=Symbol.for("LayerService"),Ta=Symbol.for("StaticLayerHandlerContribution"),Ca=Symbol.for("DynamicLayerHandlerContribution"),_a=Symbol.for("VirtualLayerHandlerContribution");var Ba,Pa=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ra=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.DefaultLayerService=Ba=class{static GenerateLayerId(){return`${Ba.idprefix}_${Ba.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=pn.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?Bn.get(Ta):"dynamic"===t?Bn.get(Ca):Bn.get(_a),e}createLayer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};var i;this.tryInit();let n=this.getRecommendedLayerType(e.layerMode);n=e.main||e.canvasId?"static":n;const r=this.getLayerHandler(n),s=new xa(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:n,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:Ba.GenerateLayerId(),layerHandler:r})),o=this.layerMap.get(t)||[];return o.push(s),this.layerMap.set(t,o),this.staticLayerCountInEnv--,s}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}},t.DefaultLayerService.idprefix="visactor_layer",t.DefaultLayerService.prefix_count=0,t.DefaultLayerService=Ba=Pa([g(),Ra("design:paramtypes",[])],t.DefaultLayerService);var Ma=new i((e=>{e(W).to(t.DefaultGlobal).inSingletonScope(),e(cr).to(t.DefaultWindow),e(Aa).to(t.DefaultGraphicUtil).inSingletonScope(),e(wa).to(t.DefaultTransformUtil).inSingletonScope(),e(Sa).to(t.DefaultLayerService).inSingletonScope()}));function ka(t,e){return!(!t&&!e)}function Ea(t,e){let i;return i=nt(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Oa(t,e,i){return i&&t*e>0}function La(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function Ia(t,e){return t*e>0}function Da(t,e,i,n){return t*e>0&&0!==i&&0!==n}function ja(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const l=Tr(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:f=l.strokeOpacity,visible:g=l.visible,x:v=l.x,y:m=l.y}=t.attribute,y=Oa(u,d,h),b=Ia(u,f),x=ka(h),w=Ea(c,p);if(!g)return!0;if(!x&&!w)return!0;if(!(y||b||o||a))return!0;e.beginPath();return $e(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i-v,n-m,l),e.stroke())),x&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,i-v,n-m,l),e.fill())),!0}function Ua(t,e,i,n,r,s,o,a){const l=i-t,h=n-e,c=o-r,u=a-s;let d=u*l-c*h;return d*d<St?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*l,e+d*h])}function Wa(t,e,i,n,r,s,o){const a=t-i,l=e-n,h=(o?s:-s)/Math.sqrt(a*a+l*l),c=h*l,u=-h*a,d=t+c,p=e+u,f=i+c,g=n+u,v=(d+f)/2,m=(p+g)/2,y=f-d,b=g-p,x=y*y+b*b,w=r-s,A=d*g-f*p,S=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-A*A));let T=(A*b-y*S)/x,C=(-A*y-b*S)/x;const _=(A*b+y*S)/x,B=(-A*y+b*S)/x,P=T-v,R=C-m,M=_-v,k=B-m;return P*P+R*R>M*M+k*k&&(T=_,C=B),{cx:T,cy:C,x01:-c,y01:-u,x11:T*(r/w-1),y11:C*(r/w-1)}}function Na(t,e,i,n,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=Pt(l-a),c=l>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=St)e.moveTo(i,n);else if(h>=Bt-St)e.moveTo(i+r*Mt(a),n+r*Ot(a)),e.arc(i,n,r,a,l,!c),s>St&&(e.moveTo(i+s*Mt(l),n+s*Ot(l)),e.arc(i,n,s,l,a,c));else{const d=t.getParsedCornerRadius(),p=nt(d),{outerDeltaAngle:f,innerDeltaAngle:g,outerStartAngle:v,outerEndAngle:m,innerEndAngle:y,innerStartAngle:b}=t.getParsePadAngle(a,l),x=p?d[0]:d,w=p?d[1]:d,A=p?d[2]:d,S=p?d[3]:d,T=Math.max(w,x),C=Math.max(A,S);let _=T,B=C;const P=r*Mt(v),R=r*Ot(v),M=s*Mt(y),k=s*Ot(y);let E,O,L,I;if((C>St||T>St)&&(E=r*Mt(m),O=r*Ot(m),L=s*Mt(b),I=s*Ot(b),h<Tt)){const t=Ua(P,R,L,I,E,O,M,k);if(t){const e=P-t[0],i=R-t[1],n=E-t[0],o=O-t[1],a=1/Ot(Dt((e*n+i*o)/(Lt(e*e+i*i)*Lt(n*n+o*o)))/2),l=Lt(t[0]*t[0]+t[1]*t[1]);B=Et(C,(s-l)/(a-1)),_=Et(T,(r-l)/(a+1))}}if(f<.001)o&&(o[3]||o[1])&&e.moveTo(i+P,n+R),u=!0;else if(_>St){const t=Et(x,_),s=Et(w,_),a=Wa(L,I,P,R,r,t,Number(c)),l=Wa(E,O,M,k,r,s,Number(c));_<T&&t===s?!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,_,Rt(a.y01,a.x01),Rt(l.y01,l.x01),!c)):e.moveTo(i+a.cx+_*Mt(Rt(l.y01,l.x01)),n+a.cy+_*Ot(Rt(l.y01,l.x01))):!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),t>0&&e.arc(i+a.cx,n+a.cy,t,Rt(a.y01,a.x01),Rt(a.y11,a.x11),!c),e.arc(i,n,r,Rt(a.cy+a.y11,a.cx+a.x11),Rt(l.cy+l.y11,l.cx+l.x11),!c),s>0&&e.arc(i+l.cx,n+l.cy,s,Rt(l.y11,l.x11),Rt(l.y01,l.x01),!c)):s>0?e.moveTo(i+l.cx+s*Mt(Rt(l.y01,l.x01)),n+l.cy+s*Ot(Rt(l.y01,l.x01))):e.moveTo(i+E,n+r*Ot(m))}else!o||o[0]?(e.moveTo(i+P,n+R),e.arc(i,n,r,v,m,!c)):e.moveTo(i+r*Mt(m),n+r*Ot(m));if(!(s>St)||g<.001)!o||o[1]?e.lineTo(i+M,n+k):e.moveTo(i+M,n+k),u=!0;else if(B>St){const t=Et(S,B),r=Et(A,B),a=Wa(M,k,E,O,s,-r,Number(c)),l=Wa(P,R,L,I,s,-t,Number(c));if(!o||o[1]?e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01):e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),B<C&&t===r){const t=Rt(l.y01,l.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,B,Rt(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+Mt(t),n+a.cy+Ot(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,Rt(a.y01,a.x01),Rt(a.y11,a.x11),!c),e.arc(i,n,s,Rt(a.cy+a.y11,a.cx+a.x11),Rt(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(i+l.cx,n+l.cy,t,Rt(l.y11,l.x11),Rt(l.y01,l.x01),!c)):t>0?e.moveTo(i+l.cx+t*Mt(Rt(l.y01,l.x01)),n+l.cy+t*Ot(Rt(l.y01,l.x01))):e.moveTo(i+L,n+I)}else!o||o[1]?e.lineTo(i+M,n+k):e.moveTo(i+M,n+k),!o||o[2]?e.arc(i,n,s,y,b,c):e.moveTo(i+s*Mt(b),n+s*Ot(b))}return o?o[3]&&e.lineTo(i+r*Mt(a),n+r*Ot(a)):e.closePath(),u}class Fa{static GetCanvas(){try{return Fa.canvas||(Fa.canvas=pn.global.createCanvas({})),Fa.canvas}catch(t){return null}}static GetCtx(){if(!Fa.ctx){const t=Fa.GetCanvas();Fa.ctx=t.getContext("2d")}return Fa.ctx}}class za extends qt{static getInstance(){return za._instance||(za._instance=new za),za._instance}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Fa.GetCanvas(),n=Fa.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,o=`${t}${e}${i}${n}`;r.forEach((t=>o+=t.join())),o+=s;let a=this.dataMap.get(o);return a||(a={data:new za(r,s),timestamp:[]},this.addLimitedTimestamp(a,Date.now(),{}),this.dataMap.set(o,a)),this.clearCache(this.dataMap,this.cacheParams),a.data}}class Ga{static GetSize(t){for(let e=0;e<Ga.ImageSize.length;e++)if(Ga.ImageSize[e]>=t)return Ga.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=Ga.GenKey(t,e,i,n,r),l=Ga.cache[a];if(!l||0===l.length)return null;for(let t=0;t<l.length;t++)if(l[t].width>=s&&l[t].height>=o)return l[t].pattern;return null}static Set(t,e,i,n,r,s,o,a){const l=Ga.GenKey(t,e,i,n,r);Ga.cache[l]?Ga.cache[l].push({width:o,height:a,pattern:s}):Ga.cache[l]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function Ha(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=Bt;for(;i>Bt;)i-=Bt;if(i<s)return r[0].color;if(i>o)return r[0].color;let a,l,h=(i-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=h){a=r[t-1],l=r[t];break}return h=(h-a.offset)/(l.offset-a.offset),$s(a.color,l.color,h,!1)}function Va(t,e,i,n,r,s,o,a,l){const h=Math.floor(180*r/Math.PI),c=Fa.GetCanvas(),u=Fa.GetCtx();if(!u)return null;const d=Ga.GetSize(a),p=Ga.GetSize(l);let f=Ga.Get(e,i,n,s,o,d,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),v=h+1,m=r/Math.max(1,v-1),y=za.getInstance().GetOrCreate(i,n,d,p,e,v),b=2*Math.PI*g/360;c.width=d,c.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=v-1;t<e&&!(s+t*m>o);t++){const e=y.getColor(t);u.beginPath(),u.rotate(m),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&Ga.Set(e,i,n,s,o,f,d,p),f}Ga.cache={},Ga.ImageSize=[20,40,80,160,320,640,1280,2560];const Ya=Symbol.for("ArcRenderContribution"),Xa=Symbol.for("AreaRenderContribution"),$a=Symbol.for("CircleRenderContribution"),qa=Symbol.for("GroupRenderContribution"),Ka=Symbol.for("ImageRenderContribution"),Za=Symbol.for("PathRenderContribution"),Ja=Symbol.for("PolygonRenderContribution"),Qa=Symbol.for("RectRenderContribution"),tl=Symbol.for("SymbolRenderContribution"),el=Symbol.for("TextRenderContribution"),il=Symbol.for("CommonRenderContribution"),nl=Symbol.for("InteractiveSubRenderContribution"),rl=["radius","startAngle","endAngle",...xo];class sl extends _o{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=Jo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}doUpdateAABBBounds(t){const e=Tr(this).circle;this._AABBBounds.clear();const i=this.attribute,n=pn.graphicService.updateCircleAABBBounds(i,Tr(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=rs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,rl)}needUpdateTag(t){return super.needUpdateTag(t,rl)}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),a=new Di;return a.arc(0,0,r,s,o),a}clone(){return new sl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sl.NOWORK_ANIMATE_ATTR}}function ol(t){return new sl(t)}function al(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*i+"px "+(a||"sans-serif")}function ll(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0}function hl(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function cl(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function ul(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[we(i)]=t[i])})),["fontSize","lineHeight"].forEach((n=>{const r=we(n);q(t[n])||(e[r]=i(t[n]))})),K(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&it(t.fill)&&(e.color=t.fill),e}sl.NOWORK_ANIMATE_ATTR=Co;class dl{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,s,o,a,l){const h=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a,l);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?u[0]=c[0]/-2:"right"!==n&&"end"!==n||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,h,n,r,s)}GetLayoutByLines(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((t=>t.toString()));const l=[],h=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),o),l.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s,a).str,width:e});h[0]=o}else{let e,i;o=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),o=Math.max(o,e),l.push({str:i,width:e});h[0]=o}h[1]=l.length*n,h[0]=l.reduce(((t,e)=>Math.max(t,e.width)),0);const c={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(c,e,i),this.layoutWithBBox(c,l,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],o=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-o)/2:"bottom"===n&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const pl=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...xo];class fl extends _o{get font(){const t=Tr(this).text;return this._font||(this._font=al(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=Tr(this).text;if(!this.isSimplify())return;const{maxLineWidth:n=i.maxLineWidth}=e;return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=Tr(this).text,e=this.attribute;if(this.isMultiLine)return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),"vertical"===e.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==e.text.toString():null!=this.clipedText&&this.clipedText!==e.text.toString())}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=ca,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return nt(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}doUpdateAABBBounds(){const t=Tr(this).text;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateWrapAABBBounds(t){var e,i,n,r;const s=Tr(this).text,{fontFamily:o=s.fontFamily,textAlign:a=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:d=s.stroke,lineWidth:p=s.lineWidth,wordBreak:f=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:v=s.ignoreBuf,suffixPosition:m=s.suffixPosition,heightLimit:y=0,lineClamp:b}=this.attribute,x=null!==(e=vs(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,w=v?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const A=pn.graphicUtil.textMeasure,S=new dl(o,{fontSize:h,fontWeight:g,fontFamily:o},A),T=nt(t)?t.map((t=>t.toString())):[t.toString()],C=[],_=[0,0];let B=1/0;if(y>0&&(B=Math.max(Math.floor(y/x),1)),b&&(B=Math.min(B,b)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<T.length;t++){const e=T[t];let i=!0;if(t===B-1){const i=S.textMeasure.clipTextWithSuffix(e,S.textOptions,u,c,!1,m,t!==T.length-1);C.push({str:i.str,width:i.width});break}const s=S.textMeasure.clipText(e,S.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=S.textMeasure.clipTextWithSuffix(e,S.textOptions,u,c,!1,m);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;i=!1}if(C.push({str:s.str,width:s.width}),s.str.length===e.length);else if(i){const i=e.substring(s.str.length);T.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,i=0;for(let n=0,r=T.length;n<r;n++){if(n===B-1){const t=S.textMeasure.clipTextWithSuffix(T[n],S.textOptions,u,c,!1,m);C.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=T[n],t=S.textMeasure.measureTextWidth(e,S.textOptions,"break-word"===f),i=Math.max(i,t),C.push({str:e,width:t})}_[0]=i}_[1]=C.length*(x+w);const P={xOffset:0,yOffset:0,width:_[0],height:_[1]};S.LayoutBBox(P,a,l);const R=S.layoutWithBBox(P,C,a,l,x);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=Tr(this).text,{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),r}updateMultilineAABBBounds(t){const e=Tr(this).text,{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),r}updateHorizontalSinglelineAABBBounds(t){var e,i;const n=Tr(this).text,{wrap:r=n.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds([t]);const s=pn.graphicUtil.textMeasure;let o,a;const l=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:c=n.ellipsis,textAlign:u=n.textAlign,textBaseline:d=n.textBaseline,fontFamily:p=n.fontFamily,fontSize:f=n.fontSize,fontWeight:g=n.fontWeight,stroke:v=n.stroke,lineWidth:m=n.lineWidth,ignoreBuf:y=n.ignoreBuf,whiteSpace:b=n.whiteSpace,suffixPosition:x=n.suffixPosition}=l;if("normal"===b)return this.updateWrapAABBBounds(t);const w=y?0:Math.max(2,.075*f),A=l.fontSize||n.fontSize,S=null!==(e=vs(l.lineHeight,A))&&void 0!==e?e:A+w;if(!this.shouldUpdateShape()&&this.cache){o=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=hl(u,o),e=cl(d,S,f);return this._AABBBounds.set(t,e,t+o,e+S),v&&this._AABBBounds.expand(m/2),this._AABBBounds}if(Number.isFinite(h)){if(c){const e=!0===c?n.ellipsis:c,i=s.clipTextWithSuffix(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p},h,e,!1,x);a=i.str,o=i.width}else{const e=s.clipText(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p},h,!1);a=e.str,o=e.width}this.cache.clipedText=a,this.cache.clipedWidth=o}else o=s.measureTextWidth(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=o;this.clearUpdateShapeTag();const T=hl(u,o);let C=S;pn.global&&pn.global.isSafari()&&(C+=.2*f);const _=cl(d,C,f,w);return this._AABBBounds.set(T,_,T+o,_+C),v&&this._AABBBounds.expand(m/2),this._AABBBounds}getBaselineMapAlign(){return fl.baselineMapAlign}getAlignMapBaseline(){return fl.alignMapBaseline}updateVerticalSinglelineAABBBounds(e){var i,n,r;const s=Tr(this).text,o=pn.graphicUtil.textMeasure;let a;const l=this.attribute,{ignoreBuf:h=s.ignoreBuf}=l,c=h?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontSize:p=s.fontSize,fontWeight:f=s.fontWeight,fontFamily:g=s.fontFamily,stroke:v=s.stroke,lineWidth:m=s.lineWidth,verticalMode:y=s.verticalMode,suffixPosition:b=s.suffixPosition}=l,x=null!==(i=vs(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==i?i:(l.fontSize||s.fontSize)+c;let{textAlign:w=s.textAlign,textBaseline:A=s.textBaseline}=l;if(!y){const t=w;w=null!==(n=fl.baselineMapAlign[A])&&void 0!==n?n:"left",A=null!==(r=fl.alignMapBaseline[t])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){a=this.cache.clipedWidth;const t=hl(w,a),e=cl(A,x,p);return this._AABBBounds.set(e,t,e+x,t+a),v&&this._AABBBounds.expand(m/2),this._AABBBounds}let S=[Ho(e.toString())];if(Number.isFinite(u)){if(d){const t=!0===d?s.ellipsis:d,e=o.clipTextWithSuffixVertical(S[0],{fontSize:p,fontWeight:f,fontFamily:g},u,t,!1,b);S=[e.verticalList],a=e.width}else{const t=o.clipTextVertical(S[0],{fontSize:p,fontWeight:f,fontFamily:g},u,!1);S=[t.verticalList],a=t.width}this.cache.verticalList=S,this.cache.clipedWidth=a}else a=0,S[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?p:o.measureTextWidth(e.text,{fontSize:p,fontWeight:f,fontFamily:g});a+=i,e.width=i})),this.cache.verticalList=S,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const T=hl(w,a),C=cl(A,x,p);return this._AABBBounds.set(C,T,C+x,T+a),v&&this._AABBBounds.expand(m/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const n=Tr(this).text,{wrap:r=n.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds(t);const s=this.attribute,{fontFamily:o=n.fontFamily,textAlign:a=n.textAlign,textBaseline:l=n.textBaseline,fontSize:h=n.fontSize,fontWeight:c=n.fontWeight,ellipsis:u=n.ellipsis,maxLineWidth:d,stroke:p=n.stroke,lineWidth:f=n.lineWidth,whiteSpace:g=n.whiteSpace,suffixPosition:v=n.suffixPosition}=s,m=null!==(e=vs(s.lineHeight,s.fontSize||n.fontSize))&&void 0!==e?e:s.fontSize||n.fontSize;if("normal"===g)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const y=pn.graphicUtil.textMeasure,b=new dl(o,{fontSize:h,fontWeight:c,fontFamily:o},y).GetLayoutByLines(t,a,l,m,!0===u?n.ellipsis:u||void 0,!1,d,v),{bbox:x}=b;return this.cache.layoutData=b,this.clearUpdateShapeTag(),this._AABBBounds.set(x.xOffset,x.yOffset,x.xOffset+x.width,x.yOffset+x.height),p&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i,n,r;const s=Tr(this).text,o=pn.graphicUtil.textMeasure;let a;const l=this.attribute,{ignoreBuf:h=s.ignoreBuf}=l,c=h?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontFamily:p=s.fontFamily,fontSize:f=s.fontSize,fontWeight:g=s.fontWeight,stroke:v=s.stroke,lineWidth:m=s.lineWidth,verticalMode:y=s.verticalMode,suffixPosition:b=s.suffixPosition}=l,x=null!==(i=vs(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==i?i:(l.fontSize||s.fontSize)+c;let{textAlign:w=s.textAlign,textBaseline:A=s.textBaseline}=l;if(!y){const t=w;w=null!==(n=fl.baselineMapAlign[A])&&void 0!==n?n:"left",A=null!==(r=fl.alignMapBaseline[t])&&void 0!==r?r:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=kt(e,a)}));const t=hl(w,a),e=this.cache.verticalList.length*x,i=cl(A,e,f);return this._AABBBounds.set(i,t,i+e,t+a),v&&this._AABBBounds.expand(m/2),this._AABBBounds}const S=e.map((t=>Ho(t.toString())));S.forEach(((e,i)=>{if(Number.isFinite(u))if(d){const t=!0===d?s.ellipsis:d,n=o.clipTextWithSuffixVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,t,!1,b);S[i]=n.verticalList,a=n.width}else{const t=o.clipTextVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,!1);S[i]=t.verticalList,a=t.width}else a=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?f:o.measureTextWidth(e.text,{fontSize:f,fontWeight:g,fontFamily:p});a+=i,e.width=i}))})),this.cache.verticalList=S,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=kt(e,a)}));const T=hl(w,a),C=this.cache.verticalList.length*x,_=cl(A,C,f);return this._AABBBounds.set(_,T,_+C,T+a),v&&this._AABBBounds.expand(m/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).text[t]}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pl;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pl;return super.needUpdateTag(t,e)}clone(){return new fl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fl.NOWORK_ANIMATE_ATTR}}function gl(t){return new fl(t)}fl.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Co),fl.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fl.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const vl=["heightLimit","lineClamp"];class ml extends fl{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return nt(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n,r;const s=Tr(this).text,{fontFamily:o=s.fontFamily,textAlign:a=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:d=s.stroke,lineWidth:p=s.lineWidth,wordBreak:f=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:v=s.ignoreBuf,heightLimit:m=0,suffixPosition:y=s.suffixPosition,lineClamp:b}=this.attribute,x=null!==(e=vs(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,w=v?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const A=pn.graphicUtil.textMeasure,S=new dl(o,{fontSize:h,fontWeight:g,fontFamily:o},A),T=t.map((t=>t.toString())),C=[],_=[0,0];let B=1/0;if(m>0&&(B=Math.max(Math.floor(m/x),1)),b&&(B=Math.min(B,b)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<T.length;t++){const e=T[t];let i=!0;if(t===B-1){const t=S.textMeasure.clipTextWithSuffix(e,S.textOptions,u,c,!1,y);C.push({str:t.str,width:t.width});break}const s=S.textMeasure.clipText(e,S.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=S.textMeasure.clipTextWithSuffix(e,S.textOptions,u,c,!1,y);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;i=!1}if(C.push({str:s.str,width:s.width}),s.str.length===e.length);else if(i){const i=e.substring(s.str.length);T.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,i=0;for(let n=0,r=T.length;n<r;n++){if(n===B-1){const t=S.textMeasure.clipTextWithSuffix(T[n],S.textOptions,u,c,!1,y);C.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=T[n],t=S.textMeasure.measureTextWidth(e,S.textOptions,"break-word"===f),i=Math.max(i,t),C.push({str:e,width:t})}_[0]=i}_[1]=C.length*(x+w);const P={xOffset:0,yOffset:0,width:_[0],height:_[1]};S.LayoutBBox(P,a,l);const R=S.layoutWithBBox(P,C,a,l,x);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<vl.length;e++){const i=vl[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<vl.length;e++)if(t===vl[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return ml.NOWORK_ANIMATE_ATTR}}function yl(t){return new ml(t)}class bl{bounds(t,e){if(st(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function xl(t,e,i,n,r){return r?t.arc(i,n,e,0,_t,!1,r):t.arc(i,n,e,0,_t),!1}var wl=new class extends bl{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,r){return xl(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return xl(t,e/2+r,i,n,s)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var Al=new class extends bl{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,e/6,i,n,r,s)}};function Sl(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var Tl=new class extends bl{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return Sl(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return Sl(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Sl(t,e/2+r,i,n,s)}};function Cl(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var _l=new class extends bl{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Cl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Cl(t,e/2+r,i,n)}};class Bl extends bl{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}var Pl=new Bl;var Rl=new class extends Bl{constructor(){super(...arguments),this.type="triangle"}};const Ml=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),kl=Math.sin(_t/10)*Ml,El=-Math.cos(_t/10)*Ml;function Ol(t,e,i,n){const r=kl*e,s=El*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=_t*o/5,l=Math.cos(a),h=Math.sin(a);t.lineTo(h*e+i,-l*e+n),t.lineTo(l*r-h*s+i,h*r+l*s+n)}return t.closePath(),!0}var Ll=new class extends bl{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return Ol(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ol(t,e/2+r,i,n)}};const Il=Lt(3);function Dl(t,e,i,n){const r=e,s=r/Il,o=s/5,a=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(o/2+i,n),t.lineTo(o/2+i,a+n),t.lineTo(-o/2+i,a+n),t.lineTo(-o/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var jl=new class extends bl{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return Dl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Dl(t,e/2+r,i,n)}};function Ul(t,e,i,n){const r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Wl=new class extends bl{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Ul(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ul(t,e/2+r,i,n)}};function Nl(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Fl=new class extends bl{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Nl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Nl(t,e/2+r,i,n)}};const zl=-.5,Gl=Lt(3)/2,Hl=1/Lt(12);function Vl(t,e,i,n){const r=e/2,s=e*Hl,o=r,a=e*Hl+e,l=-o,h=a;return t.moveTo(r+i,s+n),t.lineTo(o+i,a+n),t.lineTo(l+i,h+n),t.lineTo(zl*r-Gl*s+i,Gl*r+zl*s+n),t.lineTo(zl*o-Gl*a+i,Gl*o+zl*a+n),t.lineTo(zl*l-Gl*h+i,Gl*l+zl*h+n),t.lineTo(zl*r+Gl*s+i,zl*s-Gl*r+n),t.lineTo(zl*o+Gl*a+i,zl*a-Gl*o+n),t.lineTo(zl*l+Gl*h+i,zl*h-Gl*l+n),t.closePath(),!1}var Yl=new class extends bl{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return Vl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Vl(t,e/2+r,i,n)}};var Xl=new class extends bl{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}};var $l=new class extends bl{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}};var ql=new class extends bl{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}};const Kl=Lt(3);function Zl(t,e,i,n){const r=e*Kl;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var Jl=new class extends Bl{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Zl(t,e/2/Kl,i,n)}drawOffset(t,e,i,n,r){return Zl(t,e/2/Kl+r,i,n)}};function Ql(t,e,i,n){const r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var th=new class extends bl{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return Ql(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Ql(t,e/4+r,i,n)}};function eh(t,e,i,n){const r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var ih=new class extends bl{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return eh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return eh(t,e/4+r,i,n)}};function nh(t,e,i,n){const r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var rh=new class extends bl{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return nh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return nh(t,e/4+r,i,n)}};function sh(t,e,i,n){const r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var oh=new class extends bl{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return sh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return sh(t,e/4+r,i,n)}};function ah(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var lh=new class extends bl{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return ah(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return ah(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e}, ${i-r} L ${e},${i+r}`}};function hh(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var ch=new class extends bl{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return hh(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return hh(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} L ${e+r},${i}`}};function uh(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var dh=new class extends bl{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,r){return uh(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return uh(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}};function ph(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function fh(t,e,i,n){const r=e,s=e/2;return t.rect(i-r/2,n-s/2,r,s),!1}var gh=new class extends bl{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return st(e)?fh(t,e,i,n):ph(t,e,i,n)}drawOffset(t,e,i,n,r){return st(e)?fh(t,e+2*r,i,n):ph(t,[e[0]+2*r,e[1]+2*r],i,n)}};const vh=new Vt;class mh{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,nt(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,r,s,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),$e(r.path.commandList,t,i,n,e,e),o&&o(r.path,r.attribute)})),!1):($e(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),$e(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):($e(this.path.commandList,t,i,n,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;vh.x1=n.bounds.x1*t,vh.y1=n.bounds.y1*t,vh.x2=n.bounds.x2*t,vh.y2=n.bounds.y2*t,e.union(vh)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const yh=[wl,Al,Tl,_l,Jl,Rl,Ll,jl,Wl,Fl,Yl,Xl,$l,Pl,ql,th,ih,rh,oh,gh,lh,ch,dh],bh={};yh.forEach((t=>{bh[t.type]=t}));const xh={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},wh=new Vt,Ah=["symbolType","size",...xo];let Sh=class t extends _o{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=ha}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return nt(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=Tr(this).symbol;let{symbolType:i=e.symbolType}=this.attribute,n=bh[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(i=xh[i]||i,!0===jo(i)){const e=new Do,{svg:n}=e.parse(i);if(!n)return null;const r=nt(n.path)?n.path:[n.path];wh.clear();const s=[];r.forEach((t=>{const e=(new Di).fromString(t.d),i={};va.forEach((e=>{t[e]&&(i[ga[e]]=t[e])})),s.push({path:e,attribute:i}),wh.union(e.bounds)}));const o=wh.width(),a=wh.height(),l=1/kt(o,a);return s.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new mh(i,s,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new Di).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/kt(s,o);return r.transform(0,0,a,a),this._parsedPath=new mh(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=Tr(this).symbol;this._AABBBounds.clear();const i=this.attribute,n=pn.graphicService.updateSymbolAABBBounds(i,Tr(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=rs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,Ah)}needUpdateTag(t){return super.needUpdateTag(t,Ah)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=nt(e)?e:[e,e];return t.path?(new Di).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Di).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Th(t){return new Sh(t)}Sh.userSymbolMap={},Sh.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Co);const Ch=["segments","points","curveType","curveTension",...xo];let _h=class t extends _o{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=ia}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=cs(i,n,e))}doUpdateAABBBounds(){const t=Tr(this).line;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateLineAABBBounds(e,Tr(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,Ch)}needUpdateTag(t){return super.needUpdateTag(t,Ch)}toCustomPath(){const t=this.attribute,e=new Di,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Bh(t){return new _h(t)}_h.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Co);const Ph=["width","x1","y1","height","cornerRadius",...xo];class Rh extends _o{constructor(t){super(t),this.type="rect",this.numberType=oa}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}doUpdateAABBBounds(){const t=Tr(this).rect;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateRectAABBBounds(e,Tr(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,Ph)}needUpdateTag(t){return super.needUpdateTag(t,Ph)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:n,height:r}=ks(t),s=new Di;return s.moveTo(e,i),s.rect(e,i,n,r),s}clone(){return new Rh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Rh.NOWORK_ANIMATE_ATTR}}function Mh(t){return new Rh(t)}Rh.NOWORK_ANIMATE_ATTR=Co;const kh=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class Eh extends Rh{constructor(t){super(t),this.type="rect3d",this.numberType=aa}findFace(){const t={polygons:[],vertices:[],edges:[]},e=Tr(this).rect,{x1:i,y1:n,x:r,y:s,length:o=Et(e.width,e.height)}=this.attribute;let{width:a,height:l}=this.attribute;a=null!=a?a:i-r,l=null!=l?l:n-s;for(let e=0;e<kh.length;e++){const i=kh[e];t.vertices.push([i[0]*a,i[1]*l,i[2]*o])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return Eh.NOWORK_ANIMATE_ATTR}}function Oh(t){return new Eh(t)}Eh.NOWORK_ANIMATE_ATTR=Co;class Lh extends _o{constructor(t){super(t),this.type="glyph",this.numberType=Qo,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}doUpdateAABBBounds(){this._AABBBounds.clear();const t=pn.graphicService.updateGlyphAABBBounds(this.attribute,Tr(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;this.stopStateAnimates();const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new Lh(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return Lh.NOWORK_ANIMATE_ATTR}}function Ih(t){return new Lh(t)}Lh.NOWORK_ANIMATE_ATTR=Co;class Dh{constructor(t,e,i,n,r,s,o,a,l,h,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=o,this.lines=[],this.globalAlign=a,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=fn[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}let a=0;"right"===this.globalAlign||"end"===this.globalAlign?a=-r:"center"===this.globalAlign&&(a=-r/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+l)return h;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=i:o+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,a,s+o,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,h=!0),this.lines[i].draw(t,n,a,s+o,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+l)return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(n=!0,h=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],o=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&o-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class jh{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const n=vs(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof n?n>this.fontSize?n:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:o,width:a}=An(t,i);let l=0,h=0,c=0;this.height>s&&(l=(this.height-s)/2,h=Math.ceil(l),c=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=s-l):"bottom"===this.textBaseline?(this.ascent=s-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+h,this.descent=o+c),this.length=t.length,this.width=a||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=An(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,o=this.left+i;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+=this.ellipsisStr,"right"!==r&&"end"!==r||(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=xn(s,("vertical"===a?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+=this.ellipsisStr,"right"===r||"end"===r){const{width:e}=An(this.text.slice(t),this.character);"vertical"===a||(o-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===a&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||vn;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i;let s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const i=e&&e.fill||gn;if(!i)return void(t.globalAlpha=0);const{fillOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.fillStyle=i;let s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===a&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=xn(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=An(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const Uh=["width","height","image",...xo];class Wh extends _o{constructor(t){super(t),this.type="image",this.numberType=ea,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}doUpdateAABBBounds(){const t=Tr(this).image;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateImageAABBBounds(e,Tr(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return cn[t]}needUpdateTags(t){return super.needUpdateTags(t,Uh)}needUpdateTag(t){return super.needUpdateTag(t,Uh)}clone(){return new Wh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Wh.NOWORK_ANIMATE_ATTR}}function Nh(t){return new Wh(t)}Wh.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Co);class Fh extends Wh{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=rs(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(nt(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=rs(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=cn.width,height:e=cn.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,s=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class zh{constructor(t,e,i,n,r,s,o,a){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Fh?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=fn[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof jh){const e=bn.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=a?0:this.width-this.actualWidth,this.calcOffset(e,a)}calcOffset(t,e){const i=this.directionKey,n=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof Fh?(t["_"+i.x]=r,r+=t[i.width]+s,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+s)}))}draw(t,e,i,n,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n.overflow)continue;if(n instanceof Fh)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:o}=An(s,n.character),a=o||0;if(a<=this.blankWidth+t){e&&(n.ellipsis="add");break}if(a<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=a,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}}this.paragraphs.map(((e,r)=>{if(e instanceof Fh)return e.setAttributes({x:i+e._x,y:n+e._y}),void s(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===r,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof Fh)break;const{width:r}=An(t,n.character),s=r||0;if(s<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=s;break}if(s<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=s,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof Fh?t.width:t.getWidthWithEllips(this.direction)})),i}}class Gh{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=fn[this.direction]}store(t){if(t instanceof Fh){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new zh(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t instanceof Fh?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,r=xn(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==r){const[i,n]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new jh(i,t.newLine,t.character),new jh(n,!0,t.character)]}(t,r);this.store(i),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Hh=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...xo];class Vh extends _o{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=la}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:hn.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:hn.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:hn.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:hn.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:hn.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:hn.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:hn.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:hn.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=Tr(this).richtext;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateRichTextAABBBounds(e,Tr(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return hn[t]}needUpdateTags(t){return super.needUpdateTags(t,Hh)}needUpdateTag(t){return super.needUpdateTag(t,Hh)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:o,lineWidth:a,opacity:l,fillOpacity:h,strokeOpacity:c}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:o,lineWidth:a,opacity:l,fillOpacity:h,strokeOpacity:c},t)}doUpdateFrameCache(t){var e;const{textConfig:i=[],maxWidth:n,maxHeight:r,width:s,height:o,ellipsis:a,wordBreak:l,verticalDirection:h,textAlign:c,textBaseline:u,layoutDirection:d,singleLine:p,disableAutoWrapLine:f}=this.attribute,g=[],v=null!=t?t:i;for(let t=0;t<v.length;t++)if("image"in v[t]){const e=this.combinedStyleToCharacter(v[t]),i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)g.push(i);else{const t=new Fh(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,g.push(t)}}else{const e=this.combinedStyleToCharacter(v[t]);if(st(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i<t.length;i++)g.push(new jh(t[i],0!==i,e))}else e.text&&g.push(new jh(e.text,!1,e))}const m="number"==typeof n&&Number.isFinite(n)&&n>0,y="number"==typeof r&&Number.isFinite(r)&&r>0,b="number"==typeof s&&Number.isFinite(s)&&s>0&&(!m||s<=n),x="number"==typeof o&&Number.isFinite(o)&&o>0&&(!y||o<=r),w=new Dh(0,0,(b?s:m?n:0)||0,(x?o:y?r:0)||0,a,l,h,c,u,d||"horizontal",!b&&m,!x&&y,p||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),A=new Gh(w);if(f){let t=0,e=!1;for(let i=0;i<g.length;i++){const n=g[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&w.lines[w.lines.length-1].paragraphs.push(n)):A.deal(n,!0),w.lines.length!==t&&(t=w.lines.length,A.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,w.lines[w.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,A.lineWidth=0),A.send()}}else for(let t=0;t<g.length;t++)A.deal(g[t]);if(A.send(),!("horizontal"===w.layoutDirection?b:x)){const t=w.getActualSizeWidthEllipsis();let e="horizontal"===w.layoutDirection?t.width:t.height;("horizontal"===w.layoutDirection?m:y)&&(e=Math.min(e,"horizontal"===w.layoutDirection?n:r)),w.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=w}clone(){return new Vh(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,i,n,r,s;const o=this.pickIcon(t.global);o&&o===this._currentHoverIcon||(o?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=o,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(o.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):!o&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;const a=e.AABBBounds.clone();a.translate(e._marginArray[3],e._marginArray[0]),a.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i+e._marginArray[3],r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),r}getNoWorkAnimateAttr(){return Vh.NOWORK_ANIMATE_ATTR}}function Yh(t){return new Vh(t)}Vh.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Co);const Xh=["path","customPath",...xo];class $h extends _o{constructor(t){super(t),this.type="path",this.numberType=na}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=Tr(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Di?e.path:(q(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Di?this.cache:t.path)}doUpdateAABBBounds(){const t=Tr(this).path;this.doUpdatePathShape(),this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updatePathAABBBounds(e,Tr(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;it(t.path,!0)?this.cache=(new Di).fromString(t.path):t.customPath&&(this.cache=new Di,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Tr(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,Xh)}needUpdateTag(t){return super.needUpdateTag(t,Xh)}toCustomPath(){return(new Di).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new $h(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return $h.NOWORK_ANIMATE_ATTR}}function qh(t){return new $h(t)}$h.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Co);const Kh=["segments","points","curveType","curveTension",...xo];class Zh extends _o{constructor(t){super(t),this.type="area",this.numberType=Zo}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=Tr(this).area;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateAreaAABBBounds(e,Tr(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=cs(i,n,e))}getDefaultAttribute(t){return Tr(this).area[t]}needUpdateTags(t){return super.needUpdateTags(t,Kh)}needUpdateTag(t){return super.needUpdateTag(t,Kh)}toCustomPath(){const t=new Di,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new Zh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Zh.NOWORK_ANIMATE_ATTR}}function Jh(t){return new Zh(t)}Zh.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Co);const Qh=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...xo];class tc extends _o{constructor(t){super(t),this.type="arc",this.numberType=qo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=Tr(this).arc,{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:n=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=n,s-=i,0===e||"0%"===e)return 0;const o=Math.abs(r-s),a=t=>Math.min(st(t,!0)?t:o*parseFloat(t)/100,o/2);if(nt(e)){const t=e.map((t=>a(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return a(e)}getParsedAngle(){const t=Tr(this).arc;let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,r=i-e>=0?1:-1,s=i-e;if(e=Yt(e),i=e+s,n&&Pt(s)<Bt-St){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));let{outerRadius:a=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;a+=h,l-=c;const u=Math.abs(a-l)/2,d=u/a;if(u>St&&a>St)return{startAngle:e-r*d*s,endAngle:i+r*d*o,sc:r*d*s,ec:r*d*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=Tr(this).arc,{innerPadding:n=i.innerPadding,outerPadding:r=i.outerPadding,padAngle:s=i.padAngle}=this.attribute;let{outerRadius:o=i.outerRadius,innerRadius:a=i.innerRadius}=this.attribute;o+=r,a-=n;const{padRadius:l=Lt(o*o+a*a)}=this.attribute,h=Pt(e-t);let c=t,u=e,d=t,p=e;const f=s/2;let g=h,v=h;if(f>St&&l>St){const i=e>t?1:-1;let n=jt(Number(l)/a*Ot(f)),r=jt(Number(l)/o*Ot(f));return(g-=2*n)>St?(n*=i,d+=n,p-=n):(g=0,d=p=(t+e)/2),(v-=2*r)>St?(r*=i,c+=r,u-=r):(v=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}doUpdateAABBBounds(t){const e=Tr(this).arc;this._AABBBounds.clear();const i=this.attribute,n=pn.graphicService.updateArcAABBBounds(i,Tr(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=rs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,Qh)}needUpdateTag(t){return super.needUpdateTag(t,Qh)}getDefaultAttribute(t){return Tr(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius-(t.innerPadding||0),r=t.outerRadius-(t.outerPadding||0);const s=Pt(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new Di;if(r<=St)a.moveTo(0,0);else if(s>=Bt-St)a.moveTo(0+r*Mt(e),0+r*Ot(e)),a.arc(0,0,r,e,i,!o),n>St&&(a.moveTo(0+n*Mt(i),0+n*Ot(i)),a.arc(0,0,n,i,e,o));else{const t=r*Mt(e),s=r*Ot(e),l=n*Mt(i),h=n*Ot(i);a.moveTo(0+t,0+s),a.arc(0,0,r,e,i,!o),a.lineTo(0+l,0+h),a.arc(0,0,n,i,e,o),a.closePath()}return a}clone(){return new tc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return tc.NOWORK_ANIMATE_ATTR}}function ec(t){return new tc(t)}tc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Co);class ic extends tc{constructor(t){super(t),this.type="arc3d",this.numberType=Ko}doUpdateAABBBounds(){const t=Tr(this).arc;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updateArc3dAABBBounds(e,Tr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return ic.NOWORK_ANIMATE_ATTR}}function nc(t){return new ic(t)}ic.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Co);const rc=["points","cornerRadius",...xo];class sc extends _o{constructor(t){super(t),this.type="polygon",this.numberType=ra}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=Tr(this).polygon;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updatePolygonAABBBounds(e,Tr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=cs(i,n,e))}getDefaultAttribute(t){return Tr(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,rc)}needUpdateTag(t){return super.needUpdateTag(t,rc)}toCustomPath(){const t=this.attribute.points,e=new Di;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new sc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sc.NOWORK_ANIMATE_ATTR}}function oc(t){return new sc(t)}sc.NOWORK_ANIMATE_ATTR=Co;class ac extends sc{constructor(t){super(t),this.type="pyramid3d",this.numberType=sa}doUpdateAABBBounds(){const t=Tr(this).polygon;this._AABBBounds.clear();const e=this.attribute,i=pn.graphicService.updatePyramid3dAABBBounds(e,Tr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=rs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),i=t.map((t=>({p:t,d:0})));let n=!1,r=0;for(let t=0;t<e.length-1;t++){for(let s=t+1;s<e.length;s++){if(e[t]===e[s]){n=!0;const e=zt.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=kt(r,e);const o=zt.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=kt(r,o)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(r-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const s={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{s.vertices.push([t.p.x,t.p.y,t.d])})),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return ac.NOWORK_ANIMATE_ATTR}}function lc(t){return new ac(t)}ac.NOWORK_ANIMATE_ATTR=Co;class hc extends ya{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function cc(t){return new hc(t)}class uc{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:o=t.lineWidth}=r;i.expand(n+(s+o)/2)}return i}}class dc extends uc{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:a=t.lineWidth}=r;No(i,n+(s+a)/2,!0,o)}return i}}const pc=Symbol.for("MatrixAllocate"),fc=Symbol.for("Mat4Allocate");function gc(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class vc{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new $t(t,e,i,n,r,s);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=r,o.f=s,o}allocateByObj(t){if(!this.pools.length)return new $t(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class mc{constructor(){this.pools=[]}static identity(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}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return mc.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const yc=new vc,bc=new mc;var xc=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},wc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ac=function(t,e){return function(i,n){e(i,n,t)}};function Sc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=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]=s*r+h*n,t[5]=o*r+c*n,t[6]=a*r+u*n,t[7]=l*r+d*n,t[8]=h*r-s*n,t[9]=c*r-o*n,t[10]=u*r-a*n,t[11]=d*r-l*n,t}function Tc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],l=e[3],h=e[8],c=e[9],u=e[10],d=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]=s*r-h*n,t[1]=o*r-c*n,t[2]=a*r-u*n,t[3]=l*r-d*n,t[8]=s*n+h*r,t[9]=o*n+c*r,t[10]=a*n+u*r,t[11]=l*n+d*r,t}function Cc(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,l,h,c,u,d,p,f,g,v,m;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(o=e[0],a=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],v=e[10],m=e[11],t[0]=o,t[1]=a,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=m,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+u*r+g*s+e[13],t[14]=l*n+d*r+v*s+e[14],t[15]=h*n+p*r+m*s+e[15]),t}function _c(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Bc(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*l+w*d+A*v,t[2]=b*s+x*h+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*l+w*d+A*v,t[6]=b*s+x*h+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*l+w*d+A*v,t[10]=b*s+x*h+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*l+w*d+A*v,t[14]=b*s+x*h+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function Pc(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:o=i.z,dx:a=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:v=e.attribute.anchor,anchor:m}=e.attribute,y=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;y[0]=i.x1+(i.x2-i.x1)*t}else y[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;y[1]=i.x1+(i.x2-i.x1)*t}else y[1]=v[1];y[2]=null!==(n=v[2])&&void 0!==n?n:0}if(function(t){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),Cc(t,t,[r+a,s+l,o+h]),Cc(t,t,[y[0],y[1],y[2]]),Sc(t,t,f),Tc(t,t,p),Cc(t,t,[-y[0],-y[1],y[2]]),function(t,e,i){const n=i[0],r=i[1],s=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),g){const i=bc.allocate(),n=[0,0];if(m){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=v[1]}Cc(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],l=e[3],h=e[4],c=e[5],u=e[6],d=e[7];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]=s*r+h*n,t[1]=o*r+c*n,t[2]=a*r+u*n,t[3]=l*r+d*n,t[4]=h*r-s*n,t[5]=c*r-o*n,t[6]=u*r-a*n,t[7]=d*r-l*n}(i,i,g),Cc(i,i,[-n[0],-n[1],0]),Bc(t,t,i)}}function Rc(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new j(["graphic"]),onSetStage:new j(["graphic","stage"]),onRemove:new j(["graphic"]),onRelease:new j(["graphic"]),onAddIncremental:new j(["graphic","group","stage"]),onClearIncremental:new j(["graphic","group","stage"]),beforeUpdateAABBBounds:new j(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new j(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Vt,this.tempAABBBounds2=new Vt,this._rectBoundsContribitions=[new uc],this._symbolBoundsContribitions=[new dc],this._imageBoundsContribitions=[new uc],this._circleBoundsContribitions=[new uc],this._arcBoundsContribitions=[new uc],this._pathBoundsContribitions=[new uc]}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new Se(t);return $e(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){let{width:e,height:n}=t;const{x1:r,y1:s,x:o,y:a}=t;e=null!=e?e:r-o,n=null!=n?n:s-a,(isFinite(e)||isFinite(n)||isFinite(o)||isFinite(a))&&i.set(0,0,e||0,n||0)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}updateGroupAABBBounds(t,e,i,n){const r=i;i=i.clone();const{width:s,height:o,path:a,clip:l=e.clip,display:h}=t;a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=o&&i.set(0,0,Math.max(0,s),Math.max(0,o)),l||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const c=this.tempAABBBounds1,u=this.tempAABBBounds2;return c.setValue(i.x1,i.y1,i.x2,i.y2),u.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),r.copy(i),r}updateGlyphAABBBounds(t,e,i,n){return this._validCheck(t,e,i,n)?(n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i):i}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=st(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=cl(s,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=st(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=hl(r,e);i.set(n,i.y1,n+e,i.y2)}}updateRichTextAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:l=e.textAlign,textBaseline:h=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:l}=t.getActualSize();let h=r||e||0,c=s||l||0;c="number"==typeof a&&c>a?a:c||0,h="number"==typeof o&&h>o?o:h||0,i.set(0,0,h,c)}let c=0;switch(h){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-i.height()}let u=0;switch(l){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}i.translate(u,c);const d=this.tempAABBBounds1,p=this.tempAABBBounds2;return d.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,i),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;const{text:r=e.text}=n.attribute;Array.isArray(r)?n.updateMultilineAABBBounds(r):n.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:a=e.scaleX,scaleY:l=e.scaleY,shadowBlur:h=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(h){No(s,h/Math.abs(a+l),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,i),Gt(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePathAABBBoundsImprecise(t,e,i,n){if(!n)return i;const r=n.getParsedPathShape();return i.union(r.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)}));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateArc3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;const{outerRadius:s=e.outerRadius,height:o=0}=t,a=s+o;i.setValue(-a,-a,a,a);const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePolygonAABBBoundsImprecise(t,e,i,n){const{points:r=e.points}=t;return r.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points,connectedType:s}=t,o=i;return r.forEach((t=>{!1===t.defined&&"zero"!==s||o.add(t.x,t.y)})),o}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments,connectedType:s}=t,o=i;return r.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"zero"!==s||o.add(t.x,t.y)}))})),o}updateAreaAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}updateCircleAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}updateCircleAABBBoundsImprecise(t,e,i,n){const{radius:r=e.radius}=t;return i.set(-r,-r,r,r),i}updateCircleAABBBoundsAccurate(t,e,i,n){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:o=e.radius}=t;return s-r>Bt-St?i.set(-o,-o,o,o):as(r,s,o,i),i}updateArcAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateArcAABBBoundsImprecise(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:o=e.outerPadding,innerPadding:a=e.innerPadding}=t;return r+=o,s-=a,r<s&&(r=s),i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:o=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(r+=o,s-=a,r<s){const t=r;r=s,s=t}let{endAngle:l=e.endAngle,startAngle:h=e.startAngle}=t;if(h>l){const t=h;h=l,l=t}return r<=St?i.set(0,0,0,0):Math.abs(l-h)>Bt-St?i.set(-r,-r,r,r):(as(h,l,r,i),as(h,l,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(nt(r))i.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,n){if(!n)return i;const{size:r=e.size}=t;return n.getParsedPath().bounds(r,i),i}updateImageAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._imageBoundsContribitions.length&&this._imageBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){if(!e.empty()){const{scaleX:r=i.scaleX,scaleY:s=i.scaleY,stroke:o=i.stroke,shadowBlur:a=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(o&&l){No(u,(l+h)/Math.abs(r+s),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(a){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:o=i.shadowOffsetY}=t;No(u,a/Math.abs(r+s)*2,!1,c+1),u.translate(n,o),e.union(u)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const o=r.transMatrix;r&&r.isContainer&&(s=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),s&&Gt(e,e,o)}_validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(!n.valid)return i.clear(),!1;const{visible:r=e.visible}=t;return!!r||(i.clear(),!1)}},t.DefaultGraphicService=xc([g(),Ac(0,p(da)),wc("design:paramtypes",[Object])],t.DefaultGraphicService);const Mc=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let kc,Ec;function Oc(t){return kc||(kc=Mc.CreateGraphic("text",{})),kc.initAttributes(t),kc.AABBBounds}const Lc={x:0,y:0,z:0,lastModelMatrix:null};class Ic{init(e){e&&(this._renderContribitions=e.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.afterFillStroke)))}beforeRenderStep(t,e,i,n,r,s,o,a,l,h,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d)}))}afterRenderStep(t,e,i,n,r,s,o,a,l,h,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d)}))}valid(t,e,i,n){const{fill:r=e.fill,background:s,stroke:o=e.stroke,opacity:a=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=Oa(a,l,r),p=Ia(a,c),f=ka(r,s),g=Ea(o,h);return!(!t.valid||!u)&&!(!f&&!g)&&!!(d||p||i||n||s)&&{fVisible:d,sVisible:p,doFill:f,doStroke:g}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:r=e.x,y:s=e.y,z:o=e.z,scaleX:a=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;Lc.x=r,Lc.y=s,Lc.z=o,Lc.lastModelMatrix=u;const p=d&&(n||Rc(t)),f=p?t.transMatrix.onlyTranslate()&&!c:1===a&&1===l&&0===h&&!c;if(p){const n=bc.allocate(),r=bc.allocate();Pc(r,t,e),Bc(n,u||n,r),Lc.x=0,Lc.y=0,Lc.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),bc.free(r)}if(f&&!u){const n=t.getOffsetXY(e);Lc.x+=n.x,Lc.y+=n.y,Lc.z=o,i.setTransformForCurrent()}else if(p)Lc.x=0,Lc.y=0,Lc.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);Lc.x+=n.x,Lc.y+=n.y,this.transformWithoutTranslate(i,Lc.x,Lc.y,Lc.z,a,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Lc.x=0,Lc.y=0,Lc.z=0;return Lc}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,o=n.project(0,0,i),a=n.project(r,0,i),l=n.project(r,s,i),h={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),p=-(h.y*(l.x-a.x)-c.y*l.x+u.y*a.x+(c.y-u.y)*o.x)*d,f=(c.y*l.y+h.y*(a.y-l.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(h.x*(l.x-a.x)-c.x*l.x+u.x*a.x+(c.x-u.x)*o.x)*d,v=-(c.x*l.y+h.x*(a.y-l.y)-u.x*a.y+(u.x-c.x)*o.y)*d,m=(h.x*(u.y*a.x-c.y*l.x)+h.y*(c.x*l.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,y=(h.x*(u.y*a.y-c.y*l.y)+h.y*(c.x*l.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;n.setTransform(p,f,g,v,m,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,o){const a=t.project(e,i,n);t.translate(a.x,a.y,!1),t.scale(r,s,!1),t.rotate(o,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,r){const{context:s}=n;if(!s)return;const{renderable:o}=t.attribute;if(!1===o)return;s.highPerformanceSave();const a=this.transform(t,e,s,i),{x:l,y:h,z:c,lastModelMatrix:u}=a;this.z=c,ja(t,s,l,h,0,r)||(this.drawShape(t,s,l,h,n,r),this.z=0,s.modelMatrix!==u&&bc.free(s.modelMatrix),s.modelMatrix=u),s.highPerformanceRestore()}}const Dc=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,a)||r("conic",t.conicGradient,o)}function r(e,n,r){return function(n,s){const o=m(n);if(o){m(t.startCall)||i("Missing (");const n=function(n){const s=r();return s&&(m(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:d(p)}}();return m(t.endCall)||i("Missing )"),n}}(n)}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function o(){return v("angular",t.fromAngleValue,1)}function a(){let i,n,r=l();return r&&(i=[],i.push(r),n=e,m(t.comma)&&(r=l(),r?i.push(r):e=n)),i}function l(){let t=function(){const t=v("shape",/^(circle)/i,0);return t&&(t.style=g()||h()),t}()||function(){const t=v("shape",/^(ellipse)/i,0);return t&&(t.style=f()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function h(){return v("extent-keyword",t.extentKeywords,1)}function c(){if(v("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:f(),y:f()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let n=e();const r=[];if(n)for(r.push(n);m(t.comma);)n=e(),n?r.push(n):i("One extra comma");return r}function p(){const e=v("hex",t.hexColor,1)||v("rgba",t.rgbaColor,1)||v("rgb",t.rgbColor,1)||v("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=f(),e}function f(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||g()}function g(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,i){const n=m(e);if(n)return{type:t,value:n[i]}}function m(t){const i=/^[\n\r\t\s]+/.exec(e);i&&y(i[0].length);const n=t.exec(e);return n&&y(n[0].length),n}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class jc{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(jc.IsGradientStr(t))try{const e=Dc(t)[0];if(e){if("linear"===e.type)return jc.ParseLinear(e);if("radial"===e.type)return jc.ParseRadial(e);if("conic"===e.type)return jc.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=Tt/2,r=parseFloat(e.value)/180*Tt-n;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+Bt,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=Tt/2;let r="angular"===e.type?parseFloat(e.value)/180*Tt:0;for(;r<0;)r+=Bt;for(;r>Bt;)r-=Bt;let s=0,o=0,a=0,l=0;return r<n?(s=0,o=1,a=Math.sin(r),l=Math.cos(r)):r<Tt?(s=0,o=0,a=Math.cos(r-n),l=Math.sin(r-n)):r<Tt+n?(s=1,o=0,a=s-Math.sin(r-Tt),l=Math.cos(r-Tt)):(s=1,a=s-Math.cos(r-n-Tt),l-=Math.sin(r-n-Tt)),{gradient:"linear",x0:s,y0:o,x1:a,y1:l,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Uc(t,e,i){let n=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),h=Math.sign(a)*Math.sqrt(o*o+a*a);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}function Wc(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(nt(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return o=jc.Parse(o),"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l;const h=i.AABBBounds;if(!h)return;let c=h.x2-h.x1,u=h.y2-h.y1,d=h.x1-n,p=h.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,p/=e}const f=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,p+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,p+(null!==(l=e.y1)&&void 0!==l?l:0)*u);return e.stops.forEach((t=>{f.addColorStop(t.offset,t.color)})),f}(t,o,i,n,r):"conical"===o.gradient?s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o;const a=i.AABBBounds;if(!a)return;let l=a.x2-a.x1,h=a.y2-a.y1,c=a.x1-n,u=a.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;l/=t,h/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*l,u+(null!==(o=e.y)&&void 0!==o?o:0)*h,e.startAngle,e.endAngle);return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(l+c,h+u,void 0)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l,h,c;const u=i.AABBBounds;if(!u)return;let d=u.x2-u.x1,p=u.y2-u.y1,f=u.x1-n,g=u.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;f/=t,g/=e,d/=t,p/=e}const v=t.createRadialGradient(f+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*p,Math.max(d,p)*(null!==(a=e.r0)&&void 0!==a?a:0),f+(null!==(l=e.x1)&&void 0!==l?l:.5)*d,g+(null!==(h=e.y1)&&void 0!==h?h:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{v.addColorStop(t.offset,t.color)})),v}(t,o,i,n,r)),s||"orange")}var Nc=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zc=function(t,e){return function(i,n){e(i,n,t)}};class Gc{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){var p;const{background:f,backgroundOpacity:g=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:v=l.opacity,backgroundMode:m=l.backgroundMode,backgroundFit:y=l.backgroundFit}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const r=t.resources.get(f);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Tr(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=g*v,this.doDrawImage(e,r.data,s,m,y),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=g*v,e.fillStyle=f,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n,r){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=i.width(),o=i.height();let a=s,l=o;if(r&&"repeat"!==n&&(e.width||e.height)){const i=e.width,r=e.height;"repeat-x"===n?(a=i*(o/r),l=o):"repeat-y"===n&&(l=r*(s/i),a=s);const h=t.dpr,c=ar.allocate({width:a,height:l,dpr:h}),u=c.getContext("2d");u&&(u.inuse=!0,u.clearMatrix(),u.setTransformForCurrent(!0),u.clearRect(0,0,a,l),u.drawImage(e,0,0,a,l),e=c.nativeCanvas),ar.free(c)}const h=t.dpr,c=t.createPattern(e,n);c.setTransform&&c.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=c,t.translate(i.x1,i.y1),t.fillRect(0,0,s,o),t.translate(-i.x1,-i.y1)}}}const Hc=new Gc;t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,l,h,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=Nc([g(),zc(0,p(E)),zc(0,v(nl)),Fc("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution);class Vc{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,o=n.dpr,a=ar.allocate({width:t,height:t,dpr:o}),l=a.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(s,l);const h=n.createPattern(a.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),ar.free(a),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,Bt),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:f=l.textureColor,textureSize:g=l.textureSize,texturePadding:v=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,f,g,v)}drawTexture(t,e,i,n,r,s,o,a,l){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(a,l,o,i);break;case"diamond":h=this.createDiamondPattern(a,l,o,i);break;case"rect":h=this.createRectPattern(a,l,o,i);break;case"vertical-line":h=this.createVerticalLinePattern(a,l,o,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(a,l,o,i);break;case"bias-lr":h=this.createBiasLRLinePattern(a,l,o,i);break;case"bias-rl":h=this.createBiasRLLinePattern(a,l,o,i);break;case"grid":h=this.createGridPattern(a,l,o,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,r,s),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}}const Yc=new Vc;class Xc{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerPadding:v=l.innerPadding,outerPadding:m=l.outerPadding,startAngle:y=l.startAngle,endAngle:b=l.endAngle,opacity:x=l.opacity,x:w=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY}=t.attribute;let{innerRadius:C=l.innerRadius,outerRadius:_=l.outerRadius}=t.attribute;_+=m,C-=v;const B=!(!d||!d.stroke),P=!(!p||!p.stroke);if(f){const{distance:r=l.outerBorder.distance}=d,s=Uc(e,r,e.dpr),o=r/_;if(t.setAttributes({outerRadius:_+s,innerRadius:C-s,startAngle:y-o,endAngle:b+o}),e.beginPath(),Na(t,e,i,n,_+s,C-s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(B){const r=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,d,(w-i)/S,(A-n)/T,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=p,s=Uc(e,r,e.dpr),o=r/_;if(t.setAttributes({outerRadius:_-s,innerRadius:C+s,startAngle:y+o,endAngle:b-o}),e.beginPath(),Na(t,e,i,n,_-s,C+s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(P){const r=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,p,(w-i)/S,(A-n)/T,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:_,innerRadius:C,startAngle:y,endAngle:b})}}const $c=new Xc,qc=Yc,Kc=Hc;class Zc{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{radius:v=l.radius,startAngle:m=l.startAngle,endAngle:y=l.endAngle,opacity:b=l.opacity,x:x=l.x,y:w=l.y,scaleX:A=l.scaleX,scaleY:S=l.scaleY}=t.attribute,T=!(!d||!d.stroke),C=!(!p||!p.stroke);if(f){const{distance:r=l.outerBorder.distance}=d,s=Uc(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v+s,m,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(T){const r=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/A,(w-n)/S,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=p,s=Uc(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v-s,m,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(C){const r=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(w-n)/S,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}}const Jc=new Zc,Qc=Yc,tu=Hc;class eu extends Gc{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{background:d,backgroundMode:p=l.backgroundMode,backgroundFit:f=l.backgroundFit}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p,f),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}}const iu=new eu,nu=Tt/2;function ru(t,e,i,n,r,s,o){let a;if(n<0&&(e+=n,n=-n),r<0&&(i+=r,r=-r),st(s,!0))a=[s=Pt(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,i;switch(t.length){case 0:a=[0,0,0,0];break;case 1:e=Pt(t[0]),a=[e,e,e,e];break;case 2:case 3:e=Pt(t[0]),i=Pt(t[1]),a=[e,i,e,i];break;default:a=t,a[0]=Pt(a[0]),a[1]=Pt(a[1]),a[2]=Pt(a[2]),a[3]=Pt(a[3])}}else a=[0,0,0,0];if(n<0||a[0]+a[1]+a[2]+a[3]<1e-12)return t.rect(e,i,n,r);const[l,h,c,u]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],d=Math.min(n/2,r/2),p=[Math.min(d,a[0]),Math.min(d,a[1]),Math.min(d,a[2]),Math.min(d,a[3])],f=[l[0]+p[0],l[1]],g=[l[0],l[1]+p[0]],v=[h[0]-p[1],h[1]],m=[h[0],h[1]+p[1]],y=[c[0]-p[2],c[1]],b=[c[0],c[1]-p[2]],x=[u[0]+p[3],u[1]],w=[u[0],u[1]-p[3]];if(t.moveTo(f[0],f[1]),o&&o[0]?o[0](f[0],f[1],v[0],v[1]):t.lineTo(v[0],v[1]),!ft(v,m)){o&&o[0]&&t.moveTo(v[0],v[1]);const e=v[0],i=v[1]+p[1];t.arc(e,i,p[1],-nu,0,!1)}if(o&&o[1]?o[1](m[0],m[1],b[0],b[1]):t.lineTo(b[0],b[1]),!ft(y,b)){const e=b[0]-p[2],i=b[1];o&&o[1]&&t.moveTo(b[0],b[1]),t.arc(e,i,p[2],0,nu,!1)}if(o&&o[2]?o[2](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!ft(x,w)){const e=x[0],i=x[1]-p[3];o&&o[2]&&t.moveTo(x[0],x[1]),t.arc(e,i,p[3],nu,Tt,!1)}if(o&&o[3]?o[3](w[0],w[1],g[0],g[1]):t.lineTo(g[0],g[1]),!ft(f,g)){const e=f[0],i=f[1]+p[0];o&&o[3]&&t.moveTo(g[0],g[1]),t.arc(e,i,p[0],Tt,Tt+nu,!1)}return!o&&t.closePath(),t}var su=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};class ou{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{cornerRadius:v=l.cornerRadius,opacity:m=l.opacity,x:y=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:w=l.scaleY,x1:A,y1:S}=t.attribute;let{width:T,height:C}=t.attribute;T=(null!=T?T:A-i)||0,C=(null!=C?C:S-n)||0;const _=!(!d||!d.stroke),B=!(!p||!p.stroke);if(f){const{distance:r=l.outerBorder.distance}=d,s=Uc(e,r,e.dpr),o=i-s,a=n-s,h=2*s;if(0===v||nt(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,T+h,C+h)):(e.beginPath(),ru(e,o,a,T+h,C+h,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(_){const r=l.outerBorder.opacity;l.outerBorder.opacity=m,e.setStrokeStyle(t,d,(y-i)/x,(b-n)/w,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=p,s=Uc(e,r,e.dpr),o=i+s,a=n+s,h=2*s;if(0===v||nt(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,T-h,C-h)):(e.beginPath(),ru(e,o,a,T-h,C-h,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(B){const r=l.innerBorder.opacity;l.innerBorder.opacity=m,e.setStrokeStyle(t,p,(y-i)/x,(b-n)/w,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}}t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=su([g()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{x1:d,y1:p,x:f=l.x,y:g=l.y,stroke:v=l.stroke,cornerRadius:m=l.cornerRadius}=t.attribute;let{width:y,height:b}=t.attribute;if(y=(null!=y?y:d-f)||0,b=(null!=b?b:p-g)||0,Array.isArray(v)&&v.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,l),!(0===m||nt(m)&&m.every((t=>0===t)))){let r,s=0;return ru(e,i,n,y,b,m,new Array(4).fill(0).map(((o,a)=>(o,h,c,u)=>{v[a]&&(s===a-1&&v[a]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:v[a]}),i,n,l),e.beginPath(),e.moveTo(o,h),r=v[a]),s=a,e.lineTo(c,u),e.stroke(),3===a&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,n),v[0]?e.lineTo(i+y,n):e.moveTo(i+y,n),v[1]?e.lineTo(i+y,n+b):e.moveTo(i+y,n+b),v[2]?e.lineTo(i,n+b):e.moveTo(i,n+b),v[3]){const t=v[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=su([g()],t.SplitRectAfterRenderContribution);const au=new ou,lu=Yc,hu=Hc;class cu extends Gc{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const{background:d,backgroundMode:p=l.backgroundMode,backgroundFit:f=l.backgroundFit}=t.attribute;if(d)if(t.backgroundImg){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Tr(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p,f),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(Z(d)){const{stroke:i,fill:n,lineWidth:r=1,cornerRadius:s=0,expandX:o=0,expandY:a=0}=d;if(!i&&!n)return;e.beginPath();const{x:l,y:h,width:c,height:u}=function(t){const e=rs(t.attribute.boundsPadding),i=t.AABBBounds;let n=i.x1,r=i.y1,s=i.width(),o=i.height();return st(e)?(n+=e,r+=e,s-=2*e,o-=2*e):(n+=e[3],r+=e[0],s-=e[1]+e[3],o-=e[0]+e[2]),{x:n,y:r,width:s,height:o}}(t);s?ru(e,l-o,h-a,c+2*o,u+2*a,s):e.rect(l-o,h-a,c+2*o,u+2*a),e.globalAlpha=1,n&&(e.fillStyle=n,e.fill()),i&&r>0&&(e.lineWidth=r,e.strokeStyle=i,e.stroke())}else{e.beginPath();const r=t.AABBBounds;e.rect(i,n,r.width(),r.height()),e.fillStyle=d,e.globalAlpha=1,e.fill()}}}class uu extends ou{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){return super.drawShape(t,e,i,n,r,s,o,a,l,h,c,u)}}const du=new uu,pu=new cu;class fu{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,v=f&&!1!==f.visible;if(!g&&!v)return;const{size:m=l.size,opacity:y=l.opacity,x:b=l.x,y:x=l.y,scaleX:w=l.scaleX,scaleY:A=l.scaleY}=t.attribute,S=!(!p||!p.stroke),T=!(!f||!f.stroke);if(g){const{distance:r=l.outerBorder.distance}=p,s=Uc(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,m,i,n,s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.outerBorder);else if(S){const r=l.outerBorder.opacity;l.outerBorder.opacity=y,e.setStrokeStyle(t,p,(b-i)/w,(x-n)/A,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(v){const{distance:r=l.innerBorder.distance}=f,s=Uc(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,m,i,n,-s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,f,l.innerBorder);else if(T){const r=l.innerBorder.opacity;l.innerBorder.opacity=y,e.setStrokeStyle(t,f,(b-i)/w,(x-n)/A,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}}const gu=new fu,vu=Yc,mu=Hc;class yu extends Vc{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,o,a,l,h,c,u,d){var p,f,g,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:m=t.attribute}=d||{},{texture:y=(null!==(p=t.attribute.texture)&&void 0!==p?p:ps(l,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:ps(l,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:ps(l,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:ps(l,"texturePadding"))}=m;y&&this.drawTexture(y,t,e,i,n,l,b,x,w)}}var bu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wu=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasArcRender=class extends Ic{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=qo,this.builtinContributions=[$c,Kc,qc],this.init(t)}drawArcTailCapPath(t,e,i,n,r,s,o,a){const l=a-o,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=a;const d=Pt(u-c),p=u>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),v=nt(g),{outerDeltaAngle:m,innerDeltaAngle:y,outerStartAngle:b,outerEndAngle:x,innerEndAngle:w,innerStartAngle:A}=t.getParsePadAngle(c,u),S=v?g[0]:g,T=v?g[1]:g,C=v?g[2]:g,_=v?g[3]:g,B=Math.max(T,S),P=Math.max(C,_);let R=B,M=P;const k=r*Mt(b),E=r*Ot(b),O=s*Mt(w),L=s*Ot(w);let I,D,j,U;if((P>St||B>St)&&(I=r*Mt(x),D=r*Ot(x),j=s*Mt(A),U=s*Ot(A),d<Tt)){const t=Ua(k,E,j,U,I,D,O,L);if(t){const e=k-t[0],i=E-t[1],n=I-t[0],o=D-t[1],a=1/Ot(Dt((e*n+i*o)/(Lt(e*e+i*i)*Lt(n*n+o*o)))/2),l=Lt(t[0]*t[0]+t[1]*t[1]);M=Et(P,(s-l)/(a-1)),R=Et(B,(r-l)/(a+1))}}if(R>St){const t=Et(S,R),s=Et(T,R),o=Wa(j,U,k,E,r,t,Number(p)),a=Wa(I,D,O,L,r,s,Number(p));if(R<B&&t===s)e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,R,Rt(o.y01,o.x01),Rt(a.y01,a.x01),!p);else{const t=u-l-.03,o=Rt(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,Rt(a.y11,a.x11),Rt(a.y01,a.x01),!p)}}else e.moveTo(i+k,n+E);if(!(s>St)||y<.001)e.lineTo(i+O,n+L),f=!0;else if(M>St){const t=Et(_,M),r=Et(C,M),o=Wa(O,L,I,D,s,-r,Number(p)),a=Wa(k,E,j,U,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),M<P&&t===r){const t=Rt(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,M,Rt(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,Rt(o.y01,o.x01),Rt(o.y11,o.x11),!p);const t=Rt(o.cy+o.y11,o.cx+o.x11),a=u-l-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*Mt(A),n+s*Ot(A));return f}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t,null==s?void 0:s.theme).arc,{fill:h=l.fill,stroke:c=l.stroke,x:u=l.x,y:d=l.y}=t.attribute,p=this.valid(t,l,o,a);if(!p)return;const{fVisible:f,sVisible:g,doFill:v,doStroke:m}=p,{outerPadding:y=l.outerPadding,innerPadding:b=l.innerPadding,cap:x=l.cap,forceShowCap:w=l.forceShowCap}=t.attribute;let{outerRadius:A=l.outerRadius,innerRadius:S=l.innerRadius}=t.attribute;A+=y,S-=b;let T=0;const C=(X(x)&&x||x[0])&&"conical"===h.gradient;if(C){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();Pt(n-i)<Bt-St&&(T=e||0,h.startAngle-=T,h.endAngle-=T)}let _=!1;const{isFullStroke:B,stroke:P}=is(c);if((v||B)&&(e.beginPath(),Na(t,e,i,n,A,S),_=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,v,m,f,g,l,r,o,a),v&&(o?o(e,t.attribute,l):f&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill())),m&&B&&(a?a(e,t.attribute,l):g&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))),!B&&m&&(e.beginPath(),Na(t,e,i,n,A,S,P),_||this.beforeRenderStep(t,e,i,n,v,m,f,g,l,r,o,a),a?a(e,t.attribute,l):g&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),(X(x)&&x||x[1])&&w){const{startAngle:s,endAngle:h}=t.getParsedAngle();if(Pt(h-s)>=Bt-St){e.beginPath();const s=Math.abs(A-S)/2/A,{endAngle:h=l.endAngle,fill:c=l.fill}=t.attribute,u=h;if(this.drawArcTailCapPath(t,e,i,n,A,S,u,u+s),_||this.beforeRenderStep(t,e,i,n,v,m,f,g,l,r,o,a),v){const r=c;if("conical"===r.gradient){const s=Ha(0,0,h,r);o||Oa&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=s,e.fill())}}m&&(a||g&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke()))}}this.afterRenderStep(t,e,i,n,v,m,f,g,l,r,o,a),C&&(h.startAngle+=T,h.endAngle+=T)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}},t.DefaultCanvasArcRender=bu([g(),wu(0,p(E)),wu(0,v(Ya)),xu("design:paramtypes",[Object])],t.DefaultCanvasArcRender);var Au=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Su=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tu=function(t,e){return function(i,n){e(i,n,t)}};function Cu(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[n]=ti(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,o)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,o)}}function _u(e,i,n,r,s){var o;const{offsetX:a=0,offsetY:l=0,offsetZ:h=0,mode:c="none",drawConnect:u=!1,zeroX:d=0,zeroY:p=0}=s||{};if(u&&"none"===c)return;if(!i)return;let f=!0;const{curves:g}=i;if(n>=1){if(u){let t,i=!0;g.forEach(((n,r)=>{var s;let o=n.p0;if(n.originP1!==n.originP2){if(t&&t.originP1===t.originP2&&(o=t.p0),n.defined)i||(e.lineTo(o.x+a,o.y+l,h),i=!i);else{const{originP1:t,originP2:r}=n;let c;if(t&&!1!==t.defined?c=o:t&&!1!==r.defined&&(c=null!==(s=n.p3)&&void 0!==s?s:n.p1),i){i=!i;const t=c?c.x:n.p0.x,r=c?c.y:n.p0.y;e.moveTo(t+a,r+l,h)}else c&&(i=!i,e.lineTo(c.x+a,c.y+l,h))}t=n}else t=n}))}else g.forEach((t=>{t.defined?(f&&e.moveTo(t.p0.x+a,t.p0.y+l,h),Cu(e,t,1,s),f=!1):f=!0}));return}if(n<=0)return;let v;"x"===r?v=t.Direction.ROW:"y"===r?v=t.Direction.COLUMN:"auto"===r&&(v=i.direction);const m=n*i.tryUpdateLength(v);let y=0,b=!0,x=null;for(let t=0,i=g.length;t<i;t++){const i=g[t],n=i.getLength(v),r=(m-y)/n;if(y+=n,r<0)break;if(u){let t=i.p0;if(i.originP1===i.originP2){x=i;continue}if(x&&x.originP1===x.originP2&&(t=x.p0),i.defined)b||(e.lineTo(t.x+a,t.y+l,h),b=!b);else{const{originP1:n,originP2:r}=i;let s;if(n&&!1!==n.defined?s=t:n&&!1!==r.defined&&(s=null!==(o=i.p3)&&void 0!==o?o:i.p1),b){b=!b;const t=s?s.x:i.p0.x,n=s?s.y:i.p0.y;e.moveTo(t+a,n+l,h)}else s&&(b=!b,e.lineTo(s.x+a,s.y+l,h))}x=i}else{if(!i.defined){f=!0;continue}f&&e.moveTo(i.p0.x+a,i.p0.y+l,h),Cu(e,i,Et(r,1),s),f=!1}}}function Bu(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},o=e?e.points[e.points.length-1]:i.points[0];t.moveTo(o.x+r,o.y+s),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}function Pu(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{var o,a,l,h;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(o=n.x1)&&void 0!==o?o:n.x,null!==(a=n.y1)&&void 0!==a?a:n.y)}t.lineTo(null!==(l=c.x1)&&void 0!==l?l:c.x,null!==(h=c.y1)&&void 0!==h?h:c.y),t.closePath()}))}t.DefaultCanvasCircleRender=class extends Ic{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=Jo,this.builtinContributions=[Jc,tu,Qc],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t,null==s?void 0:s.theme).circle,{radius:h=l.radius,startAngle:c=l.startAngle,endAngle:u=l.endAngle,x:d=l.x,y:p=l.y}=t.attribute,f=this.valid(t,l,o,a);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f;e.beginPath(),e.arc(i,n,h,c,u),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,m,y,g,v,l,r,o,a),m&&(o?o(e,t.attribute,l):g&&(e.setCommonStyle(t,t.attribute,d-i,p-n,l),e.fill())),y&&(a?a(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,m,y,g,v,l,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}},t.DefaultCanvasCircleRender=Au([g(),Tu(0,p(E)),Tu(0,v($a)),Su("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);var Ru=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};function Mu(e,i,n,r){var s;const{drawConnect:o=!1,mode:a="none"}=r||{};if(o&&"none"===a)return;const{top:l,bottom:h}=i;if(l.curves.length!==h.curves.length)return;if(n>=1){const t=[],i=[];let n=!0;if(o){let n,s,o=!0;const a=l.curves.length;l.curves.forEach(((l,c)=>{const u=h.curves[a-c-1];let d=l,p=u;if(l.originP1===l.originP2)return n=l,void(s=u);if(n&&n.originP1===n.originP2&&(d=n,p=s),l.defined)o||(t.push(d),i.push(p),ku(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=l;let a,h;n&&!1!==n.defined?(a=d,h=p):n&&!1!==s.defined&&(a=l,h=u),o?(o=!o,t.push(a||l),i.push(h||u)):a&&(o=!o,t.push(a||l),i.push(h||u),ku(e,t,i,r),t.length=0,i.length=0)}n=l})),ku(e,t,i,r)}else{for(let s=0,o=l.curves.length;s<o;s++){const a=l.curves[s];n!==a.defined?(n?(Eu(e,t,i,r),t.length=0,i.length=0):(t.push(a),i.push(h.curves[o-s-1])),n=!n):n&&(t.push(a),i.push(h.curves[o-s-1]))}Eu(e,t,i,r)}return}if(n<=0)return;let{direction:c}=r||{};const{curves:u}=l,d=null!==(s=u[u.length-1].p3)&&void 0!==s?s:u[u.length-1].p1,p=Pt(d.x-u[0].p0.x),f=Pt(d.y-u[0].p0.y);c=null!=c?c:p>f?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(p)||(c=t.Direction.COLUMN),Number.isFinite(f)||(c=t.Direction.ROW);const g=n*(c===t.Direction.ROW?p:f);let v=0,m=!0;const y=[],b=[];let x,w,A=!0;for(let t=0,i=l.curves.length;t<i;t++){const n=l.curves[t],s=n.getLength(c),a=(g-v)/s;if(a<0)break;if(v+=s,o){const s=h.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){x=n,w=s;continue}if(x&&x.originP1===x.originP2&&(o=x,a=w),n.defined)A||(y.push(o),b.push(a),ku(e,y,b,r),y.length=0,b.length=0,A=!A);else{const{originP1:t,originP2:i}=n;let l,h;t&&!1!==t.defined?(l=o,h=a):t&&!1!==i.defined&&(l=n,h=s),A?(A=!A,y.push(l||n),b.push(h||s)):l&&(A=!A,y.push(l||n),b.push(h||s),ku(e,y,b,r),y.length=0,b.length=0)}x=n}else{let s=null,o=null;m!==n.defined?(m?(Eu(e,y,b,r),y.length=0,b.length=0):(s=n,o=h.curves[i-t-1]),m=!m):m&&(s=n,o=h.curves[i-t-1]),s&&o&&(a<1&&(s=s.p2&&s.p3?ti(s,a)[0]:ii(s,a)[0],o=o.p2&&o.p3?ti(o,1-a)[1]:ii(o,1-a)[1]),s.defined=m,o.defined=m,y.push(s),b.push(o)),s=null,o=null}}o?ku(e,y,b,r):Eu(e,y,b,r)}function ku(t,e,i,n){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=n||{};let l=e[0];t.moveTo(l.p0.x+r,l.p0.y+s,o),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+r,h.y+s,o),l=i[i.length-1],t.lineTo(l.p0.x+r,l.p0.y+s,o),l=i[0],h=l.p3||l.p1,t.lineTo(h.x+r,h.y+s,o),t.closePath()}function Eu(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=n||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+r,e.p0.y+s,o),Cu(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const l=i[e];l.defined?(a&&t.lineTo(l.p0.x+r,l.p0.y+s,o),Cu(t,l,1,n),a=!1):a=!0}t.closePath()}t.DefaultCanvasLineRender=class extends Ic{constructor(){super(...arguments),this.numberType=ia}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f){var g,v,m,y,b;if(!e)return;t.beginPath();const x=null!==(g=this.z)&&void 0!==g?g:0;_u(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:x}),d.cache&&!nt(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,o,a);const{x:w=0,x:A=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,o,w-c,A-u,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,o,w-c,A-u,a),t.stroke()));let{connectedType:S,connectedX:T,connectedY:C,connectedStyle:_}=o;if(nt(a)?(S=null!==(v=null!=S?S:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,T=null!==(m=null!=T?T:a[0].connectedX)&&void 0!==m?m:a[1].connectedX,C=null!==(y=null!=C?C:a[0].connectedY)&&void 0!==y?y:a[1].connectedY,_=null!==(b=null!=_?_:a[0].connectedStyle)&&void 0!==b?b:a[1].connectedStyle):(S=null!=S?S:a.connectedType,T=null!=T?T:a.connectedX,C=null!=C?C:a.connectedY,_=null!=_?_:a.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),"none"!==S){t.beginPath(),_u(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:x,drawConnect:!0,mode:S,zeroX:T,zeroY:C});const g=[];nt(a)?a.forEach((t=>g.push(t))):g.push(a),g.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,_,w-c,A-u,g),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,_,w-c,A-u,g),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,n,r,s,o,a,l,h,c,u,d){var p;e.beginPath();const f=null!==(p=this.z)&&void 0!==p?p:0,{points:g}=t.attribute,v=g[0];e.moveTo(v.x+o,v.y+a,f);for(let t=1;t<g.length;t++){const i=g[t];e.lineTo(i.x+o,i.y+a,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:m=0,x:y=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):r&&(e.setCommonStyle(t,t.attribute,m-o,y-a,l),e.fill())),!1!==n&&(d?d(e,t.attribute,l):s&&(e.setStrokeStyle(t,t.attribute,m-o,y-a,l),e.stroke()))}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t,null==s?void 0:s.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:f,closePath:g,curveTension:v=l.curveTension}=t.attribute;if(!this.valid(t,l,o,a))return;let{curveType:m=l.curveType}=t.attribute;g&&"linear"===m&&(m="linearClosed");const{clipRange:y=l.clipRange,clipRangeByDimension:b=l.clipRangeByDimension}=t.attribute;if(1===y&&!p&&!f.some((t=>!1===t.defined))&&"linear"===m)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,n,l,r,s,o,a);if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const r=Ii(t.points,m,{startPoint:e,curveTension:v});return n=r,r})).filter((t=>!!t)),"linearClosed"===m){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Ii(n,m,{curveTension:v})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===y){let s=!1;t.cache.forEach(((p,f)=>{s||(s=this.drawSegmentItem(e,p,!!h,!!c,u,d,r[f],[l,t.attribute],y,b,i,n,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=y*s;let f=0,g=!1;t.cache.forEach(((s,v)=>{if(g)return;const m=s.getLength(),y=(p-f)/m;f+=m,y>0&&(g=this.drawSegmentItem(e,s,!!h,!!c,u,d,r[v],[l,t.attribute],Et(y,1),b,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,y,b,i,n,t,o,a)}},t.DefaultCanvasLineRender=Ru([g()],t.DefaultCanvasLineRender);const Ou=new yu,Lu=Hc;var Iu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Du=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ju=function(t,e){return function(i,n){e(i,n,t)}};function Uu(t,e,i){var n,r;switch(e){case"linear":default:return hi(t,i);case"basis":return fi(t,i);case"monotoneX":return Ai(t,i);case"monotoneY":return Ti(t,i);case"step":return _i(t,.5,i);case"stepBefore":return _i(t,0,i);case"stepAfter":return _i(t,1,i);case"catmullRom":return Oi(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Li(t,null!==(r=null==i?void 0:i.curveTension)&&void 0!==r?r:.5,i);case"linearClosed":return Ri(t,i)}}t.DefaultCanvasAreaRender=class extends Ic{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=Zo,this.builtinContributions=[Ou,Lu],this.init(t)}drawLinearAreaHighPerformance(t,e,i,n,r,s,o,a,l,h,c,u,d){var p,f,g,v,m;const{points:y}=t.attribute;if(y.length<2)return;e.beginPath();const b=null!==(p=this.z)&&void 0!==p?p:0,x=y[0];e.moveTo(x.x+o,x.y+a,b);for(let t=1;t<y.length;t++){const i=y[t];e.lineTo(i.x+o,i.y+a,b)}for(let t=y.length-1;t>=0;t--){const i=y[t];e.lineTo((null!==(f=i.x1)&&void 0!==f?f:i.x)+o,(null!==(g=i.y1)&&void 0!==g?g:i.y)+a,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,o,a,!!r,!1,i,!1,l,h,u,null,{attribute:t.attribute});const{x:w=0,x:A=0}=t.attribute;if(!1!==i&&(u?u(e,t.attribute,l):r&&(e.setCommonStyle(t,t.attribute,w-o,A-a,l),e.fill())),this.afterRenderStep(t,e,o,a,!!r,!1,i,!1,l,h,u,null,{attribute:t.attribute}),n){const{stroke:i=l&&l.stroke}=t.attribute;if(nt(i)&&(i[0]||i[2])&&!1===i[1])if(e.beginPath(),i[0]){e.moveTo(x.x+o,x.y+a,b);for(let t=1;t<y.length;t++){const i=y[t];e.lineTo(i.x+o,i.y+a,b)}}else if(i[2]){const t=y[y.length-1];e.moveTo(t.x+o,t.y+a,b);for(let t=y.length-2;t>=0;t--){const i=y[t];e.lineTo((null!==(v=i.x1)&&void 0!==v?v:i.x)+o,(null!==(m=i.y1)&&void 0!==m?m:i.y)+a,b)}}d?d(e,t.attribute,l):(e.setStrokeStyle(t,t.attribute,w-o,A-a,l),e.stroke())}}drawShape(t,e,i,n,r,s,o,a){var l,h,c,u,d,p;const f=Tr(t,null==s?void 0:s.theme).area,{fill:g=f.fill,stroke:v=f.stroke,fillOpacity:m=f.fillOpacity,z:y=f.z,strokeOpacity:b=f.strokeOpacity,curveTension:x=f.curveTension}=t.attribute,w=this.valid(t,f,o,a);if(!w)return;const{doFill:A}=w,S=w.doStroke&&w.sVisible,{clipRange:T=f.clipRange,closePath:C,points:_,segments:B}=t.attribute;let{curveType:P=f.curveType}=t.attribute;if(C&&"linear"===P&&(P="linearClosed"),1===T&&!B&&!_.some((t=>!1===t.defined))&&"linear"===P)return this.drawLinearAreaHighPerformance(t,e,!!g,S,m,b,i,n,f,r,s,o,a);if(t.shouldUpdateShape()){if(B&&B.length){let e,i;const n=B.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===n?e={x:i.endX,y:i.endY}:n>1&&(e.x=i.endX,e.y=i.endY);const r=Uu(t.points,P,{startPoint:e,curveTension:x});return i=r,r})).filter((t=>!!t));let r;const s=[];for(let t=B.length-1;t>=0;t--){const e=B[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=B[t-1].points,n=e[e.length-1];n&&i.push({x:null!==(c=n.x1)&&void 0!==c?c:n.x,y:null!==(u=n.y1)&&void 0!==u?u:n.y})}i.length>1&&(r=Uu(i,"stepBefore"===P?"stepAfter":"stepAfter"===P?"stepBefore":P,{curveTension:x}),s.unshift(r))}t.cacheArea=s.map(((t,e)=>({top:n[e],bottom:t})))}else{if(!_||!_.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=_,i=[];for(let t=_.length-1;t>=0;t--)i.push({x:null!==(d=_[t].x1)&&void 0!==d?d:_[t].x,y:null!==(p=_[t].y1)&&void 0!==p?p:_[t].y});const n=Uu(e,P,{curveTension:x}),r=Uu(i,"stepBefore"===P?"stepAfter":"stepAfter"===P?"stepBefore":P,{curveTension:x});t.cacheArea={top:n,bottom:r}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===T){let l=!1;t.cacheArea.forEach(((h,c)=>{l||(l=this.drawSegmentItem(e,h,A,m,S,b,s[c],[f,t.attribute],T,i,n,y,t,r,o,a))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=T*l;let c=0,u=!1;t.cacheArea.forEach(((l,d)=>{if(u)return;const p=l.top.getLength(),g=(h-c)/p;c+=p,g>0&&(u=this.drawSegmentItem(e,l,A,m,S,b,s[d],[f,t.attribute],Et(g,1),i,n,y,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,A,m,S,b,t.attribute,f,T,i,n,y,t,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f,g){let v=!1;return v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,!1,f,g),v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,!0,f,g),v}_drawSegmentItem(e,i,n,r,s,o,a,l,h,c,u,d,p,f,g,v,m){var y,b,x,w;if(!(i&&i.top&&i.bottom&&i.top.curves&&i.top.curves.length&&i.bottom.curves&&i.bottom.curves.length))return;let{connectedType:A,connectedX:S,connectedY:T,connectedStyle:C}=a;const _=[];if(g&&(nt(l)?(A=null!==(y=null!=A?A:l[0].connectedType)&&void 0!==y?y:l[1].connectedType,S=null!==(b=null!=S?S:l[0].connectedX)&&void 0!==b?b:l[1].connectedX,T=null!==(x=null!=T?T:l[0].connectedY)&&void 0!==x?x:l[1].connectedY,C=null!==(w=null!=C?C:l[0].connectedStyle)&&void 0!==w?w:l[1].connectedStyle):(A=null!=A?A:l.connectedType,S=null!=S?S:l.connectedX,T=null!=T?T:l.connectedY,C=null!=C?C:l.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),nt(l)?l.forEach((t=>_.push(t))):_.push(l),_.push(a)),g&&"none"===A)return!1;e.beginPath();const{points:B,segments:P}=p.attribute;let R,M,k=t.Direction.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],R=t.points[t.points.length-1]}else M=B[0],R=B[B.length-1];const E=Pt(R.x-M.x),O=Pt(R.y-M.y);k=null==R.x1?t.Direction.ROW:null==R.y1?t.Direction.COLUMN:Number.isFinite(E+O)?E>O?t.Direction.ROW:t.Direction.COLUMN:t.Direction.ROW,Mu(e.camera?e:e.nativeContext,i,h,{offsetX:c,offsetY:u,offsetZ:d,direction:k,drawConnect:g,mode:A,zeroX:S,zeroY:T}),this.beforeRenderStep(p,e,c,u,!!r,!1,n,!1,l,f,v,null,{attribute:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(p,a,l);const{x:L=0,x:I=0}=a;if(!1!==n&&(v?v(e,a,l):r&&(e.setCommonStyle(p,g?C:a,L-c,I-u,g?_:l),e.fill())),this.afterRenderStep(p,e,c,u,!!r,!1,n,!1,l,f,v,null,{attribute:a}),!1!==s)if(m)m(e,a,l);else{const{stroke:n=l&&l[1]&&l[1].stroke}=a;nt(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),_u(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,h,k===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d,drawConnect:g,mode:A,zeroX:S,zeroY:T})),e.setStrokeStyle(p,g?C:a,L-c,I-u,g?_:l),e.stroke()}return!1}},t.DefaultCanvasAreaRender=Iu([g(),ju(0,p(E)),ju(0,v(Xa)),Du("design:paramtypes",[Object])],t.DefaultCanvasAreaRender);const Wu=Yc,Nu=Hc;var Fu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},zu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gu=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPathRender=class extends Ic{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=na,this.builtinContributions=[Nu,Wu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){var l,h,c;const u=null!==(l=this.tempTheme)&&void 0!==l?l:Tr(t,null==s?void 0:s.theme).path,{x:d=u.x,y:p=u.y}=t.attribute,f=null!==(h=this.z)&&void 0!==h?h:0,g=this.valid(t,u,o,a);if(!g)return;const{fVisible:v,sVisible:m,doFill:y,doStroke:b}=g;if(e.beginPath(),t.pathShape)$e(t.pathShape.commandList,e,i,n,1,1,f);else{$e((null!==(c=t.attribute.path)&&void 0!==c?c:u.path).commandList,e,i,n,1,1,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,y,b,v,m,u,r,o,a),b&&(a?a(e,t.attribute,u):m&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,u),e.stroke())),y&&(o?o(e,t.attribute,u):v&&(e.setCommonStyle(t,t.attribute,d-i,p-n,u),e.fill())),this.afterRenderStep(t,e,i,n,y,b,v,m,u,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasPathRender=Fu([g(),Gu(0,p(E)),Gu(0,v(Za)),zu("design:paramtypes",[Object])],t.DefaultCanvasPathRender);var Hu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Vu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yu=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasRectRender=class extends Ic{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=oa,this.builtinContributions=[au,hu,lu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){var l;const h=null!==(l=this.tempTheme)&&void 0!==l?l:Tr(t,null==s?void 0:s.theme).rect,{fill:c=h.fill,background:u,stroke:d=h.stroke,cornerRadius:p=h.cornerRadius,opacity:f=h.opacity,fillOpacity:g=h.fillOpacity,lineWidth:v=h.lineWidth,strokeOpacity:m=h.strokeOpacity,visible:y=h.visible,x1:b,y1:x,x:w=h.x,y:A=h.y}=t.attribute;let{width:S,height:T}=t.attribute;S=(null!=S?S:b-w)||0,T=(null!=T?T:x-A)||0;const C=La(f,g,S,T,c),_=Da(f,m,S,T),B=ka(c,u),P=Ea(d,v);if(!t.valid||!y)return;if(!B&&!P)return;if(!(C||_||o||a||u))return;0===p||nt(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(i,n,S,T)):(e.beginPath(),ru(e,i,n,S,T,p));const R={doFill:B,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,B,P,C,_,h,r,o,a,R),R.doFill&&(o?o(e,t.attribute,h):C&&(e.setCommonStyle(t,t.attribute,w-i,A-n,h),e.fill())),R.doStroke&&(a?a(e,t.attribute,h):_&&(e.setStrokeStyle(t,t.attribute,w-i,A-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,B,P,C,_,h,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasRectRender=Hu([g(),Yu(0,p(E)),Yu(0,v(Qa)),Vu("design:paramtypes",[Object])],t.DefaultCanvasRectRender);var Xu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$u=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qu=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasSymbolRender=class extends Ic{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=ha,this.builtinContributions=[gu,mu,vu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){var l;const h=Tr(t,null==s?void 0:s.theme).symbol,{size:c=h.size,x:u=h.x,y:d=h.y,scaleX:p=h.scaleX,scaleY:f=h.scaleY}=t.attribute,g=this.valid(t,h,o,a);if(!g)return;const{fVisible:v,sVisible:m,doFill:y,doStroke:b}=g,x=t.getParsedPath();if(!x)return;const{keepDirIn3d:w=h.keepDirIn3d}=t.attribute,A=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),w&&e.camera&&e.project){const r=e.project(i,n,A),s=e.camera;e.camera=null,!1===x.draw(e,nt(c)?[c[0]*p,c[1]*f]:c*p,r.x,r.y,void 0,((r,s)=>{var l,c,g;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(l=s.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(c=s.fill)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=s.stroke)&&void 0!==g?g:t.attribute.stroke,s=e}s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,u-i,d-n,h),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f,h),e.stroke()))}))&&e.closePath(),e.camera=s}else!1===x.draw(e,c,i,n,A,((r,s)=>{var l,c,g;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(l=s.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(c=s.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=s.stroke)&&void 0!==g?g:t.attribute.stroke,s=e}s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,u-i,d-n,h),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f,h),e.stroke()))}))&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,y,b,v,m,h,r,o,a),y&&!x.isSvg&&(o?o(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill())),b&&!x.isSvg&&(a?a(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(d-n)/f,h),e.stroke())),this.afterRenderStep(t,e,i,n,y,b,v,m,h,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}},t.DefaultCanvasSymbolRender=Xu([g(),qu(0,p(E)),qu(0,v(tl)),$u("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender);const Ku=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Vt)}allocate(t,e,i,n){if(!this.pools.length)return(new Vt).setValue(t,e,i,n);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=n,r}allocateByObj(t){if(!this.pools.length)return new Vt(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Zu=new class extends Gc{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,l,h,c,u){var d,p,f,g,v,m,y,b,x,w;const{backgroundMode:A=l.backgroundMode,backgroundFit:S=l.backgroundFit}=t.attribute;let T,{background:C}=t.attribute;if(!C)return;const _=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let B;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=Z(C)&&C.background,R=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(d=C.x)&&void 0!==d?d:e.x1)+(null!==(p=C.dx)&&void 0!==p?p:0),n=(null!==(f=C.y)&&void 0!==f?f:e.y1)+(null!==(g=C.dy)&&void 0!==g?g:0),r=null!==(v=C.width)&&void 0!==v?v:e.width(),s=null!==(m=C.height)&&void 0!==m?m:e.height();if(B=Ku.allocate(i,n,i+r,n+s),C=C.background,!R){const t=B.width(),e=B.height();B.set((null!==(y=C.x)&&void 0!==y?y:0)+(null!==(b=C.dx)&&void 0!==b?b:0),(null!==(x=C.y)&&void 0!==x?x:0)+(null!==(w=C.dy)&&void 0!==w?w:0),t,e)}}else B=t.AABBBounds,R||(B=Oc(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(C);if("success"!==r.state||!r.data)return void _();e.highPerformanceSave(),R&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,l),this.doDrawImage(e,r.data,B,A,S),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=C,r?(ru(e,B.x1,B.y1,B.width(),B.height(),r),e.fill()):e.fillRect(B.x1,B.y1,B.width(),B.height()),e.highPerformanceRestore()}P&&Ku.free(B),_()}};var Ju=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Qu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},td=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasTextRender=class extends Ic{constructor(t){super(),this.textRenderContribitions=t,this.numberType=ca,this.builtinContributions=[Zu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){var l,h,c;const u=Tr(t,null==s?void 0:s.theme).text,{text:d,underline:p=u.underline,lineThrough:f=u.lineThrough,keepDirIn3d:g=u.keepDirIn3d,direction:v=u.direction,whiteSpace:m=u.whiteSpace,fontSize:y=u.fontSize,verticalMode:b=u.verticalMode,x:x=u.x,y:w=u.y}=t.attribute;let{textAlign:A=u.textAlign,textBaseline:S=u.textBaseline}=t.attribute;if(!b&&"vertical"===v){const e=A;A=null!==(l=t.getBaselineMapAlign()[S])&&void 0!==l?l:"left",S=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}const T=null!==(c=vs(t.attribute.lineHeight,y))&&void 0!==c?c:y,C=this.valid(t,u,o,a);if(!C)return;const{fVisible:_,sVisible:B,doFill:P,doStroke:R}=C,M=!g,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,P,R,_,B,u,r,o,a),M&&this.transformUseContext2d(t,u,k,e);const E=(r,s,l,h)=>{let c=i+s;const d=n+l;if(h){e.highPerformanceSave(),c+=y;const t=yc.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),yc.free(t)}R&&(a?a(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,x-i,w-n,u),e.strokeText(r,c,d,k))),P&&(o?o(e,t.attribute,u):_&&(e.setCommonStyle(t,t.attribute,x-i,w-n,u),e.fillText(r,c,d,k),this.drawUnderLine(p,f,t,c,d,k,u,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,k),"horizontal"===v){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;R&&(a?a(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,x-i,w-n,u),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+i,(t.topOffset||0)+l+n,k)})))),P&&(o?o(e,t.attribute,u):_&&(e.setCommonStyle(t,t.attribute,x-i,w-n,u),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+i,(r.topOffset||0)+l+n,k),this.drawMultiUnderLine(p,f,t,(r.leftOffset||0)+s+i,(r.topOffset||0)+l+n-ll("bottom",y)-.05*y,k,r.width,u,e)}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:n}=i;e.textAlign="left",e.textBaseline="top";const r=T*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=kt(e,s)}));let o=0,a=0;"bottom"===S?a=-r:"middle"===S&&(a=-r/2),"center"===A?o-=s/2:"right"===A&&(o-=s),n.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),n=s-i;let l=o;"center"===A?l+=n/2:"right"===A&&(l+=n),t.forEach((t=>{const{text:i,width:n,direction:s}=t;E(i,r-(e+1)*T+a,l,s),l+=n}))}))}else if("horizontal"===v){e.setTextStyle(t.attribute,u,k);const i=t.clipedText;let n=0;T!==y&&("top"===S?n=(T-y)/2:"middle"===S||"bottom"===S&&(n=-(T-y)/2)),E(i,0,n,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,u,k);const{verticalList:n}=i;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===S?o=-T:"middle"===S&&(o=-T/2),"center"===A?r-=s/2:"right"===A&&(r-=s),e.textAlign="left",e.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;E(e,o,r,n),r+=i}))}}M&&this.restoreTransformUseContext2d(t,u,k,e),this.afterRenderStep(t,e,i,n,P,R,_,B,u,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,o=!s;this._draw(t,r,o,i,n)}drawUnderLine(t,e,i,n,r,s,o,a){if(e+t<=0)return;const{textAlign:l=o.textAlign,textBaseline:h=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,underlineOffset:p=o.underlineOffset,underlineDash:f=o.underlineDash,fillOpacity:g=o.fillOpacity}=i.attribute,v=i.clipedWidth,m=hl(l,v),y=cl(h,c,c),b={lineWidth:0,stroke:u,opacity:d,strokeOpacity:g};if(t){b.lineWidth=t,a.setStrokeStyle(i,b,n,r,o),f&&a.setLineDash(f),a.beginPath();const e=r+y+c+p;a.moveTo(n+m,e,s),a.lineTo(n+m+v,e,s),a.stroke()}if(e){b.lineWidth=e,a.setStrokeStyle(i,b,n,r,o),a.beginPath();const t=r+y+c/2;a.moveTo(n+m,t,s),a.lineTo(n+m+v,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,l){if(e+t<=0)return;const{fontSize:h=a.fontSize,fill:c=a.fill,opacity:u=a.opacity,underlineOffset:d=a.underlineOffset,underlineDash:p=a.underlineDash,fillOpacity:f=a.fillOpacity}=i.attribute,g=cl("alphabetic",h,h),v={lineWidth:0,stroke:c,opacity:u,strokeOpacity:f};let m=-3;if(t){v.lineWidth=t,l.setStrokeStyle(i,v,n,r,a),p&&l.setLineDash(p),l.beginPath();const e=r+g+h+m+d;l.moveTo(n+0,e,s),l.lineTo(n+0+o,e,s),l.stroke()}if(m=-1,e){v.lineWidth=e,l.setStrokeStyle(i,v,n,r,a),l.beginPath();const t=r+g+h/2+m;l.moveTo(n+0,t,s),l.lineTo(n+0+o,t,s),l.stroke()}}},t.DefaultCanvasTextRender=Ju([g(),td(0,p(E)),td(0,v(el)),Qu("design:paramtypes",[Object])],t.DefaultCanvasTextRender);var ed=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};function id(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function nd(t,e){return Math.sqrt(t*t+e*e)}function rd(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.AbstractGraphicRender=class{},t.AbstractGraphicRender=ed([g()],t.AbstractGraphicRender);const sd=Yc,od=Hc;var ad=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ld=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hd=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPolygonRender=class extends Ic{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=ra,this.builtinContributions=[od,sd],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t,null==s?void 0:s.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath}=t.attribute,f=this.valid(t,l,o,a);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f;e.beginPath(),c<=0||nt(c)&&c.every((t=>0===t))?id(e.camera?e:e.nativeContext,h,i,n):function(t,e,i,n,r){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var o;if(e.length<3)return void id(t,e,i,n);let a=0,l=e.length-1;s||(a+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=a;s<=l;s++){const a=e[0===s?l:(s-1)%e.length],h=e[s%e.length],c=e[(s+1)%e.length],u=h.x-a.x,d=h.y-a.y,p=h.x-c.x,f=h.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,v=Math.abs(Math.tan(g));let m=Array.isArray(r)?null!==(o=r[s%e.length])&&void 0!==o?o:0:r,y=m/v;const b=nd(u,d),x=nd(p,f),w=Math.min(b,x);y>w&&(y=w,m=w*v);const A=rd(h,y,b,u,d),S=rd(h,y,x,p,f),T=2*h.x-A.x-S.x,C=2*h.y-A.y-S.y,_=nd(T,C),B=rd(h,nd(y,m),_,T,C);let P=Math.atan2(A.y-B.y,A.x-B.x);const R=Math.atan2(S.y-B.y,S.x-B.x);let M=R-P;M<0&&(P=R,M=-M),M>Math.PI&&(M-=Math.PI),0===s?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),M&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,m),t.lineTo(S.x+i,S.y+n)}s||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,h,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,m,y,g,v,l,r,o,a),m&&(o?o(e,t.attribute,l):g&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill())),y&&(a?a(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,m,y,g,v,l,r,o,a)}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPolygonRender=ad([g(),hd(0,p(E)),hd(0,v(Ja)),ld("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);var cd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ud=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dd=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasGroupRender=class{constructor(t){this.groupRenderContribitions=t,this.numberType=ta}drawShape(e,i,n,r,s,o,a,l){const h=Tr(e,null==o?void 0:o.theme).group,{fill:c=h.fill,background:u,stroke:d=h.stroke,opacity:p=h.opacity,width:f=h.width,height:g=h.height,clip:v=h.clip,fillOpacity:m=h.fillOpacity,strokeOpacity:y=h.strokeOpacity,cornerRadius:b=h.cornerRadius,path:x=h.path,lineWidth:w=h.lineWidth,visible:A=h.visible}=e.attribute,S=La(p,m,f,g,c),T=Da(p,y,f,g),C=ka(c,u),_=Ea(d,w);if(!e.valid||!A)return;if(!v){if(!C&&!_)return;if(!(S||T||a||l||u))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,o)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||nt(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),ru(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(iu));const B={doFill:C,doStroke:_};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,_,S,T,h,s,a,l,B)})),v&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,h),B.doFill&&(a?a(i,e.attribute,h):S&&(i.setCommonStyle(e,e.attribute,n,r,h),i.fill())),B.doStroke&&(l?l(i,e.attribute,h):T&&(i.setStrokeStyle(e,e.attribute,n,r,h),i.stroke())),this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,_,S,T,h,s,a,l)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s,baseOpacity:o=1}=t.attribute;s?r.save():r.highPerformanceSave();const a=r.baseGlobalAlpha;r.baseGlobalAlpha*=o;const l=Tr(t,null==n?void 0:n.theme).group,h=r.modelMatrix;if(r.camera){const e=bc.allocate(),i=bc.allocate();Pc(i,t,l),Bc(e,h||e,i),r.modelMatrix=e,bc.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:c=l.scrollX,scrollY:u=l.scrollY}=t.attribute;let d;(c||u)&&r.translate(c,u),n&&n.drawingCb&&(d=n.drawingCb()),r.modelMatrix!==h&&bc.free(r.modelMatrix),r.modelMatrix=h,r.baseGlobalAlpha=a,d&&d.then?d.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}},t.DefaultCanvasGroupRender=cd([g(),dd(0,p(E)),dd(0,v(qa)),ud("design:paramtypes",[Object])],t.DefaultCanvasGroupRender);var pd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},fd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gd=function(t,e){return function(i,n){e(i,n,t)}};const vd=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class extends Ic{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=ea,this.builtinContributions=[du,pu],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const l=Tr(t).image,{width:h=l.width,height:c=l.height,repeatX:u=l.repeatX,repeatY:d=l.repeatY,x:p=l.x,y:f=l.y,cornerRadius:g=l.cornerRadius,image:v}=t.attribute,m=this.valid(t,l,o);if(!m)return;const{fVisible:y,sVisible:b,doFill:x,doStroke:w}=m;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,l),this.beforeRenderStep(t,e,i,n,x,!1,y,!1,l,r,o),x)if(o)o(e,t.attribute,l);else if(y){if(!v||!t.resources)return;const r=t.resources.get(v);if("success"!==r.state)return;let s=!1;0===g||nt(g)&&g.every((t=>0===t))||(e.beginPath(),ru(e,i,n,h,c,g),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,i,n,l);let o=0;if("repeat"===u&&(o|=1),"repeat"===d&&(o|=2),o){const t=e.createPattern(r.data,vd[o]);e.fillStyle=t,e.translate(i,n,!0),e.fillRect(0,0,h,c),e.translate(-i,-n,!0)}else e.drawImage(r.data,i,n,h,c);s&&e.restore()}w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,p-i,f-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,x,!1,y,!1,l,r,o)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;const r=t.resources.get(n);if("loading"===r.state&&it(n))return void vo.improveImageLoading(n);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const o=Tr(t).image;this._draw(t,o,!1,i)}},t.DefaultCanvasImageRender=pd([g(),gd(0,p(E)),gd(0,v(Ka)),fd("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const md=Symbol.for("IncrementalDrawContribution"),yd=Symbol.for("ArcRender"),bd=Symbol.for("Arc3dRender"),xd=Symbol.for("AreaRender"),wd=Symbol.for("CircleRender"),Ad=Symbol.for("GraphicRender"),Sd=Symbol.for("GroupRender"),Td=Symbol.for("LineRender"),Cd=Symbol.for("PathRender"),_d=Symbol.for("PolygonRender"),Bd=Symbol.for("RectRender"),Pd=Symbol.for("Rect3DRender"),Rd=Symbol.for("SymbolRender"),Md=Symbol.for("TextRender"),kd=Symbol.for("RichTextRender"),Ed=Symbol.for("Pyramid3dRender"),Od=Symbol.for("GlyphRender"),Ld=Symbol.for("ImageRender"),Id=Symbol.for("RenderSelector"),Dd=Symbol.for("DrawContribution");var jd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ud=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Wd=Symbol.for("DrawItemInterceptor"),Nd=new Vt,Fd=new Vt;class zd{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){Nd.copy(n.dirtyBounds),Fd.copy(n.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e),n.backupDirtyBounds.copy(n.dirtyBounds)}return n.renderGroup(t.shadowRoot,i,yc.allocate(1,0,0,1,0,0)),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&(n.dirtyBounds.copy(Nd),n.backupDirtyBounds.copy(Fd)),!0}}class Gd{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(o.x1,o.y1,o.width(),o.height()),s.highPerformanceRestore(),!0}}t.CommonDrawItemInterceptorContribution=class{constructor(){this.order=1,this.interceptors=[new zd,new Vd,new Hd,new Gd]}afterDrawItem(t,e,i,n,r){for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].afterDrawItem&&this.interceptors[s].afterDrawItem(t,e,i,n,r))return!0;return!1}beforeDrawItem(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].beforeDrawItem&&this.interceptors[s].beforeDrawItem(t,e,i,n,r))return!0;return!1}},t.CommonDrawItemInterceptorContribution=jd([g(),Ud("design:paramtypes",[])],t.CommonDrawItemInterceptorContribution);class Hd{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}beforeSetInteractive(t,e,i,n,r){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(s),!0}if(s){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(s),t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,r){const s=t.baseGraphic;if(!s.stage){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(s){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?n.renderGroup(s,i,s.parent.globalTransMatrix):n.renderItem(s,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Mc.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class Vd{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const l=bc.allocate();_c(l,a);const h=s.modelMatrix;if(h){if(l){const t=bc.allocate();s.modelMatrix=Bc(t,h,l)}}else s.modelMatrix=l;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===Ko,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var i,n,r,s;let o=((null!==(i=t.attribute.startAngle)&&void 0!==i?i:0)+(null!==(n=t.attribute.endAngle)&&void 0!==n?n:0))/2,a=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(s=e.attribute.endAngle)&&void 0!==s?s:0))/2;for(;o<0;)o+=Bt;for(;a<0;)a+=Bt;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)}));const s=t.parent.globalTransMatrix;i.hack_pieFace="outside",n.renderGroup(t,i,s),i.hack_pieFace="inside",n.renderGroup(t,i,s),i.hack_pieFace="top",n.renderGroup(t,i,s),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(r){const e=t.getChildren(),r=e.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));r.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),r.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),r.forEach((e=>{t.add(e.g)})),n.renderGroup(t,i,t.parent.globalTransMatrix,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else n.renderGroup(t,i,t.parent.globalTransMatrix)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==h&&bc.free(s.modelMatrix),s.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Yd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Xd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$d=function(t,e){return function(i,n){e(i,n,t)}};const qd=Symbol.for("RenderService"),Kd=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}},t.DefaultRenderService=Yd([g(),$d(0,p(Dd)),Xd("design:paramtypes",[Object])],t.DefaultRenderService);var Zd=new i((e=>{e(qd).to(t.DefaultRenderService)}));const Jd=Symbol.for("GraphicPicker"),Qd=Symbol.for("PickerService"),tp=Symbol.for("BoundsPicker"),ep=Symbol.for("GlobalPickerService");var ip=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};const np=Symbol.for("PickItemInterceptor");t.ShadowRootPickItemInterceptorContribution=class{constructor(){this.order=1}afterPickItem(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}_pickItem(t,e,i,n,r){var s;if(!t.shadowRoot)return null;const{parentMatrix:o}=r||{};if(!o)return null;const a=e.pickContext;a.highPerformanceSave();const l=null===(s=Tr(t))||void 0===s?void 0:s[t.type],{shadowPickMode:h=(null==l?void 0:l.shadowPickMode)}=t.attribute,c=t.shadowRoot,u=yc.allocateByObj(o),d=new Ft(u.a*i.x+u.c*i.y+u.e,u.b*i.x+u.d*i.y+u.f),p=e.pickGroup(c,d,u,n);return a.highPerformanceRestore(),!p.graphic&&p.group&&"full"===h&&(p.graphic=p.group),p}},t.ShadowRootPickItemInterceptorContribution=ip([g()],t.ShadowRootPickItemInterceptorContribution),t.InteractivePickItemInterceptorContribution=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){const s=t.baseGraphic;if(s&&s.parent){const t=new Ft(i.x,i.y),r=e.pickContext;r.highPerformanceSave();const o=s.parent.globalTransMatrix;o.transformPoint(t,t);const a=s.isContainer?e.pickGroup(s,t.clone(),o,n):e.pickItem(s,t.clone(),o,n);return r.highPerformanceRestore(),a}return null}},t.InteractivePickItemInterceptorContribution=ip([g()],t.InteractivePickItemInterceptorContribution),t.Canvas3DPickItemInterceptor=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,l=!1;if(t.forEachChildren((t=>(a=t.numberType===Ko,!a))),t.forEachChildren((t=>(l=!!t.findFace,!l))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var i,n,r,s;let o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,a=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;o<0;)o+=Bt;for(;a<0;)a+=Bt;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",o=e.pickGroup(t,i,r.parentMatrix,n),o.graphic||(n.hack_pieFace="inside",o=e.pickGroup(t,i,r.parentMatrix,n)),o.graphic||(n.hack_pieFace="top",o=e.pickGroup(t,i,r.parentMatrix,n)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(l){const a=t.getChildren(),l=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));l.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),l.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),l.forEach((e=>{t.add(e.g)})),o=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,n.in3dInterceptor=!1,s.restore(),o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}},t.Canvas3DPickItemInterceptor=ip([g()],t.Canvas3DPickItemInterceptor);var rp=new i(((e,i,n)=>{n(Qd)||(e(ep).toSelf(),e(Qd).toService(ep)),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(np).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(np).toService(t.ShadowRootPickItemInterceptorContribution),e(t.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),e(np).toService(t.InteractivePickItemInterceptorContribution),L(e,np)})),sp=new i((e=>{e(ua).to(t.DefaultGraphicService).inSingletonScope(),e(da).toConstantValue(Mc)}));const op=Symbol.for("AutoEnablePlugins"),ap=Symbol.for("PluginService");var lp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cp=function(t,e){return function(i,n){e(i,n,t)}};let up=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&Bn.isBound(op)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};up=lp([g(),cp(0,p(E)),cp(0,v(op)),hp("design:paramtypes",[Object])],up);var dp=new i((t=>{t(ap).to(up),I(t,op)})),pp=new i((t=>{L(t,U)})),fp=new i((e=>{e(_n).to(t.DefaultTextMeasureContribution).inSingletonScope(),L(e,_n)})),gp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let mp=class{constructor(){this.type="static",this.offscreen=!1,this.global=pn.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Mn({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var n;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};mp=gp([g(),vp("design:paramtypes",[])],mp);var yp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},bp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let xp=class{constructor(){this.offscreen=!1,this.type="virtual",this.global=pn.global}setDpr(t){}init(t,e,i){if(this.layer=t,this.window=e,i.main)throw new Error("virtual layer不能作为main layer");this.main=!1,this.canvas=null,this.context=null}resize(t,e){}resizeView(t,e){}render(t,e,i){this.mainHandler.render(t,e,Object.assign(Object.assign({},i),{clear:!1}))}merge(t){}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return null}release(){}};xp=yp([g(),bp("design:paramtypes",[])],xp);var wp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ap=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Sp=class{constructor(){this.offscreen=!0,this.type="dynamic",this.global=pn.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const n=Mn({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context,viewBox:e.stage.window.getViewBox(),transMatrix:e.stage.window.getViewBoxTransform()},e),{clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"}))}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){const n=t.getContext(),r=t.dpr,{viewBox:s}=i,o=s.x1,a=s.y1,l=s.width(),h=s.height();n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(o,a,l,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,o,a,l,h),n.nativeContext.restore()}merge(t){}};Sp=wp([g(),Ap("design:paramtypes",[])],Sp);var Tp=new i((t=>{t(mp).toSelf(),t(Sp).toSelf(),t(xp).toSelf(),t(Ta).toService(mp),t(Ca).toService(Sp),t(_a).toService(xp)}));var Cp=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};function _p(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s={},o=[];let a=!1;if(r)a=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return a=!0,!0;return!1}),n)}if(a){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],o.push(i))}),n),o.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],l=s[e];r&&l.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<l.length;t++)if(i(l[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}function Bp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Cp(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function Pp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(void 0!==n)return o=!0,!0;return!1}),n);let a=null,l=!1;if(o){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),n),s.sort(((t,e)=>n?e-t:t-e));let o=!1;for(let t=0;t<s.length&&!o;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(l){o=!0,a=n[t];break}n[t]._uid!==e||(l=!0)}}}else t.forEachChildren((t=>l?(a=t,!0):(t._uid===e&&(l=!0),!1)),n);return a}var Rp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Mp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kp=function(t,e){return function(i,n){e(i,n,t)}};let Ep=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Ht,this.backupDirtyBounds=new Ht,this.global=pn.global,this.layerService=pn.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,viewBox:r,transMatrix:s}=e;if(!i)return;const o=this.dirtyBounds.setValue(0,0,r.width(),r.height());if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(a=o,l=n.dirtyBounds,h=!1,null===a?l:null===l?a:(le=a.x1,he=a.x2,ce=a.y1,ue=a.y2,de=l.x1,pe=l.x2,fe=l.y1,ge=l.y2,h&&(le>he&&([le,he]=[he,le]),ce>ue&&([ce,ue]=[ue,ce]),de>pe&&([de,pe]=[pe,de]),fe>ge&&([fe,ge]=[ge,fe])),le>=pe||he<=de||ce>=ge||ue<=fe?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(le,de),y1:Math.max(ce,fe),x2:Math.min(he,pe),y2:Math.min(ue,ge)}));o.x1=Math.floor(t.x1),o.y1=Math.floor(t.y1),o.x2=Math.ceil(t.x2),o.y2=Math.ceil(t.y2)}var a,l,h;const c=i.dpr%1;(c||.5!==c)&&(o.x1=Math.floor(o.x1*i.dpr)/i.dpr,o.y1=Math.floor(o.y1*i.dpr)/i.dpr,o.x2=Math.ceil(o.x2*i.dpr)/i.dpr,o.y2=Math.ceil(o.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(o),i.inuse=!0,i.setClearMatrix(s.a,s.b,s.c,s.d,s.e,s.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(r.x1,r.y1,!0),i.beginPath(),i.rect(o.x1,o.y1,o.width(),o.height()),i.clip(),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:qi.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,yc.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=Pp(e,i,qi.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,n){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!ye(t.AABBBounds,this.dirtyBounds,!1))return;let r,s=i;if(this.useDirtyBounds){r=Ku.allocateByObj(this.dirtyBounds);const e=t.transMatrix;s=yc.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(s.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))})):_p(t,qi.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(r),Ku.free(r),yc.free(s))}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||Bn.get(md);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1})),s.drawContribution=a;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=r.get(l._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(l._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:t.layer,context:i,startAtId:l._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;let r,s=!1;if(t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;if(s=!(!e&&!i),s){r=this.dirtyBounds.clone();const n=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(n),this.dirtyBounds.translate(-e,-i)}}if(this.useDirtyBounds&&!t.isContainer&&!ye(t.AABBBounds,this.dirtyBounds,!1))return void(s&&this.dirtyBounds.copy(r));const o=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=o),o?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),s&&this.dirtyBounds.copy(r),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return yt.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){const n=this.styleRenderMap.get(e.attribute.renderStyle);i=n&&n.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var n,r;const{clear:s,viewBox:o}=i,a=o.width(),l=o.height();if(s){e.clearRect(0,0,a,l);const i=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(i&&(e.globalAlpha=null!==(r=i.attribute.opacity)&&void 0!==r?r:1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(s);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,a,l)}else e.fillStyle=Wc(e,s,{AABBBounds:{x1:0,y1:0,x2:0+a,y2:0+l}},0,0),e.fillRect(0,0,a,l)}}afterDraw(t,e){}};Ep=Rp([g(),kp(0,f(Ad)),kp(1,p(E)),kp(1,v(Wd)),Mp("design:paramtypes",[Array,Object])],Ep);var Op=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Lp=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=ia}drawShape(t,e,i,n,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Tr(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:f=h.strokeOpacity,lineWidth:g=h.lineWidth,visible:v=h.visible}=t.attribute,m=Oa(d,p,c),y=Ia(d,f),b=ka(c),x=Ea(u,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(m||y||o||a))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o,a)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),Bu(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};Lp=Op([g()],Lp);var Ip=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Dp=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=Zo}drawShape(t,e,i,n,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(s>l.length)return;const h=Tr(t).area,{fill:c=h.fill,fillOpacity:u=h.fillOpacity,opacity:d=h.opacity,visible:p=h.visible}=t.attribute,f=Oa(d,u,c),g=ka(c);if(!t.valid||!p)return;if(!g)return;if(!f&&!o)return;for(let r=s;r<s+a;r++)this.drawIncreaseSegment(t,e,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),Pu(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};Dp=Ip([g()],Dp);var jp,Up=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Wp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Np=function(t,e){return function(i,n){e(i,n,t)}},Fp=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(jp||(jp={}));let zp=class extends Ep{constructor(t,e,i,n){super(t,n),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=n,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=jp.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new j([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return Fp(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,viewBox:r}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r.x1,r.y1,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:qi.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return Fp(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return Fp(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Fp(this,void 0,void 0,(function*(){if(2!==t.count)yield Bp(t,qi.zIndex,((i,n)=>{if(this.status===jp.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,yield this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return Fp(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return Fp(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return Fp(this,void 0,void 0,(function*(){this.rendering&&(this.status=jp.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=jp.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return Fp(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Fp(this,void 0,void 0,(function*(){yield Bp(t,qi.zIndex,(t=>Fp(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};zp=Up([g(),Np(0,f(Ad)),Np(1,p(Lp)),Np(2,p(Dp)),Np(3,p(E)),Np(3,v(Wd)),Wp("design:paramtypes",[Array,Object,Object,Object])],zp);var Gp=new i((e=>{e(Gc).toSelf().inSingletonScope(),e(Vc).toSelf().inSingletonScope(),e(Dd).to(Ep),e(md).to(zp),e(Sd).to(t.DefaultCanvasGroupRender).inSingletonScope(),e(Ad).toService(Sd),L(e,qa),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),L(e,nl),L(e,Ad),e(t.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(),e(Wd).toService(t.CommonDrawItemInterceptorContribution),L(e,Wd)}));function Hp(){Hp.__loaded||(Hp.__loaded=!0,Bn.load(Ma),Bn.load(sp),Bn.load(Zd),Bn.load(rp),Bn.load(dp),function(t){t.load(pp),t.load(fp),t.load(Tp)}(Bn),function(t){t.load(Gp)}(Bn))}Hp.__loaded=!1,Hp();const Vp=Bn.get(W);pn.global=Vp;const Yp=Bn.get(Aa);pn.graphicUtil=Yp;const Xp=Bn.get(wa);pn.transformUtil=Xp;const $p=Bn.get(ua);pn.graphicService=$p;const qp=Bn.get(Sa);pn.layerService=qp;class Kp{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,pn.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),pn.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){pn.graphicService.hooks.onAttributeUpdate.taps=pn.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onSetStage.taps=pn.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class Zp{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const o=r/100,a=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+o,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+a,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class Jp{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,pn.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),pn.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){pn.graphicService.hooks.onAddIncremental.taps=pn.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onClearIncremental.taps=pn.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,pn.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class Qp{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onRemove.unTap(this.key),pn.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let n;return n=e?"string"==typeof e?pn.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:pn.global.createDom(Object.assign({tagName:"div",parent:n},i)),nativeContainer:n}}parseDefaultStyleFromGraphic(t){return ul("text"===t.type&&t.attribute?t.attribute:Tr(t).text)}getTransformOfText(t){const e=Tr(t).text,{textAlign:i=e.textAlign,textBaseline:n=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:o,scaleY:a}=r,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${l[i]},${l[n]}) rotate(${s}deg) scaleX(${o}) scaleY(${a})`,transformOrigin:`${h[i]} ${h[n]}`}}updateStyleOfWrapContainer(t,e,i,n,r){const{pointerEvents:s}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none",i.style.position||(i.style.position="absolute",n.style.position="relative");let a=0,l=0;const h=t.globalAABBBounds;let c=r.anchorType;if(q(c)&&(c="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===c&&(c="top-left"),"position"===c||h.empty()){const e=t.globalTransMatrix;a=e.e,l=e.f}else{const t=((t,e)=>{const{x1:i,x2:n,y1:r,y2:s}=t,o=Math.abs(n-i),a=Math.abs(s-r);let l=(i+n)/2,h=(r+s)/2,c=0,u=0;switch(e){case"top":case"inside-top":u=-.5;break;case"bottom":case"inside-bottom":u=.5;break;case"left":case"inside-left":c=-.5;break;case"right":case"inside-right":c=.5;break;case"top-right":c=.5,u=-.5;break;case"top-left":c=-.5,u=-.5;break;case"bottom-right":c=.5,u=.5;break;case"bottom-left":c=-.5,u=.5}return l+=c*o,h+=u*a,{x:l,y:h}})(h,c);a=t.x,l=t.y}const u=pn.global.getElementTopLeft(n,!1),d=e.window.getTopLeft(!1),p=e.viewBox,f=a+d.left-u.left+p.x1,g=l+d.top-u.top+p.y1;if(o.left=`${f}px`,o.top=`${g}px`,"text"===t.type&&"position"===c&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),$(r.style)){const e=r.style({top:g,left:f,width:h.width(),height:h.height()},t,i);e&&(o=Object.assign(Object.assign({},o),e))}else Z(r.style)?o=Object.assign(Object.assign({},o),r.style):it(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const i=e.split(":");if(2===i.length){const e=i[0].trim(),n=i[1].trim();e&&n&&(t[e]=n)}}})),t}(r.style)));pn.global.updateDom(i,{width:r.width,height:r.width,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===pn.global.env&&(t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:qi.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&pn.global.removeDom(e),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const n=t.stage;if(!n)return;const{dom:r,container:s}=i;if(!r)return;const o=q(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[o]&&s&&s!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])"string"==typeof r?this.htmlMap[o].wrapContainer.innerHTML=r:r!==this.htmlMap[o].wrapContainer.firstChild&&(this.htmlMap[o].wrapContainer.removeChild(this.htmlMap[o].wrapContainer.firstChild),this.htmlMap[o].wrapContainer.appendChild(r));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(n,s);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:a,nativeContainer:l}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,n,a,l,i),this.htmlMap[o].renderId=this.renderId}release(){"browser"===pn.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}const tf=new Vt;class ef{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),pn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(tf.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(tf,t.parent&&t.parent.globalTransMatrix)))})),pn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(n.globalAABBBounds))})),pn.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){pn.graphicService.hooks.beforeUpdateAABBBounds.taps=pn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.afterUpdateAABBBounds.taps=pn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onRemove.taps=pn.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const nf=new Vt;class rf{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=e.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new Vt}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pause)return;const i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;const n=Tr(i).group,{display:r=n.display}=i.attribute;if("flex"!==r)return;const{flexDirection:s=n.flexDirection,flexWrap:o=n.flexWrap,alignItems:a=n.alignItems,clip:l=n.clip}=i.attribute,{alignContent:h=(null!=a?a:n.alignContent)}=i.attribute;let{width:c,height:u,justifyContent:d=n.justifyContent}=i.attribute;const p=i.getChildren();if(null==c||null==u){let t=0,e=0,i=0;if(p.forEach((n=>{const r=this.getAABBBounds(n);r.empty()||("column"===s||"column-reverse"===s?(e+=r.height(),t=Math.max(t,r.width())):(t+=r.width(),e=Math.max(e,r.height())),i+=r.x1,i+=r.y1,i+=r.x2,i+=r.y2)})),!isFinite(i))return;c=t,u=e}null==i.attribute.width?i.attribute.width=c:c=i.attribute.width,null==i.attribute.height?i.attribute.height=u:u=i.attribute.height,this.tempBounds.copy(i._AABBBounds);const f={main:{len:c,field:"x"},cross:{len:u,field:"y"}},g=f.main,v=f.cross;"column"!==s&&"column-reverse"!==s||(g.len=u,v.len=c,g.field="y",v.field="x"),"row-reverse"!==s&&"column-reverse"!==s||("flex-start"===d?d="flex-end":"flex-end"===d?d="flex-start":p.reverse());let m=0,y=0;const b=[];p.forEach((t=>{const e=this.getAABBBounds(t);if(e.empty())return;const i="x"===g.field?e.width():e.height(),n="x"===v.field?e.width():e.height();b.push({mainLen:i,crossLen:n}),m+=i,y=Math.max(y,n)}));const x=[];if(m>g.len&&"wrap"===o){let t=0,e=0;b.forEach(((i,n)=>{let{mainLen:r,crossLen:s}=i;t+r>g.len?0===t?(x.push({idx:n,mainLen:t+r,crossLen:s}),t=0,e=0):(x.push({idx:n-1,mainLen:t,crossLen:e}),t=r,e=s):(t+=r,e=Math.max(e,s))})),x.push({idx:b.length-1,mainLen:t,crossLen:e})}else x.push({idx:b.length-1,mainLen:m,crossLen:y});let w=0;if(x.forEach((t=>{this.layoutMain(i,p,d,g,b,w,t),w=t.idx+1})),y=x.reduce(((t,e)=>t+e.crossLen),0),1===x.length){const t={"flex-start":0,"flex-end":v.len,center:v.len/2};this.layoutCross(p,a,v,t,b,x[0],0)}else if("flex-start"===h){w=0;let t=0;x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"flex-start",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("center"===h){w=0;let t=Math.max(0,(v.len-y)/2);x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"center",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){w=0;const t=Math.max(0,(v.len-y)/x.length/2);let e=t;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){w=0;const t=Math.max(0,(v.len-y)/(2*x.length-2));let e=0;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}p.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();const A=this.getAABBBounds(i);l||this.tempBounds.equals(A)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;const e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(null!=e?e:0)-i}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else if("flex-end"===i){let t=n.len;for(let i=o.idx;i>=s;i--){t-=r[i].mainLen;const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`]))}}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/t/2;let a=i;for(let t=s;t<=o.idx;t++){const s=a+(e[t],n.field,0),o=this.getAABBBounds(e[t]);!o.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],o[`${n.field}1`])),a+=r[t].mainLen+2*i}}else if("space-between"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/(2*t-2);let a=0;for(let t=s;t<=o.idx;t++){const s=a+(e[t],n.field,0),o=this.getAABBBounds(e[t]);!o.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],o[`${n.field}1`])),a+=r[t].mainLen+2*i}}else if("center"===i){let t=(n.len-o.mainLen)/2;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}}layoutCross(t,e,i,n,r,s,o){var a;for(let l=o;l<=s.idx;l++){const s=t[l];let{alignSelf:o}=s.attribute;o&&"auto"!==o||(o=e);const h=this.getAABBBounds(s),c=null!==(a=n[o])&&void 0!==a?a:n["flex-start"];"flex-end"===o?!h.empty()&&(s.attribute[i.field]=this.updateChildPos(c-r[l].crossLen+(i.field,0),s.attribute[i.field],h[`${i.field}1`])):"center"===o?!h.empty()&&(s.attribute[i.field]=this.updateChildPos(c-r[l].crossLen/2+(i.field,0),s.attribute[i.field],h[`${i.field}1`])):!h.empty()&&(s.attribute[i.field]=this.updateChildPos(c+(i.field,0),s.attribute[i.field],h[`${i.field}1`]))}}activate(t){this.pluginService=t,pn.graphicService.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===this.pluginService.stage&&this.tryLayout(t,!1)})),pn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&nf.copy(n)})),pn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&(nf.equals(i)||this.tryLayout(t,!1))})),pn.graphicService.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t,!1)}))}deactivate(t){pn.graphicService.hooks.onAttributeUpdate.taps=pn.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.beforeUpdateAABBBounds.taps=pn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.afterUpdateAABBBounds.taps=pn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),pn.graphicService.hooks.onSetStage.taps=pn.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const sf=new Gr;sf.addTimeline(Yr),sf.setFPS(60);class of{constructor(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=e,this.color=i,this.colorRgb=Ys.Get(i,t.ColorType.Color1),this.ambient=n;const r=Lt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);this.formatedDir=[e[0]/r,e[1]/r,e[2]/r]}computeColor(e,i){const n=this.formatedDir,r=Et(kt((e[0]*n[0]+e[1]*n[1]+e[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=it(i)?Ys.Get(i,t.ColorType.Color1):i;const o=this.colorRgb;return`rgb(${o[0]*s[0]*r}, ${o[1]*s[1]*r}, ${o[2]*s[2]*r})`}}function af(t,e,i,n){let r,s,o,a,l,h,c,u,d,p;const f=e[0],g=e[1],v=e[2],m=n[0],y=n[1],b=n[2],x=i[0],w=i[1],A=i[2];return Math.abs(f-x)<St&&Math.abs(g-w)<St&&Math.abs(v-A)<St?mc.identity(t):(c=f-x,u=g-w,d=v-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=y*d-b*u,s=b*c-m*d,o=m*u-y*c,p=Math.hypot(r,s,o),p?(p=1/p,r*=p,s*=p,o*=p):(r=0,s=0,o=0),a=u*o-d*s,l=d*r-c*o,h=c*s-u*r,p=Math.hypot(a,l,h),p?(p=1/p,a*=p,l*=p,h*=p):(a=0,l=0,h=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=l,t[6]=u,t[7]=0,t[8]=o,t[9]=h,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+o*v),t[13]=-(a*f+l*g+h*v),t[14]=-(c*f+u*g+d*v),t[15]=1,t)}function lf(t,e,i,n,r,s,o){const a=1/(e-i),l=1/(n-r),h=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(o+s)*h,t[15]=1,t}function hf(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*l+w*d+A*v,t[2]=b*s+x*h+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*l+w*d+A*v,t[6]=b*s+x*h+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*l+w*d+A*v,t[10]=b*s+x*h+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*l+w*d+A*v,t[14]=b*s+x*h+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function cf(t,e,i){const n=e[0],r=e[1],s=e[2];let o=i[3]*n+i[7]*r+i[11]*s+i[15];return o=o||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/o,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/o,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/o,t}class uf{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=bc.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=bc.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return af(this._viewMatrixCached,t,e,i),this._vp||(this._vp=bc.allocate()),this._vp=hf(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=bc.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=bc.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return lf(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=bc.allocate()),this._vp=hf(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return cf(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;cf(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}let df;function pf(){if(null==df)try{const t=document.createElement("canvas"),e=t.getContext("2d");df=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),df&&(df=!!document.createElement)}catch(t){df=!1}}function ff(){pf();const t=pn.global&&pn.global.env;return t?"browser"===t:df}function gf(){pf();const t=pn.global&&pn.global.env;return t?"node"===t:!df}class vf extends Qp{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i,unmount:n}=this.htmlMap[t];e?pn.global.getRequestAnimationFrame()((()=>{e.unmount()})):n&&n(),i&&pn.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const n=t.stage;if(!n)return;const r=n.params.ReactDOM,{element:s,container:o}=i;if(!s||!r||!r.createRoot&&!r.render)return;const a=q(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&o&&o!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])r.createRoot?this.htmlMap[a].root.render(s):r.render(s,this.htmlMap[a].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(n,o);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const i=r.createRoot(t);i.render(s),this.htmlMap[a]={root:i,wrapContainer:t,nativeContainer:e,container:o,renderId:this.renderId}}else r.render(s,t),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:o,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,n,l,h,i),this.htmlMap[a].renderId=this.renderId}}const mf="white";class yf extends ya{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:mf}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new Ar,this.hooks={beforeRender:new j(["stage"]),afterRender:new j(["stage"])},this.global=pn.global,!this.global.env&&ff()&&this.global.setEnv("browser"),this.window=Bn.get(cr),this.renderService=Bn.get(qd),this.pluginService=Bn.get(ap),this.layerService=Bn.get(Sa),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:mf,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||sf,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Vr,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&it(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(){this._skipRender=-1}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new Ur(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:o=1,fieldDepth:a}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:o,fieldDepth:a})}set3dOptions(t){var e,i,n,r,s,o;this.option3d=t;const a=this.get3dOptions(t),{light:l,center:h,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=a,{dir:g=[1,1,-1],color:v="white",ambient:m}=l,y=(null!==(e=h.x)&&void 0!==e?e:this.width/2)+(null!==(i=h.dx)&&void 0!==i?i:0),b=(null!==(n=h.y)&&void 0!==n?n:this.height/2)+(null!==(r=h.dy)&&void 0!==r?r:0),x=[y,b,(null!==(s=h.z)&&void 0!==s?s:0)+(null!==(o=h.dz)&&void 0!==o?o:0)];let w=0,A=0,S=0;c||(w=Math.sin(u)+y,A=Math.sin(d)+b,S=Math.cos(u)*Math.cos(d)*1),this.light=new of(g,v,m);const T={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[w,A,S],center:x,up:[0,1,0]}};this.camera?this.camera.params=T:this.camera=new uf(T),t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new Zp))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new Kp))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Jp))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Ht;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new ef,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new rf))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new Qp))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){this.reactAttribute||(this.reactAttribute=t,this.pluginService.register(new vf))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e<t.length;e++){let n=t[e];"virtual"===n.layerMode&&(n=n.getNativeHandler().mainHandler.layer),i.includes(n)||i.push(n)}i.forEach((t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e))}resizeWindow(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),i&&this.render()}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;this.pickerService||(this.pickerService=Bn.get(Qd));const i=this.pickerService.pick(this.children,new Ft(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(){let t=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const e=Bn.get(cr),i=t?-t.x1:0,n=t?-t.y1:0,r=t?t.x2:this.viewWidth,s=t?t.y2:this.viewHeight,o=t?t.width():this.viewWidth,a=t?t.height():this.viewHeight;return e.create({viewBox:{x1:i,y1:n,x2:r,y2:s},width:o,height:a,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}toCanvas(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}}var bf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const wf=new $t(1,0,0,1,0,0),Af={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new $t(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new $t(1,0,0,1,0,0),this.path=new Di,this._clearMatrix=new $t(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return yc.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(yc.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(yc.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,o,a){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},Af),function(t,e,i){return sr(t,0,!1,e,i)}(this.path.commandList,Af.x,Af.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},Af);const i=Uc(this,this.lineWidth,this.dpr);return function(t,e,i,n){return sr(t,e,!0,i,n)}(this.path.commandList,i,Af.x,Af.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(wf,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>yc.free(t))),this.stack.length=0}},t.EmptyContext2d=bf([g(),xf("design:paramtypes",[Object,Number])],t.EmptyContext2d);var Sf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Tf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Cf={WIDTH:500,HEIGHT:500,DPR:1};t.BaseCanvas=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:n=Cf.WIDTH,height:r=Cf.HEIGHT,dpr:s=Cf.DPR,x:o,y:a,id:l,canvasControled:h=!0}=t;this._x=null!=o?o:0,this._y=null!=a?a:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:l,l&&(i.id=l),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BaseCanvas.env="browser",t.BaseCanvas=Sf([g(),Tf("design:paramtypes",[Object])],t.BaseCanvas);var _f=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};t.BaseEnvContribution=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Vt}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}},t.BaseEnvContribution=_f([g()],t.BaseEnvContribution);var Bf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Pf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.BaseWindowHandlerContribution=class{constructor(){this._uid=e.GenAutoIncrementId(),this.viewBox=new Vt,this.modelMatrix=new $t(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,n,r,s){this.modelMatrix.setValue(t,e,i,n,r,s)}getViewBoxTransform(){return this.modelMatrix}},t.BaseWindowHandlerContribution=Bf([g(),Pf("design:paramtypes",[])],t.BaseWindowHandlerContribution);var Rf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Mf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kf=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultPickService=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=pn.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;const r=i.bounds.width(),s=i.bounds.height();if(!(new Vt).setValue(0,0,r,s).containsPoint(e))return n;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new $t(1,0,0,1,0,0);let a;for(let r=t.length-1;r>=0&&(n=t[r].isContainer?this.pickGroup(t[r],e,o,i):this.pickItem(t[r],e,o,i),!n.graphic);r--)a||(a=n.group);if(n.graphic||(n.group=a),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){var n;return!!(null===(n=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===n?void 0:n.graphic)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=bc.allocate();if(_c(i,e),o){if(i){const t=bc.allocate();s.modelMatrix=Bc(t,o,i),bc.free(i)}}else _c(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const a=this.InterceptorContributions[r];if(a.beforePickItem){const r=a.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==o&&bc.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,l=yc.allocateByObj(i),h=new Ft(e.x,e.y);l.transformPoint(h,h);const c=t.AABBBounds.containsPoint(h);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,h.clone(),i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params);const d=!1!==t.attribute.pickable&&c;return l.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u&&u.graphic||_p(t,qi.zIndex,(s=>{if(s.isContainer){const i=new Ft(e.x,e.y),o=Tr(t).group,{scrollX:a=o.scrollX,scrollY:h=o.scrollY}=t.attribute;i.x-=a,i.y-=h,r=this.pickGroup(s,i,l,n)}else{const o=new Ft(e.x,e.y);l.transformPoint(o,o);const a=Tr(t).group,{scrollX:h=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=h,o.y-=c;const u=this.pickItem(s,o,i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params)}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&bc.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),yc.free(l),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}},t.DefaultPickService=Rf([g(),kf(0,p(E)),kf(0,v(np)),Mf("design:paramtypes",[Object])],t.DefaultPickService);var Ef=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Of=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function Lf(t,e,i,n,r){let s=n,o=e;const a=t[e].x,l=t[e].y,h=t[i].x-a,c=t[i].y-l,u=h*h+c*c;let d,p,f,g,v;for(let n=e+1,r=i-1;n<r;n++)g=t[n].x-a,v=t[n].y-l,d=g*c-h*v,p=d*d,f=p/u,f>s&&(s=f,o=n);s>n&&(o-e>2&&Lf(t,e,o,n,r),r.push(t[o],t[o+1]),i-o>2&&Lf(t,o,i,n,r))}function If(t,e){const i=t.length-1,n=[t[0]];return Lf(t,0,i,e,n),n.push(t[i]),n}function Df(t,e){let i=0;for(i=0;i<t.length;i++){const n=t[i];if(n.text&&"\n"===n.text||e--,e<0)break}return i}t.DefaultGlobalPickerService=class{constructor(){this.global=pn.global,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new $t(1,0,0,1,0,0);let s;for(let o=0;o<t.length;o++){if(t[o].isContainer)n=this.pickGroup(t[o],e,r,i);else{const s=this.pickItem(t[o],e,r,i);s&&(n.graphic=s.graphic,n.params=s.params)}if(n.graphic)break;s||(s=n.group)}if(n.graphic||(n.group=s),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,o=new Ft(e.x,e.y);i.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const l=!1!==t.attribute.pickable&&a;return i.multiply(s.a,s.b,s.c,s.d,s.e,s.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)r=this.pickGroup(t,e,i,n);else{const s=new Ft(e.x,e.y);i.transformPoint(s,s);const o=this.pickItem(t,s,i,n);o&&(r.graphic=o.graphic,r.params=o.params)}return!!r.graphic||!!r.group})),r.graphic||r.group||!l||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=Ef([g(),Of("design:paramtypes",[])],t.DefaultGlobalPickerService);class jf{constructor(t){this.handleKeyDown=t=>{"Delete"!==t.key&&"Backspace"!==t.key||this.handleInput({data:null,type:"Backspace"})},this.handleCompositionStart=()=>{const{textConfig:t=[]}=this.currRt.attribute,e=Df(t,this.cursorIndex),i=t[e];t.splice(e+1,0,Object.assign(Object.assign({},i),{text:""})),this.isComposing=!0},this.handleCompositionEnd=()=>{this.isComposing=!1;const{textConfig:t=[]}=this.currRt.attribute,e=Df(t,this.cursorIndex+1),i=t[e];t.splice(e,1);const n=i.text,r=Array.from(n.toString());for(let n=0;n<r.length;n++)t.splice(n+e,0,Object.assign(Object.assign({},i),{text:r[n]}));this.currRt.setAttributes({textConfig:t}),this.onChangeCbList.forEach((t=>{t(n,this.isComposing,this.cursorIndex+r.length,this.currRt,"right")}))},this.handleInput=t=>{if(!this.currRt)return;let e=t.data;"Backspace"===t.type||e||(e="\n");const{textConfig:i=[]}=this.currRt.attribute;let n=this.selectionStartCursorIdx,r=this.cursorIndex;n>r&&([n,r]=[r,n]),this.selectionStartCursorIdx=n,this.cursorIndex=n,n=Df(i,n);const s=this.selectionStartCursorIdx-n;r=Df(i,r);const o=i[n+(this.isComposing?1:0)];let a=o;"Backspace"!==t.type||this.isComposing?(n!==r&&i.splice(n+1,r-n),this.isComposing||(a=Object.assign(Object.assign({},o),{text:""}),n+=1,i.splice(n,0,a)),a.text=e):n!==r?i.splice(n+1,r-n):(i.splice(n,1),n-=1),this.currRt.setAttributes({textConfig:i}),this.isComposing?this.onInputCbList.forEach((t=>{t(e,this.isComposing,n+s,this.currRt,"\n"===e?"left":"right")})):this.onChangeCbList.forEach((t=>{t(e,this.isComposing,n+s,this.currRt,"\n"===e?"left":"right")}))},this.container=null!=t?t:document.body;const e=document.createElement("textarea");e.autocomplete="off",e.innerText="",this.applyStyle(e),this.container.append(e),this.textAreaDom=e,this.isComposing=!1,this.onInputCbList=[],this.onChangeCbList=[]}onInput(t){this.onInputCbList.push(t)}onChange(t){this.onChangeCbList.push(t)}applyStyle(t){t.setAttribute("style","width: 100px; height: 30px; left: 0; position: absolute; z-index: -1; outline: none; resize: none; border: none; overflow: hidden; color: transparent; user-select: none; caret-color: transparent;background-color: transparent;"),t.addEventListener("input",this.handleInput),t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd),window.addEventListener("keydown",this.handleKeyDown)}moveTo(t,e,i,n,r){this.textAreaDom.style.left=`${t}px`,this.textAreaDom.style.top=`${e}px`,setTimeout((()=>{this.textAreaDom.focus(),this.textAreaDom.setSelectionRange(0,0)})),this.currRt=i,this.cursorIndex=n,this.selectionStartCursorIdx=r}release(){this.textAreaDom.removeEventListener("input",this.handleInput),this.textAreaDom.removeEventListener("compositionstart",this.handleCompositionStart),this.textAreaDom.removeEventListener("compositionend",this.handleCompositionEnd),window.removeEventListener("keydown",this.handleKeyDown)}}class Uf{constructor(t,e,i,n,r){this.curCursorIdx=n,this.selectionStartCursorIdx=i,this.cacheCurCursorIdx=e,this.cacheSelectionStartCursorIdx=t,this.rt=r}hasFormat(t){return null!=this.getFormat(t)}getFormat(t){if(!this.rt)return null;const e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t];if(null==i)return null;for(let n=this.selectionStartCursorIdx+2;n<=this.curCursorIdx;n++)if(i!==e[n][t])return null;return i}getAllFormat(t){if(!this.rt)return[];const e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t],n=new Set;n.add(i);for(let i=this.selectionStartCursorIdx+2;i<=this.curCursorIdx;i++){const r=e[i];n.add(r[t])}return Array.from(n.values())}}const Wf="FORMAT_TEXT_COMMAND";class Nf{constructor(){this.pools=[]}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class Ff extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.rect(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.rect(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const zf=new Ff;class Gf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.arc(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.arc(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Hf=new Gf;class Vf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.area(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.area(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Yf=new Vf;class Xf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.circle(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.circle(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const $f=new Xf;class qf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.line(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.line(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Kf=new qf;class Zf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.path(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.path(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Jf=new Zf;class Qf extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.symbol(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.symbol(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const tg=new Qf;class eg extends Nf{allocate(t){if(!this.pools.length)return pn.graphicService.creator.text(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return pn.graphicService.creator.text(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const ig=new eg;class ng{constructor(){this.map={text:ig,symbol:tg}}gc(t){t.isContainer?t.forEachChildren((t=>this.gc(t))):this.gcItem(t)}gcItem(t){const e=this.map[t.type];e&&e.free(t)}}const rg=new ng;let sg=!1;const og=new i((e=>{sg||(sg=!0,e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(yd).to(t.DefaultCanvasArcRender).inSingletonScope(),e(Ad).toService(yd),e(Ya).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Ya))}));let ag=!1;const lg=new i((e=>{ag||(ag=!0,e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(Bd).to(t.DefaultCanvasRectRender).inSingletonScope(),e(Ad).toService(Bd),e(t.SplitRectAfterRenderContribution).toSelf(),e(t.SplitRectBeforeRenderContribution).toSelf(),e(Qa).toService(t.SplitRectAfterRenderContribution),e(Qa).toService(t.SplitRectBeforeRenderContribution),e(Qa).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Qa))}));let hg=!1;const cg=new i((e=>{hg||(hg=!0,e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Lp).toSelf().inSingletonScope(),e(Td).to(t.DefaultCanvasLineRender).inSingletonScope(),e(Ad).toService(Td))}));let ug=!1;const dg=new i((e=>{ug||(ug=!0,e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(xd).to(t.DefaultCanvasAreaRender).inSingletonScope(),e(Ad).toService(xd),e(Xa).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Xa),e(Dp).toSelf().inSingletonScope())}));let pg=!1;const fg=new i((e=>{pg||(pg=!0,e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(Rd).to(t.DefaultCanvasSymbolRender).inSingletonScope(),e(Ad).toService(Rd),e(tl).toService(t.DefaultBaseInteractiveRenderContribution),L(e,tl))}));let gg=!1;const vg=new i((e=>{gg||(gg=!0,e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(wd).to(t.DefaultCanvasCircleRender).inSingletonScope(),e(Ad).toService(wd),e($a).toService(t.DefaultBaseInteractiveRenderContribution),L(e,$a))}));let mg=!1;const yg=new i((e=>{mg||(mg=!0,e(Md).to(t.DefaultCanvasTextRender).inSingletonScope(),e(Ad).toService(Md),e(el).toService(t.DefaultBaseInteractiveRenderContribution),L(e,el))}));let bg=!1;const xg=new i((e=>{bg||(bg=!0,e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(Cd).to(t.DefaultCanvasPathRender).inSingletonScope(),e(Ad).toService(Cd),e(Za).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Za))}));let wg=!1;const Ag=new i((e=>{wg||(wg=!0,e(_d).to(t.DefaultCanvasPolygonRender).inSingletonScope(),e(Ad).toService(_d),e(Ja).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Ja))}));var Sg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Tg=class{constructor(){this.numberType=Qo}drawShape(t,e,i,n,r,s,o,a){r.drawContribution&&t.getSubGraphic().forEach((t=>{const l=r.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,i,n,r,s,o,a)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=Tr(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};Tg=Sg([g()],Tg);let Cg=!1;const _g=new i((t=>{Cg||(Cg=!0,t(Od).to(Tg).inSingletonScope(),t(Ad).toService(Od))}));var Bg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Pg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Rg=class extends Ic{constructor(){super(),this.numberType=la,this.builtinContributions=[Zu],this.init()}drawShape(t,e,i,n,r){const s=Tr(t).richtext,{strokeOpacity:o=s.strokeOpacity,opacity:a=s.opacity,fillOpacity:l=s.fillOpacity,visible:h=s.visible}=t.attribute;if(!t.valid||!h)return;const c=Oa(a,l,!0),u=Oa(a,o,!0);c&&(e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,u,c,u,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,u,c,u,s,r))}drawIcon(t,e,i,n,r){var s;const o=Tr(t).richtextIcon,{width:a=o.width,height:l=o.height,opacity:h=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:p=o.backgroundStroke,backgroundStrokeOpacity:f=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:m=a,backgroundHeight:y=l}=t.attribute;if(v&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(m-a)/2,r=(y-l)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,m,y)):(e.beginPath(),ru(e,i-t,n-r,m,y,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=f,e.strokeStyle=p,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=h,e.drawImage(b.data,i,n,a,l))}draw(t,e,i){const n=Tr(t).richtext;this._draw(t,n,!1,i)}};Rg=Bg([g(),Pg("design:paramtypes",[])],Rg);let Mg=!1;const kg=new i((t=>{Mg||(Mg=!0,t(kd).to(Rg).inSingletonScope(),t(Ad).toService(kd))}));let Eg=!1;const Og=new i((e=>{Eg||(Eg=!0,e(Ld).to(t.DefaultCanvasImageRender).inSingletonScope(),e(Ad).toService(Ld),e(Ka).toService(t.DefaultBaseInteractiveRenderContribution),L(e,Ka))}));var Lg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Ig=class extends Ic{constructor(){super(...arguments),this.type="rect3d",this.numberType=aa}drawShape(t,e,i,n,r,s,o,a){var l;const h=Tr(t,null==s?void 0:s.theme).rect,{fill:c=h.fill,stroke:u=h.stroke,x1:d,y1:p,x:f,y:g,opacity:v=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:b=h.strokeOpacity,visible:x=h.visible}=t.attribute;let{width:w,height:A}=t.attribute;w=(null!=w?w:d-f)||0,A=(null!=A?A:p-g)||0;const S=null!==(l=this.z)&&void 0!==l?l:0,T=La(v,m,w,A,c),C=Da(v,b,w,A),_=ka(c),B=Ea(u,y);if(!t.valid||!x)return;if(!_&&!B)return;if(!(T||C||o||a))return;const{light:P,camera:R}=r.stage||{},M=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,S,M,r,e,P,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,S,M,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a={x:t+o[0],y:e+o[1],z:i+o[2]},l=s[n[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(e,i,n,r,s,o,a,l){const h=Ys.Get(s,t.ColorType.Color255),c=r.vertices,u=c.map((t=>o.view(t[0],t[1],t[2])[2])),d=[];r.polygons.forEach(((t,e)=>{d.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=u[i[0]],s=u[i[1]],o=u[i[2]],a=u[i[3]];t.ave_z=r+s+o+a})),d.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),d.forEach((t=>{const{polygon:r,normal:u}=t.polygon,d=c[r[0]],p=c[r[1]],f=c[r[2]],g=c[r[3]],v={x:e+d[0],y:i+d[1],z:n+d[2]},m={x:e+p[0],y:i+p[1],z:n+p[2]},y={x:e+f[0],y:i+f[1],z:n+f[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]};o.beginPath(),o.moveTo(v.x,v.y,v.z),o.lineTo(m.x,m.y,m.z),o.lineTo(y.x,y.y,y.z),o.lineTo(b.x,b.y,b.z),o.closePath(),l?l(o,null,null):(o.fillStyle=a?a.computeColor(u,h):s,o.fill())}))}draw(t,e,i){const n=Tr(t).rect;this._draw(t,n,!1,i)}};Ig=Lg([g()],Ig);let Dg=!1;const jg=new i((t=>{Dg||(Dg=!0,t(Pd).to(Ig).inSingletonScope(),t(Ad).toService(Pd))}));var Ug=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Wg=class extends Ic{constructor(){super(...arguments),this.numberType=Ko}drawShape(e,i,n,r,s,o,a,l){var h;const c=Tr(e,null==o?void 0:o.theme).arc,{fill:u=c.fill}=e.attribute,d=this.valid(e,c,a,l);if(!d)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:v}=d,m=null!==(h=this.z)&&void 0!==h?h:0,{outerPadding:y=c.outerPadding,innerPadding:b=c.innerPadding,height:x=10}=e.attribute;let{outerRadius:w=c.outerRadius,innerRadius:A=c.innerRadius}=e.attribute;w+=y,A-=b;const S=Ys.Get(u,t.ColorType.Color255),{light:T}=s.stage||{},C=s.hack_pieFace,_={top:m,bottom:m+x},B={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===C||"top"===C?(i.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=Pt(l-a),c=l>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=St)e.moveTo(i,n,r);else if(h>=Bt-St)e.moveTo(i+s*Mt(a),n+s*Ot(a),r),e.arc(i,n,s,a,l,!c,r),o>St&&(e.moveTo(i+o*Mt(l),n+o*Ot(l),r),e.arc(i,n,o,l,a,c,r));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(a,l),m=s*Mt(p),y=s*Ot(p),b=o*Mt(g),x=o*Ot(g);h<.001?u=!0:(e.moveTo(i+m,n+y,r),e.arc(i,n,s,p,f,!c,r)),!(o>St)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,v,c,r))}e.closePath()}(e,i,n,r,_[C],w,A),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,c),g&&(a?a(i,e.attribute,c):p&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=T?T.computeColor(B[C],S):u,i.fill())),v&&(l?l(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke()))):"outside"!==C&&"inside"!==C||("inside"===C&&(i.save(),i.beginPath(),i.arc(n,r,A,0,Bt,!0,_.top),i.clip()),i.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=Pt(h-l),u=h>l;let d=!1;if(o<=St)e.moveTo(i,n,r);else if(c>=Bt-St)e.moveTo(i+o*Mt(l),n+o*Ot(l),r),e.arc(i,n,o,l,h,!u,r),e.lineTo(i+o*Mt(h),n+o*Ot(h),s),e.arc(i,n,o,h,l,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(l,h),f=o*Mt(c),g=o*Ot(c),v=o*Mt(p),m=o*Ot(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!u,r),e.lineTo(i+v,n+m,s),e.arc(i,n,o,p,c,u,s))}e.closePath()}(e,i,n,r,_.top,_.bottom,"outside"===C?w:A,((t,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:l}=e.getParsePadAngle(t,i);return"outside"===C?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:l}})),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,c),g&&(a?a(i,e.attribute,c):p&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=T?T.computeColor(B[C],S):u,i.fill())),v&&(l?l(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())),"inside"===C&&i.restore())}draw(t,e,i,n){const r=Tr(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}};Wg=Ug([g()],Wg);let Ng=!1;const Fg=new i((t=>{Ng||(Ng=!0,t(bd).to(Wg).inSingletonScope(),t(Ad).toService(bd))}));var zg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Gg=class extends Ic{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=sa}drawShape(t,e,i,n,r,s,o,a){var l;const h=Tr(t,null==s?void 0:s.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,o,a))return;const{light:f,camera:g}=r.stage||{},v=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,p,v,d,r,e,f,g,t,h,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,p,v,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a=s[n[1]],l={x:t+o[0],y:e+o[1],z:i+o[2]},h={x:t+a[0],y:e+a[1],z:i+a[2]};r.beginPath(),r.moveTo(l.x,l.y,l.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(e,i,n,r,s,o,a,l,h,c,u,d){const p=Ys.Get(o,t.ColorType.Color255),f=r.vertices,g=f.map((t=>a.view(t[0],t[1],t[2])[2])),v=[];r.polygons.forEach(((t,e)=>{if(!s[e])return;v.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=g[i[0]],o=g[i[1]],a=g[i[2]],l=g[i[3]];t.ave_z=r+o+a+l})),v.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),v.forEach((t=>{const{polygon:r,normal:s}=t.polygon,h=f[r[0]],g=f[r[1]],v=f[r[2]],m=f[r[3]],y={x:e+h[0],y:i+h[1],z:n+h[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]},x={x:e+v[0],y:i+v[1],z:n+v[2]},w={x:e+m[0],y:i+m[1],z:n+m[2]};a.beginPath(),a.moveTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.lineTo(w.x,w.y,w.z),a.closePath(),d?d(a,c.attribute,u):(a.fillStyle=l?l.computeColor(s,p):o,a.fill())}))}draw(t,e,i){const n=Tr(t).polygon;this._draw(t,n,!1,i)}};Gg=zg([g()],Gg);let Hg=!1;const Vg=new i((t=>{Hg||(Hg=!0,t(Ed).to(Gg).inSingletonScope(),t(Ad).toService(Ed))}));function Yg(){Mc.RegisterGraphicCreator("arc",ec)}function Xg(){Mc.RegisterGraphicCreator("arc3d",nc)}function $g(){Mc.RegisterGraphicCreator("area",Jh)}function qg(){Mc.RegisterGraphicCreator("circle",ol)}function Kg(){Mc.RegisterGraphicCreator("glyph",Ih)}function Zg(){Mc.RegisterGraphicCreator("group",ba)}function Jg(){Mc.RegisterGraphicCreator("image",Nh)}function Qg(){Mc.RegisterGraphicCreator("line",Bh)}function tv(){Mc.RegisterGraphicCreator("path",qh)}function ev(){Mc.RegisterGraphicCreator("polygon",oc)}function iv(){Mc.RegisterGraphicCreator("pyramid3d",lc)}function nv(){Mc.RegisterGraphicCreator("rect",Mh)}function rv(){Mc.RegisterGraphicCreator("rect3d",Oh)}function sv(){Mc.RegisterGraphicCreator("richtext",Yh)}function ov(){Mc.RegisterGraphicCreator("symbol",Th)}function av(){Mc.RegisterGraphicCreator("text",gl)}function lv(){Mc.RegisterGraphicCreator("shadowRoot",cc)}function hv(){Mc.RegisterGraphicCreator("wrapText",yl)}function cv(t,e,i){if(t&&t.length){const[n,r]=e,s=Math.PI/180*i,o=Math.cos(s),a=Math.sin(s);t.forEach((t=>{const[e,i]=t;t[0]=(e-n)*o-(i-r)*a+n,t[1]=(e-n)*a+(i-r)*o+r}))}}function uv(t){const e=t[0],i=t[1];return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}function dv(t,e){const i=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);const r=[0,0];if(i)for(const e of t)cv(e,r,i);const s=function(t,e){const i=[];for(const e of t){const t=[...e];t[0].join(",")!==t[t.length-1].join(",")&&t.push([t[0][0],t[0][1]]),t.length>2&&i.push(t)}const n=[];e=Math.max(e,.1);const r=[];for(const t of i)for(let e=0;e<t.length-1;e++){const i=t[e],n=t[e+1];if(i[1]!==n[1]){const t=Math.min(i[1],n[1]);r.push({ymin:t,ymax:Math.max(i[1],n[1]),x:t===i[1]?i[0]:n[0],islope:(n[0]-i[0])/(n[1]-i[1])})}}if(r.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!r.length)return n;let s=[],o=r[0].ymin;for(;s.length||r.length;){if(r.length){let t=-1;for(let e=0;e<r.length&&!(r[e].ymin>o);e++)t=e;r.splice(0,t+1).forEach((t=>{s.push({s:o,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=o))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),s.length>1)for(let t=0;t<s.length;t+=2){const e=t+1;if(e>=s.length)break;const i=s[t].edge,r=s[e].edge;n.push([[Math.round(i.x),o],[Math.round(r.x),o]])}o+=e,s.forEach((t=>{t.edge.x=t.edge.x+e*t.edge.islope}))}return n}(t,n);if(i){for(const e of t)cv(e,r,-i);!function(t,e,i){const n=[];t.forEach((t=>n.push(...t))),cv(n,e,i)}(s,r,-i)}return s}class pv{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const i=dv(t,e);return{type:"fillSketch",ops:this.renderLines(i,e)}}renderLines(t,e){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return i}}class fv extends pv{fillPolygons(t,e){let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);const n=dv(t,Object.assign({},e,{hachureGap:i})),r=Math.PI/180*e.hachureAngle,s=[],o=.5*i*Math.cos(r),a=.5*i*Math.sin(r);for(const[t,e]of n)uv([t,e])&&s.push([[t[0]-o,t[1]+a],[...e]],[[t[0]+o,t[1]-a],[...e]]);return{type:"fillSketch",ops:this.renderLines(s,e)}}}class gv extends pv{fillPolygons(t,e){const i=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),r=this._fillPolygons(t,n);return i.ops=i.ops.concat(r.ops),i}}class vv{constructor(t){this.helper=t}fillPolygons(t,e){const i=dv(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(i,e)}dotsOnLines(t,e){const i=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let r=e.fillWeight;r<0&&(r=e.strokeWidth/2);const s=n/4;for(const o of t){const t=uv(o),a=t/n,l=Math.ceil(a)-1,h=t-l*n,c=(o[0][0]+o[1][0])/2-n/4,u=Math.min(o[0][1],o[1][1]);for(let t=0;t<l;t++){const o=u+h+t*n,a=c-s+2*Math.random()*s,l=o-s+2*Math.random()*s,d=this.helper.ellipse(a,l,r,r,e);i.push(...d.ops)}}return{type:"fillSketch",ops:i}}}class mv{constructor(t){this.helper=t}fillPolygons(t,e){const i=dv(t,e);return{type:"fillSketch",ops:this.dashedLine(i,e)}}dashedLine(t,e){const i=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,r=[];return t.forEach((t=>{const s=uv(t),o=Math.floor(s/(i+n)),a=(s+n-o*(i+n))/2;let l=t[0],h=t[1];l[0]>h[0]&&(l=t[1],h=t[0]);const c=Math.atan((h[1]-l[1])/(h[0]-l[0]));for(let t=0;t<o;t++){const s=t*(i+n),o=s+i,h=[l[0]+s*Math.cos(c)+a*Math.cos(c),l[1]+s*Math.sin(c)+a*Math.sin(c)],u=[l[0]+o*Math.cos(c)+a*Math.cos(c),l[1]+o*Math.sin(c)+a*Math.sin(c)];r.push(...this.helper.doubleLineOps(h[0],h[1],u[0],u[1],e))}})),r}}class yv{constructor(t){this.helper=t}fillPolygons(t,e){const i=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,n=e.zigzagOffset<0?i:e.zigzagOffset,r=dv(t,e=Object.assign({},e,{hachureGap:i+n}));return{type:"fillSketch",ops:this.zigzagLines(r,n,e)}}zigzagLines(t,e,i){const n=[];return t.forEach((t=>{const r=uv(t),s=Math.round(r/(2*e));let o=t[0],a=t[1];o[0]>a[0]&&(o=t[1],a=t[0]);const l=Math.atan((a[1]-o[1])/(a[0]-o[0]));for(let t=0;t<s;t++){const r=2*t*e,s=2*(t+1)*e,a=Math.sqrt(2*Math.pow(e,2)),h=[o[0]+r*Math.cos(l),o[1]+r*Math.sin(l)],c=[o[0]+s*Math.cos(l),o[1]+s*Math.sin(l)],u=[h[0]+a*Math.cos(l+Math.PI/4),h[1]+a*Math.sin(l+Math.PI/4)];n.push(...this.helper.doubleLineOps(h[0],h[1],u[0],u[1],i),...this.helper.doubleLineOps(u[0],u[1],c[0],c[1],i))}})),n}}const bv={};class xv{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const wv={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Av(t,e){return t.type===e}function Sv(t){const e=[],i=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let n="BOD",r=0,s=i[r];for(;!Av(s,2);){let o=0;const a=[];if("BOD"===n){if("M"!==s.text&&"m"!==s.text)return Sv("M0,0"+t);r++,o=wv[s.text],n=s.text}else Av(s,1)?o=wv[n]:(r++,o=wv[s.text],n=s.text);if(!(r+o<i.length))throw new Error("Path data ended short");for(let t=r;t<r+o;t++){const e=i[t];if(!Av(e,1))throw new Error("Param not a number: "+n+","+e.text);a[a.length]=+e.text}if("number"!=typeof wv[n])throw new Error("Bad segment: "+n);{const t={key:n,data:a};e.push(t),r+=o,s=i[r],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function Tv(t){let e=0,i=0,n=0,r=0;const s=[];for(const{key:o,data:a}of t)switch(o){case"M":s.push({key:"M",data:[...a]}),[e,i]=a,[n,r]=a;break;case"m":e+=a[0],i+=a[1],s.push({key:"M",data:[e,i]}),n=e,r=i;break;case"L":s.push({key:"L",data:[...a]}),[e,i]=a;break;case"l":e+=a[0],i+=a[1],s.push({key:"L",data:[e,i]});break;case"C":s.push({key:"C",data:[...a]}),e=a[4],i=a[5];break;case"c":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"C",data:t}),e=t[4],i=t[5];break}case"Q":s.push({key:"Q",data:[...a]}),e=a[2],i=a[3];break;case"q":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"Q",data:t}),e=t[2],i=t[3];break}case"A":s.push({key:"A",data:[...a]}),e=a[5],i=a[6];break;case"a":e+=a[5],i+=a[6],s.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],e,i]});break;case"H":s.push({key:"H",data:[...a]}),e=a[0];break;case"h":e+=a[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...a]}),i=a[0];break;case"v":i+=a[0],s.push({key:"V",data:[i]});break;case"S":s.push({key:"S",data:[...a]}),e=a[2],i=a[3];break;case"s":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"S",data:t}),e=t[2],i=t[3];break}case"T":s.push({key:"T",data:[...a]}),e=a[0],i=a[1];break;case"t":e+=a[0],i+=a[1],s.push({key:"T",data:[e,i]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,i=r}return s}function Cv(t){const e=[];let i="",n=0,r=0,s=0,o=0,a=0,l=0;for(const{key:h,data:c}of t){switch(h){case"M":e.push({key:"M",data:[...c]}),[n,r]=c,[s,o]=c;break;case"C":e.push({key:"C",data:[...c]}),n=c[4],r=c[5],a=c[2],l=c[3];break;case"L":e.push({key:"L",data:[...c]}),[n,r]=c;break;case"H":n=c[0],e.push({key:"L",data:[n,r]});break;case"V":r=c[0],e.push({key:"L",data:[n,r]});break;case"S":{let t=0,s=0;"C"===i||"S"===i?(t=n+(n-a),s=r+(r-l)):(t=n,s=r),e.push({key:"C",data:[t,s,...c]}),a=c[0],l=c[1],n=c[2],r=c[3];break}case"T":{const[t,s]=c;let o=0,h=0;"Q"===i||"T"===i?(o=n+(n-a),h=r+(r-l)):(o=n,h=r);const u=n+2*(o-n)/3,d=r+2*(h-r)/3,p=t+2*(o-t)/3,f=s+2*(h-s)/3;e.push({key:"C",data:[u,d,p,f,t,s]}),a=o,l=h,n=t,r=s;break}case"Q":{const[t,i,s,o]=c,h=n+2*(t-n)/3,u=r+2*(i-r)/3,d=s+2*(t-s)/3,p=o+2*(i-o)/3;e.push({key:"C",data:[h,u,d,p,s,o]}),a=t,l=i,n=s,r=o;break}case"A":{const t=Math.abs(c[0]),i=Math.abs(c[1]),s=c[2],o=c[3],a=c[4],l=c[5],h=c[6];0===t||0===i?(e.push({key:"C",data:[n,r,l,h,l,h]}),n=l,r=h):n===l&&r===h||(Bv(n,r,l,h,t,i,s,o,a).forEach((function(t){e.push({key:"C",data:t})})),n=l,r=h);break}case"Z":e.push({key:"Z",data:[]}),n=s,r=o}i=h}return e}function _v(t,e,i){return[t*Math.cos(i)-e*Math.sin(i),t*Math.sin(i)+e*Math.cos(i)]}function Bv(t,e,i,n,r,s,o,a,l,h){const c=(u=o,Math.PI*u/180);var u;let d=[],p=0,f=0,g=0,v=0;if(h)[p,f,g,v]=h;else{[t,e]=_v(t,e,-c),[i,n]=_v(i,n,-c);const o=(t-i)/2,h=(e-n)/2;let u=o*o/(r*r)+h*h/(s*s);u>1&&(u=Math.sqrt(u),r*=u,s*=u);const d=r*r,m=s*s,y=d*m-d*h*h-m*o*o,b=d*h*h+m*o*o,x=(a===l?-1:1)*Math.sqrt(Math.abs(y/b));g=x*r*h/s+(t+i)/2,v=x*-s*o/r+(e+n)/2,p=Math.asin(parseFloat(((e-v)/s).toFixed(9))),f=Math.asin(parseFloat(((n-v)/s).toFixed(9))),t<g&&(p=Math.PI-p),i<g&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),l&&p>f&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}let m=f-p;if(Math.abs(m)>120*Math.PI/180){const t=f,e=i,a=n;f=l&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=Bv(i=g+r*Math.cos(f),n=v+s*Math.sin(f),e,a,r,s,o,0,l,[f,t,g,v])}m=f-p;const y=Math.cos(p),b=Math.sin(p),x=Math.cos(f),w=Math.sin(f),A=Math.tan(m/4),S=4/3*r*A,T=4/3*s*A,C=[t,e],_=[t+S*b,e-T*y],B=[i+S*w,n-T*x],P=[i,n];if(_[0]=2*C[0]-_[0],_[1]=2*C[1]-_[1],h)return[_,B,P].concat(d);{d=[_,B,P].concat(d);const t=[];for(let e=0;e<d.length;e+=3){const i=_v(d[e][0],d[e][1],c),n=_v(d[e+1][0],d[e+1][1],c),r=_v(d[e+2][0],d[e+2][1],c);t.push([i[0],i[1],n[0],n[1],r[0],r[1]])}return t}}const Pv={randOffset:function(t,e){return Uv(t,e)},randOffsetWithRange:function(t,e,i){return jv(t,e,i)},ellipse:function(t,e,i,n,r){return Ev(t,e,r,kv(i,n,r)).opset},doubleLineOps:function(t,e,i,n,r){return Wv(t,e,i,n,r,!0)}};function Rv(t,e,i,n,r){return{type:"path",ops:Wv(t,e,i,n,r)}}function Mv(t,e,i){const n=(t||[]).length;if(n>2){const r=[];for(let e=0;e<n-1;e++)r.push(...Wv(t[e][0],t[e][1],t[e+1][0],t[e+1][1],i));return e&&r.push(...Wv(t[n-1][0],t[n-1][1],t[0][0],t[0][1],i)),{type:"path",ops:r}}return 2===n?Rv(t[0][0],t[0][1],t[1][0],t[1][1],i):{type:"path",ops:[]}}function kv(t,e,i){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),r=Math.ceil(Math.max(i.curveStepCount,i.curveStepCount/Math.sqrt(200)*n)),s=2*Math.PI/r;let o=Math.abs(t/2),a=Math.abs(e/2);const l=1-i.curveFitting;return o+=Uv(o*l,i),a+=Uv(a*l,i),{increment:s,rx:o,ry:a}}function Ev(t,e,i,n){const[r,s]=Gv(n.increment,t,e,n.rx,n.ry,1,n.increment*jv(.1,jv(.4,1,i),i),i);let o=zv(r,null,i);if(!i.disableMultiStroke&&0!==i.roughness){const[r]=Gv(n.increment,t,e,n.rx,n.ry,1.5,0,i),s=zv(r,null,i);o=o.concat(s)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function Ov(t,e,i,n,r,s,o,a,l){const h=t,c=e;let u=Math.abs(i/2),d=Math.abs(n/2);u+=Uv(.01*u,l),d+=Uv(.01*d,l);let p=r,f=s;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/l.curveStepCount,v=Math.min(g/2,(f-p)/2),m=Hv(v,h,c,u,d,p,f,1,l);if(!l.disableMultiStroke){const t=Hv(v,h,c,u,d,p,f,1.5,l);m.push(...t)}return o&&(a?m.push(...Wv(h,c,h+u*Math.cos(p),c+d*Math.sin(p),l),...Wv(h,c,h+u*Math.cos(f),c+d*Math.sin(f),l)):m.push({op:"lineTo",data:[h,c]},{op:"lineTo",data:[h+u*Math.cos(p),c+d*Math.sin(p)]})),{type:"path",ops:m}}function Lv(t,e){const i=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,r=n.length;if(r>2){i.push({op:"move",data:[n[0][0]+Uv(t,e),n[0][1]+Uv(t,e)]});for(let s=1;s<r;s++)i.push({op:"lineTo",data:[n[s][0]+Uv(t,e),n[s][1]+Uv(t,e)]})}}return{type:"fillPath",ops:i}}function Iv(t,e){return function(t,e){let i=t.fillStyle||"hachure";if(!bv[i])switch(i){case"zigzag":bv[i]||(bv[i]=new fv(e));break;case"cross-hatch":bv[i]||(bv[i]=new gv(e));break;case"dots":bv[i]||(bv[i]=new vv(e));break;case"dashed":bv[i]||(bv[i]=new mv(e));break;case"zigzag-line":bv[i]||(bv[i]=new yv(e));break;default:i="hachure",bv[i]||(bv[i]=new pv(e))}return bv[i]}(e,Pv).fillPolygons(t,e)}function Dv(t){return t.randomizer||(t.randomizer=new xv(t.seed||0)),t.randomizer.next()}function jv(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return i.roughness*n*(Dv(i)*(e-t)+t)}function Uv(t,e){return jv(-t,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function Wv(t,e,i,n,r){const s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?r.disableMultiStrokeFill:r.disableMultiStroke,o=Nv(t,e,i,n,r,!0,!1);if(s)return o;const a=Nv(t,e,i,n,r,!0,!0);return o.concat(a)}function Nv(t,e,i,n,r,s,o){const a=Math.pow(t-i,2)+Math.pow(e-n,2),l=Math.sqrt(a);let h=1;h=l<200?1:l>500?.4:-.0016668*l+1.233334;let c=r.maxRandomnessOffset||0;c*c*100>a&&(c=l/10);const u=c/2,d=.2+.2*Dv(r);let p=r.bowing*r.maxRandomnessOffset*(n-e)/200,f=r.bowing*r.maxRandomnessOffset*(t-i)/200;p=Uv(p,r,h),f=Uv(f,r,h);const g=[],v=()=>Uv(u,r,h),m=()=>Uv(c,r,h),y=r.preserveVertices;return s&&(o?g.push({op:"move",data:[t+(y?0:v()),e+(y?0:v())]}):g.push({op:"move",data:[t+(y?0:Uv(c,r,h)),e+(y?0:Uv(c,r,h))]})),o?g.push({op:"bcurveTo",data:[p+t+(i-t)*d+v(),f+e+(n-e)*d+v(),p+t+2*(i-t)*d+v(),f+e+2*(n-e)*d+v(),i+(y?0:v()),n+(y?0:v())]}):g.push({op:"bcurveTo",data:[p+t+(i-t)*d+m(),f+e+(n-e)*d+m(),p+t+2*(i-t)*d+m(),f+e+2*(n-e)*d+m(),i+(y?0:m()),n+(y?0:m())]}),g}function Fv(t,e,i){const n=[];n.push([t[0][0]+Uv(e,i),t[0][1]+Uv(e,i)]),n.push([t[0][0]+Uv(e,i),t[0][1]+Uv(e,i)]);for(let r=1;r<t.length;r++)n.push([t[r][0]+Uv(e,i),t[r][1]+Uv(e,i)]),r===t.length-1&&n.push([t[r][0]+Uv(e,i),t[r][1]+Uv(e,i)]);return zv(n,null,i)}function zv(t,e,i){const n=t.length,r=[];if(n>3){const s=[],o=1-i.curveTightness;r.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const i=t[e];s[0]=[i[0],i[1]],s[1]=[i[0]+(o*t[e+1][0]-o*t[e-1][0])/6,i[1]+(o*t[e+1][1]-o*t[e-1][1])/6],s[2]=[t[e+1][0]+(o*t[e][0]-o*t[e+2][0])/6,t[e+1][1]+(o*t[e][1]-o*t[e+2][1])/6],s[3]=[t[e+1][0],t[e+1][1]],r.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}if(e&&2===e.length){const t=i.maxRandomnessOffset;r.push({op:"lineTo",data:[e[0]+Uv(t,i),e[1]+Uv(t,i)]})}}else 3===n?(r.push({op:"move",data:[t[1][0],t[1][1]]}),r.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&r.push(...Wv(t[0][0],t[0][1],t[1][0],t[1][1],i));return r}function Gv(t,e,i,n,r,s,o,a){const l=[],h=[];if(0===a.roughness){t/=4,h.push([e+n*Math.cos(-t),i+r*Math.sin(-t)]);for(let s=0;s<=2*Math.PI;s+=t){const t=[e+n*Math.cos(s),i+r*Math.sin(s)];l.push(t),h.push(t)}h.push([e+n*Math.cos(0),i+r*Math.sin(0)]),h.push([e+n*Math.cos(t),i+r*Math.sin(t)])}else{const c=Uv(.5,a)-Math.PI/2;h.push([Uv(s,a)+e+.9*n*Math.cos(c-t),Uv(s,a)+i+.9*r*Math.sin(c-t)]);const u=2*Math.PI+c-.01;for(let o=c;o<u;o+=t){const t=[Uv(s,a)+e+n*Math.cos(o),Uv(s,a)+i+r*Math.sin(o)];l.push(t),h.push(t)}h.push([Uv(s,a)+e+n*Math.cos(c+2*Math.PI+.5*o),Uv(s,a)+i+r*Math.sin(c+2*Math.PI+.5*o)]),h.push([Uv(s,a)+e+.98*n*Math.cos(c+o),Uv(s,a)+i+.98*r*Math.sin(c+o)]),h.push([Uv(s,a)+e+.9*n*Math.cos(c+.5*o),Uv(s,a)+i+.9*r*Math.sin(c+.5*o)])}return[h,l]}function Hv(t,e,i,n,r,s,o,a,l){const h=s+Uv(.1,l),c=[];c.push([Uv(a,l)+e+.9*n*Math.cos(h-t),Uv(a,l)+i+.9*r*Math.sin(h-t)]);for(let s=h;s<=o;s+=t)c.push([Uv(a,l)+e+n*Math.cos(s),Uv(a,l)+i+r*Math.sin(s)]);return c.push([e+n*Math.cos(o),i+r*Math.sin(o)]),c.push([e+n*Math.cos(o),i+r*Math.sin(o)]),zv(c,null,l)}function Vv(t,e,i,n,r,s,o,a){const l=[],h=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let c=[0,0];const u=a.disableMultiStroke?1:2,d=a.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(d?0:Uv(h[0],a)),o[1]+(d?0:Uv(h[0],a))]}),c=d?[r,s]:[r+Uv(h[p],a),s+Uv(h[p],a)],l.push({op:"bcurveTo",data:[t+Uv(h[p],a),e+Uv(h[p],a),i+Uv(h[p],a),n+Uv(h[p],a),c[0],c[1]]});return l}function Yv(t){return[...t]}function Xv(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function $v(t,e,i){const n=Xv(e,i);if(0===n)return Xv(t,e);let r=((t[0]-e[0])*(i[0]-e[0])+(t[1]-e[1])*(i[1]-e[1]))/n;return r=Math.max(0,Math.min(1,r)),Xv(t,qv(e,i,r))}function qv(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function Kv(t,e,i,n){const r=n||[];if(function(t,e){const i=t[e+0],n=t[e+1],r=t[e+2],s=t[e+3];let o=3*n[0]-2*i[0]-s[0];o*=o;let a=3*n[1]-2*i[1]-s[1];a*=a;let l=3*r[0]-2*s[0]-i[0];l*=l;let h=3*r[1]-2*s[1]-i[1];return h*=h,o<l&&(o=l),a<h&&(a=h),o+a}(t,e)<i){const i=t[e+0];r.length?(s=r[r.length-1],o=i,Math.sqrt(Xv(s,o))>1&&r.push(i)):r.push(i),r.push(t[e+3])}else{const n=.5,s=t[e+0],o=t[e+1],a=t[e+2],l=t[e+3],h=qv(s,o,n),c=qv(o,a,n),u=qv(a,l,n),d=qv(h,c,n),p=qv(c,u,n),f=qv(d,p,n);Kv([s,h,d,f],0,i,r),Kv([f,p,u,l],0,i,r)}var s,o;return r}function Zv(t,e){return Jv(t,0,t.length,e)}function Jv(t,e,i,n,r){const s=r||[],o=t[e],a=t[i-1];let l=0,h=1;for(let n=e+1;n<i-1;++n){const e=$v(t[n],o,a);e>l&&(l=e,h=n)}return Math.sqrt(l)>n?(Jv(t,e,h+1,n,s),Jv(t,h,i,n,s)):(s.length||s.push(o),s.push(a)),s}function Qv(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,i=arguments.length>2?arguments[2]:void 0;const n=[],r=(t.length-1)/3;for(let i=0;i<r;i++)Kv(t,3*i,e,n);return i&&i>0?Jv(n,0,n.length,i):n}const tm="none";class em{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,i){return{shape:t,sets:e||[],options:i||this.defaultOptions}}line(t,e,i,n,r){const s=this._o(r);return this._d("line",[Rv(t,e,i,n,s)],s)}rectangle(t,e,i,n,r){const s=this._o(r),o=[],a=function(t,e,i,n,r){return function(t,e){return Mv(t,!0,e)}([[t,e],[t+i,e],[t+i,e+n],[t,e+n]],r)}(t,e,i,n,s);if(s.fill){const r=[[t,e],[t+i,e],[t+i,e+n],[t,e+n]];"solid"===s.fillStyle?o.push(Lv([r],s)):o.push(Iv([r],s))}return s.stroke!==tm&&o.push(a),this._d("rectangle",o,s)}ellipse(t,e,i,n,r){const s=this._o(r),o=[],a=kv(i,n,s),l=Ev(t,e,s,a);if(s.fill)if("solid"===s.fillStyle){const i=Ev(t,e,s,a).opset;i.type="fillPath",o.push(i)}else o.push(Iv([l.estimatedPoints],s));return s.stroke!==tm&&o.push(l.opset),this._d("ellipse",o,s)}circle(t,e,i,n){const r=this.ellipse(t,e,i,i,n);return r.shape="circle",r}linearPath(t,e){const i=this._o(e);return this._d("linearPath",[Mv(t,!1,i)],i)}arc(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7?arguments[7]:void 0;const l=this._o(a),h=[],c=Ov(t,e,i,n,r,s,o,!0,l);if(o&&l.fill)if("solid"===l.fillStyle){const o=Object.assign({},l);o.disableMultiStroke=!0;const a=Ov(t,e,i,n,r,s,!0,!1,o);a.type="fillPath",h.push(a)}else h.push(function(t,e,i,n,r,s,o){const a=t,l=e;let h=Math.abs(i/2),c=Math.abs(n/2);h+=Uv(.01*h,o),c+=Uv(.01*c,o);let u=r,d=s;for(;u<0;)u+=2*Math.PI,d+=2*Math.PI;d-u>2*Math.PI&&(u=0,d=2*Math.PI);const p=(d-u)/o.curveStepCount,f=[];for(let t=u;t<=d;t+=p)f.push([a+h*Math.cos(t),l+c*Math.sin(t)]);return f.push([a+h*Math.cos(d),l+c*Math.sin(d)]),f.push([a,l]),Iv([f],o)}(t,e,i,n,r,s,l));return l.stroke!==tm&&h.push(c),this._d("arc",h,l)}curve(t,e){const i=this._o(e),n=[],r=function(t,e){let i=Fv(t,1*(1+.2*e.roughness),e);if(!e.disableMultiStroke){const n=Fv(t,1.5*(1+.22*e.roughness),function(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}(e));i=i.concat(n)}return{type:"path",ops:i}}(t,i);if(i.fill&&i.fill!==tm&&t.length>=3){const e=Qv(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=t.length;if(i<3)throw new Error("A curve must have at least three points.");const n=[];if(3===i)n.push(Yv(t[0]),Yv(t[1]),Yv(t[2]),Yv(t[2]));else{const i=[];i.push(t[0],t[0]);for(let e=1;e<t.length;e++)i.push(t[e]),e===t.length-1&&i.push(t[e]);const r=[],s=1-e;n.push(Yv(i[0]));for(let t=1;t+2<i.length;t++){const e=i[t];r[0]=[e[0],e[1]],r[1]=[e[0]+(s*i[t+1][0]-s*i[t-1][0])/6,e[1]+(s*i[t+1][1]-s*i[t-1][1])/6],r[2]=[i[t+1][0]+(s*i[t][0]-s*i[t+2][0])/6,i[t+1][1]+(s*i[t][1]-s*i[t+2][1])/6],r[3]=[i[t+1][0],i[t+1][1]],n.push(r[1],r[2],r[3])}}return n}(t),10,(1+i.roughness)/2);"solid"===i.fillStyle?n.push(Lv([e],i)):n.push(Iv([e],i))}return i.stroke!==tm&&n.push(r),this._d("curve",n,i)}polygon(t,e){const i=this._o(e),n=[],r=Mv(t,!0,i);return i.fill&&("solid"===i.fillStyle?n.push(Lv([t],i)):n.push(Iv([t],i))),i.stroke!==tm&&n.push(r),this._d("polygon",n,i)}path(t,e){const i=this._o(e),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=i.fill&&"transparent"!==i.fill&&i.fill!==tm,s=i.stroke!==tm,o=!!(i.simplification&&i.simplification<1),a=function(t,e,i){const n=Cv(Tv(Sv(t))),r=[];let s=[],o=[0,0],a=[];const l=()=>{a.length>=4&&s.push(...Qv(a,1)),a=[]},h=()=>{l(),s.length&&(r.push(s),s=[])};for(const{key:t,data:e}of n)switch(t){case"M":h(),o=[e[0],e[1]],s.push(o);break;case"L":l(),s.push([e[0],e[1]]);break;case"C":if(!a.length){const t=s.length?s[s.length-1]:o;a.push([t[0],t[1]])}a.push([e[0],e[1]]),a.push([e[2],e[3]]),a.push([e[4],e[5]]);break;case"Z":l(),s.push([o[0],o[1]])}if(h(),!i)return r;const c=[];for(const t of r){const e=Zv(t,i);e.length&&c.push(e)}return c}(t,0,o?4-4*i.simplification:(1+i.roughness)/2);return r&&("solid"===i.fillStyle?n.push(Lv(a,i)):n.push(Iv(a,i))),s&&(o?a.forEach((t=>{n.push(Mv(t,!1,i))})):n.push(function(t,e){const i=Cv(Tv(Sv(t))),n=[];let r=[0,0],s=[0,0];for(const{key:t,data:o}of i)switch(t){case"M":{const t=1*(e.maxRandomnessOffset||0),i=e.preserveVertices;n.push({op:"move",data:o.map((n=>n+(i?0:Uv(t,e))))}),s=[o[0],o[1]],r=[o[0],o[1]];break}case"L":n.push(...Wv(s[0],s[1],o[0],o[1],e)),s=[o[0],o[1]];break;case"C":{const[t,i,r,a,l,h]=o;n.push(...Vv(t,i,r,a,l,h,s,e)),s=[l,h];break}case"Z":n.push(...Wv(s[0],s[1],r[0],r[1],e)),s=[r[0],r[1]]}return{type:"path",ops:n}}(t,i))),this._d("path",n,i)}opsToPath(t,e){let i="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":i+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":i+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":i+=`L${t[0]} ${t[1]} `}}return i.trim()}toPaths(t){const e=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:tm};break;case"fillPath":e={d:this.opsToPath(t),stroke:tm,strokeWidth:0,fill:i.fill||tm};break;case"fillSketch":e=this.fillSketch(t,i)}e&&n.push(e)}return n}fillSketch(t,e){let i=e.fillWeight;return i<0&&(i=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||tm,strokeWidth:i,fill:tm}}}class im{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new em(e)}draw(t){const e=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(const s of e)switch(s.type){case"path":n.save(),n.strokeStyle="none"===i.stroke?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,s,r),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,s,r,e),n.restore();break}case"fillSketch":this.fillSketch(n,s,i)}}fillSketch(t,e,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,e,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";t.beginPath();for(const n of e.ops){const e="number"==typeof i&&i>=0?n.data.map((t=>+t.toFixed(i))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,i,n,r){const s=this.gen.line(t,e,i,n,r);return this.draw(s),s}rectangle(t,e,i,n,r){const s=this.gen.rectangle(t,e,i,n,r);return this.draw(s),s}ellipse(t,e,i,n,r){const s=this.gen.ellipse(t,e,i,n,r);return this.draw(s),s}circle(t,e,i,n){const r=this.gen.circle(t,e,i,n);return this.draw(r),r}linearPath(t,e){const i=this.gen.linearPath(t,e);return this.draw(i),i}polygon(t,e){const i=this.gen.polygon(t,e);return this.draw(i),i}arc(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7?arguments[7]:void 0;const l=this.gen.arc(t,e,i,n,r,s,o,a);return this.draw(l),l}curve(t,e){const i=this.gen.curve(t,e);return this.draw(i),i}path(t,e){const i=this.gen.path(t,e);return this.draw(i),i}}var nm=(t,e)=>new im(t,e);const rm={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};var sm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},om=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},am=function(t,e){return function(i,n){e(i,n,t)}};let lm=class{constructor(t){this.canvasRenderer=t,this.style="rough",this.type="arc",this.numberType=qo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s);r.highPerformanceSave();const a=Tr(t).arc;let{x:l=a.x,y:h=a.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=a.dx,dy:i=a.dy}=t.attribute;l+=e,h+=i,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);const c=new Di,{fill:u=a.fill,stroke:d=a.stroke,lineWidth:p=a.lineWidth,outerRadius:f=a.outerRadius,innerRadius:g=a.innerRadius,maxRandomnessOffset:v=rm.maxRandomnessOffset,roughness:m=rm.roughness,bowing:y=rm.bowing,curveFitting:b=rm.curveFitting,curveTightness:x=rm.curveTightness,curveStepCount:w=rm.curveStepCount,fillStyle:A=rm.fillStyle,fillWeight:S=rm.fillWeight,hachureAngle:T=rm.hachureAngle,hachureGap:C=rm.hachureGap,simplification:_=rm.simplification,dashOffset:B=rm.dashOffset,dashGap:P=rm.dashGap,zigzagOffset:R=rm.zigzagOffset,seed:M=rm.seed,fillLineDash:k=rm.fillLineDash,fillLineDashOffset:E=rm.fillLineDashOffset,disableMultiStroke:O=rm.disableMultiStroke,disableMultiStrokeFill:L=rm.disableMultiStrokeFill,preserveVertices:I=rm.preserveVertices,fixedDecimalPlaceDigits:D=rm.fixedDecimalPlaceDigits}=t.attribute;Na(t,c,l,h,f,g),o.path(c.toString(),{fill:u||void 0,stroke:d||void 0,strokeWidth:p,maxRandomnessOffset:v,roughness:m,bowing:y,curveFitting:b,curveTightness:x,curveStepCount:w,fillStyle:A,fillWeight:S,hachureAngle:T,hachureGap:C,simplification:_,dashOffset:B,dashGap:P,zigzagOffset:R,seed:M,fillLineDash:k,fillLineDashOffset:E,disableMultiStroke:O,disableMultiStrokeFill:L,preserveVertices:I,fixedDecimalPlaceDigits:D}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};lm=sm([g(),am(0,p(t.DefaultCanvasArcRender)),om("design:paramtypes",[Object])],lm);var hm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let cm=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.style="rough"}drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f){if(f)return super.drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=nm(g,{}),m=new Di;Mu(m,e,l,{offsetX:h,offsetY:c});const{maxRandomnessOffset:y=rm.maxRandomnessOffset,roughness:b=rm.roughness,bowing:x=rm.bowing,curveFitting:w=rm.curveFitting,curveTightness:A=rm.curveTightness,curveStepCount:S=rm.curveStepCount,fillStyle:T=rm.fillStyle,fillWeight:C=rm.fillWeight,hachureAngle:_=rm.hachureAngle,hachureGap:B=rm.hachureGap,simplification:P=rm.simplification,dashOffset:R=rm.dashOffset,dashGap:M=rm.dashGap,zigzagOffset:k=rm.zigzagOffset,seed:E=rm.seed,fillLineDash:O=rm.fillLineDash,fillLineDashOffset:L=rm.fillLineDashOffset,disableMultiStroke:I=rm.disableMultiStroke,disableMultiStrokeFill:D=rm.disableMultiStrokeFill,preserveVertices:j=rm.preserveVertices,fixedDecimalPlaceDigits:U=rm.fixedDecimalPlaceDigits}=o;let{fill:W,stroke:N,lineWidth:F}=o;return Array.isArray(a)?a.forEach((t=>{W=null!=W?W:t.fill,N=null!=N?N:t.stroke,F=null!=F?F:t.lineWidth})):(W=null!=W?W:a.fill,N=null!=N?N:a.stroke,F=null!=F?F:a.lineWidth),v.path(m.toString(),{fill:i?W:void 0,strokeWidth:F,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:A,curveStepCount:S,fillStyle:T,fillWeight:C,hachureAngle:_,hachureGap:B,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:k,seed:E,fillLineDash:O,fillLineDashOffset:L,disableMultiStroke:I,disableMultiStrokeFill:D,preserveVertices:j,fixedDecimalPlaceDigits:U}),t.highPerformanceRestore(),!1}};cm=hm([g()],cm);var um=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},dm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pm=function(t,e){return function(i,n){e(i,n,t)}};let fm=class{constructor(t){this.canvasRenderer=t,this.style="rough",this.type="circle",this.numberType=Jo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s,{}),a=Tr(t).circle;let{x:l=a.x,y:h=a.y}=t.attribute;t.transMatrix.onlyTranslate()?r.onlyTranslate()||r.clearMatrix():(l=0,h=0,r.transformFromMatrix(t.transMatrix,!0));const{radius:c=a.radius,fill:u=a.fill,stroke:d=a.stroke,lineWidth:p=a.lineWidth}=t.attribute;o.circle(l,h,c,{fill:u||void 0,stroke:d||void 0,strokeWidth:p,fillStyle:"zigzag",roughness:.5})}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};fm=um([g(),pm(0,p(t.DefaultCanvasCircleRender)),dm("design:paramtypes",[Object])],fm);var gm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let vm=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.style="rough"}drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f){if(p||f)return super.drawSegmentItem(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=nm(g,{}),m=new Di;_u(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u});const{maxRandomnessOffset:y=rm.maxRandomnessOffset,roughness:b=rm.roughness,bowing:x=rm.bowing,curveFitting:w=rm.curveFitting,curveTightness:A=rm.curveTightness,curveStepCount:S=rm.curveStepCount,fillStyle:T=rm.fillStyle,fillWeight:C=rm.fillWeight,hachureAngle:_=rm.hachureAngle,hachureGap:B=rm.hachureGap,simplification:P=rm.simplification,dashOffset:R=rm.dashOffset,dashGap:M=rm.dashGap,zigzagOffset:k=rm.zigzagOffset,seed:E=rm.seed,fillLineDash:O=rm.fillLineDash,fillLineDashOffset:L=rm.fillLineDashOffset,disableMultiStroke:I=rm.disableMultiStroke,disableMultiStrokeFill:D=rm.disableMultiStrokeFill,preserveVertices:j=rm.preserveVertices,fixedDecimalPlaceDigits:U=rm.fixedDecimalPlaceDigits}=o;let{fill:W,stroke:N,lineWidth:F}=o;return Array.isArray(a)?a.forEach((t=>{W=null!=W?W:t.fill,N=null!=N?N:t.stroke,F=null!=F?F:t.lineWidth})):(W=null!=W?W:a.fill,N=null!=N?N:a.stroke,F=null!=F?F:a.lineWidth),v.path(m.toString(),{fill:i?W:void 0,stroke:n?N:void 0,strokeWidth:F,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:A,curveStepCount:S,fillStyle:T,fillWeight:C,hachureAngle:_,hachureGap:B,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:k,seed:E,fillLineDash:O,fillLineDashOffset:L,disableMultiStroke:I,disableMultiStrokeFill:D,preserveVertices:j,fixedDecimalPlaceDigits:U}),t.highPerformanceRestore(),!1}};vm=gm([g()],vm);var mm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ym=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bm=function(t,e){return function(i,n){e(i,n,t)}};let xm=class{constructor(t){this.canvasRenderer=t,this.style="rough",this.type="path",this.numberType=na}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s,{});r.highPerformanceSave();const a=Tr(t).path;r.transformFromMatrix(t.transMatrix,!0);const{fill:l=a.fill,stroke:h=a.stroke,lineWidth:c=a.lineWidth,path:u=a.path,maxRandomnessOffset:d=rm.maxRandomnessOffset,roughness:p=rm.roughness,bowing:f=rm.bowing,curveFitting:g=rm.curveFitting,curveTightness:v=rm.curveTightness,curveStepCount:m=rm.curveStepCount,fillStyle:y=rm.fillStyle,fillWeight:b=rm.fillWeight,hachureAngle:x=rm.hachureAngle,hachureGap:w=rm.hachureGap,simplification:A=rm.simplification,dashOffset:S=rm.dashOffset,dashGap:T=rm.dashGap,zigzagOffset:C=rm.zigzagOffset,seed:_=rm.seed,fillLineDash:B=rm.fillLineDash,fillLineDashOffset:P=rm.fillLineDashOffset,disableMultiStroke:R=rm.disableMultiStroke,disableMultiStrokeFill:M=rm.disableMultiStrokeFill,preserveVertices:k=rm.preserveVertices,fixedDecimalPlaceDigits:E=rm.fixedDecimalPlaceDigits}=t.attribute;"string"==typeof u&&o.path(u,{fill:l||void 0,stroke:h||void 0,strokeWidth:c,maxRandomnessOffset:d,roughness:p,bowing:f,curveFitting:g,curveTightness:v,curveStepCount:m,fillStyle:y,fillWeight:b,hachureAngle:x,hachureGap:w,simplification:A,dashOffset:S,dashGap:T,zigzagOffset:C,seed:_,fillLineDash:B,fillLineDashOffset:P,disableMultiStroke:R,disableMultiStrokeFill:M,preserveVertices:k,fixedDecimalPlaceDigits:E}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};xm=mm([g(),bm(0,p(t.DefaultCanvasPathRender)),ym("design:paramtypes",[Object])],xm);var wm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Am=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sm=function(t,e){return function(i,n){e(i,n,t)}};let Tm=class{constructor(t){this.canvasRenderer=t,this.style="rough",this.type="rect",this.numberType=oa}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s);r.highPerformanceSave();const a=Tr(t).rect;let{x:l=a.x,y:h=a.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=a.dx,dy:i=a.dy}=t.attribute;l+=e,h+=i,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);const{fill:c=a.fill,stroke:u=a.stroke,fillColor:d=a.fill,strokeColor:p=a.stroke,x1:f,y1:g,lineWidth:v=a.lineWidth,maxRandomnessOffset:m=rm.maxRandomnessOffset,roughness:y=rm.roughness,bowing:b=rm.bowing,curveFitting:x=rm.curveFitting,curveTightness:w=rm.curveTightness,curveStepCount:A=rm.curveStepCount,fillStyle:S=rm.fillStyle,fillWeight:T=rm.fillWeight,hachureAngle:C=rm.hachureAngle,hachureGap:_=rm.hachureGap,simplification:B=rm.simplification,dashOffset:P=rm.dashOffset,dashGap:R=rm.dashGap,zigzagOffset:M=rm.zigzagOffset,seed:k=rm.seed,fillLineDash:E=rm.fillLineDash,fillLineDashOffset:O=rm.fillLineDashOffset,disableMultiStroke:L=rm.disableMultiStroke,disableMultiStrokeFill:I=rm.disableMultiStrokeFill,preserveVertices:D=rm.preserveVertices,fixedDecimalPlaceDigits:j=rm.fixedDecimalPlaceDigits}=t.attribute;let{width:U=a.width,height:W=a.height}=t.attribute;U=(null!=U?U:f-l)||0,W=(null!=W?W:g-h)||0,o.rectangle(l,h,U,W,{fill:c?d:void 0,stroke:u?p:void 0,strokeWidth:v,maxRandomnessOffset:m,roughness:y,bowing:b,curveFitting:x,curveTightness:w,curveStepCount:A,fillStyle:S,fillWeight:T,hachureAngle:C,hachureGap:_,simplification:B,dashOffset:P,dashGap:R,zigzagOffset:M,seed:k,fillLineDash:E,fillLineDashOffset:O,disableMultiStroke:L,disableMultiStrokeFill:I,preserveVertices:D,fixedDecimalPlaceDigits:j}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};Tm=wm([g(),Sm(0,p(t.DefaultCanvasRectRender)),Am("design:paramtypes",[Object])],Tm);var Cm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},_m=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bm=function(t,e){return function(i,n){e(i,n,t)}};let Pm=class extends Ic{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ha,this.style="rough"}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=nm(s);r.highPerformanceSave();const a=Tr(t).symbol,l=this.transform(t,a,r),{x:h,y:c,z:u,lastModelMatrix:d}=l,p=t.getParsedPath();if(!p)return;const{fill:f=a.fill,stroke:g=a.stroke,fillColor:v=a.fill,strokeColor:m=a.stroke,size:y=a.size,lineWidth:b=a.lineWidth,maxRandomnessOffset:x=rm.maxRandomnessOffset,roughness:w=rm.roughness,bowing:A=rm.bowing,curveFitting:S=rm.curveFitting,curveTightness:T=rm.curveTightness,curveStepCount:C=rm.curveStepCount,fillStyle:_=rm.fillStyle,fillWeight:B=rm.fillWeight,hachureAngle:P=rm.hachureAngle,hachureGap:R=rm.hachureGap,simplification:M=rm.simplification,dashOffset:k=rm.dashOffset,dashGap:E=rm.dashGap,zigzagOffset:O=rm.zigzagOffset,seed:L=rm.seed,fillLineDash:I=rm.fillLineDash,fillLineDashOffset:D=rm.fillLineDashOffset,disableMultiStroke:j=rm.disableMultiStroke,disableMultiStrokeFill:U=rm.disableMultiStrokeFill,preserveVertices:W=rm.preserveVertices,fixedDecimalPlaceDigits:N=rm.fixedDecimalPlaceDigits}=t.attribute;let F="";if(p.drawToSvgPath)F=p.drawToSvgPath(y,h,c);else{const t=new Di;p.draw(t,y,h,c)&&t.closePath(),F=t.toString()}o.path(F,{fill:f?v:void 0,stroke:g?m:void 0,strokeWidth:b,maxRandomnessOffset:x,roughness:w,bowing:A,curveFitting:S,curveTightness:T,curveStepCount:C,fillStyle:_,fillWeight:B,hachureAngle:P,hachureGap:R,simplification:M,dashOffset:k,dashGap:E,zigzagOffset:O,seed:L,fillLineDash:I,fillLineDashOffset:D,disableMultiStroke:j,disableMultiStrokeFill:U,preserveVertices:W,fixedDecimalPlaceDigits:N}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};Pm=Cm([g(),Bm(0,p(t.DefaultCanvasSymbolRender)),_m("design:paramtypes",[Object])],Pm);var Rm=new i((t=>{t(fm).toSelf().inSingletonScope(),t(Ad).to(fm),t(Tm).toSelf().inSingletonScope(),t(Ad).to(Tm),t(xm).toSelf().inSingletonScope(),t(Ad).to(xm),t(Pm).toSelf().inSingletonScope(),t(Ad).to(Pm),t(vm).toSelf().inSingletonScope(),t(Ad).to(vm),t(cm).toSelf().inSingletonScope(),t(Ad).to(cm),t(lm).toSelf().inSingletonScope(),t(Ad).to(lm)}));const Mm=Symbol.for("MathPickerContribution"),km=Symbol.for("MathArcPicker"),Em=Symbol.for("MathAreaPicker"),Om=Symbol.for("MathCirclePicker"),Lm=Symbol.for("MathImagePicker"),Im=Symbol.for("MathLinePicker"),Dm=Symbol.for("MathPathPicker"),jm=Symbol.for("MathRectPicker"),Um=Symbol.for("MathSymbolPicker"),Wm=Symbol.for("MathTextPicker"),Nm=Symbol.for("MathPolygonPicker"),Fm=Symbol.for("MathGlyphPicker"),zm=Symbol.for("CanvasArcPicker"),Gm=Symbol.for("CanvasArc3dPicker"),Hm=Symbol.for("CanvasAreaPicker"),Vm=Symbol.for("CanvasCirclePicker"),Ym=Symbol.for("CanvasImagePicker"),Xm=Symbol.for("CanvasLinePicker"),$m=Symbol.for("CanvasPathPicker"),qm=Symbol.for("CanvasRectPicker"),Km=Symbol.for("CanvasRect3dPicker"),Zm=Symbol.for("CanvasSymbolPicker"),Jm=Symbol.for("CanvasTextPicker"),Qm=Symbol.for("CanvasPolygonPicker"),ty=Symbol.for("CanvasPyramid3dPicker"),ey=Symbol.for("CanvasRichTextPicker"),iy=Symbol.for("CanvasGlyphPicker"),ny=Symbol.for("CanvasGroupPicker"),ry=Symbol.for("CanvasPickerContribution"),sy={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},oy=Object.keys(sy);function ay(t){return Mc.richtext(t?t.attribute:{})}ay.Text=function(t){return Object.assign({type:"rich/text"},t)},ay.Image=function(t){return Object.assign({type:"rich/image"},t)};var ly=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i};function hy(t,e){if(nt(t))return t.forEach((t=>hy(t,e)));e.push(t)}const cy=ya;function uy(t){if(!t||!t.$$typeof)return t;const e=t.type,{attribute:i,children:n,stateProxy:r,id:s,name:o}=t.props,a=e({attribute:i}),l=function(t,e,i){let n,r=!1;switch(t.type){case"richtext":break;case"rich/text":n=t.attribute||{},i&&(n.text=i),t.attribute=n;break;case"rich/image":n=t.attribute||{};break;default:r=!0}return r?Object.keys(e).forEach((i=>{const n=sy[i];n&&t.on(n,e[i])})):"richtext"===t.type&&(t.attribute.textConfig=i.map((t=>uy(t))).filter((t=>t))),n}(a,t.props,n);return l||(r&&(a.stateProxy=r),a.id=s,a.name=o,dy(n,a),a)}function dy(t,e){nt(t)?t.forEach((t=>{if(nt(t))dy(t,e);else{const i=uy(t);i&&i.type&&e.add(i)}})):t&&e.add(uy(t))}const py=(t,e)=>{const i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},fy=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};var gy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const my=[0,0,0];let yy=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},Fi),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Gi),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Hi),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new $t(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new $t(1,0,0,1,0,0),this._clearMatrix=new $t(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&yt.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new $t(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return yc.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(yc.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(yc.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,n,r,s,o){if(o=o||0,this.camera){const a=[];((t,e,i,n,r,s,o,a)=>{if(a)for(;i>e;)i-=Bt;else for(;i<e;)i+=Bt;const l=Tt/3*(i>e?1:-1);let h=e,c=h;for(;c!==i;){c=l>0?Math.min(c+l,i):Math.max(c+l,i);const e=Math.abs(c-h),a=4*Math.tan(e/4)/3,u=c<h?-1:1,d=Math.cos(h),p=Math.sin(h),f=Math.cos(c),g=Math.sin(c),v=d*s+n,m=p*o+r,y=f*s+n,b=g*o+r,x=s*a*u,w=o*a*u;t.push([v-x*p,m+w*d,y+x*g,b-w*f,y,b]),h=c}})(a,n,r,t,e,i,i,s);for(let t=0;t<a.length;++t){const e=a[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],o)}}else this.nativeContext.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.nativeContext.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s,o){if(o=o||0,this.camera){let a=o,l=o;this.modelMatrix&&(cf(my,[t,e,o],this.modelMatrix),t=my[0],e=my[1],a=my[2],cf(my,[i,n,o],this.modelMatrix),i=my[0],n=my[1],l=my[2],cf(my,[r,s,o],this.modelMatrix),r=my[0],s=my[1],o=my[2]);let h=this.camera.vp(r,s,o);r=h.x,s=h.y,h=this.camera.vp(t,e,a),t=h.x,e=h.y,h=this.camera.vp(i,n,l),i=h.x,n=h.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,o,a){null==a?this.nativeContext.ellipse(t,e,i,n,r,s,o):this.nativeContext.ellipse(t,e,i,n,r,s,o,a)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(cf(my,[t,e,i],this.modelMatrix),t=my[0],e=my[1],i=my[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(cf(my,[t,e,i],this.modelMatrix),t=my[0],e=my[1],i=my[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,n,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(cf(my,[t,e,r],this.modelMatrix),t=my[0],e=my[1],s=my[2],cf(my,[i,n,r],this.modelMatrix),i=my[0],n=my[1],r=my[2]);let o=this.camera.vp(i,n,r);i=o.x,n=o.y,o=this.camera.vp(t,e,s),t=o.x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+n,r),this.lineTo(t,e+n,r),this.closePath()):this.nativeContext.rect(t,e,i,n)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,n){return this.nativeContext.createLinearGradient(t,e,i,n)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createRadialGradient(t,e,i,n,r,s)}createConicGradient(t,e,i,n){let r,s=!1;const o=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(a,l,h){return s&&(h||(h=n-i),r=Va(o,this.stops,t,e,h,i,n,a,l),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,n){this.nativeContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){this.nativeContext.clearRect(t,e,i,n)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(cf(my,[t,e,i],this.modelMatrix),t=my[0],e=my[1],i=my[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(cf(my,[t,e,i],this.modelMatrix),t=my[0],e=my[1],i=my[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(cf(my,[e,i,n],this.modelMatrix),e=my[0],i=my[1],n=my[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,n){return this.nativeContext.getImageData(t,e,i,n)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn.global.measureTextMethod;var i,n;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=pn.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const r=null!==(i=this.fontFamily)&&void 0!==i?i:Hi.fontFamily,s=null!==(n=this.fontSize)&&void 0!==n?n:Hi.fontSize;return this.mathTextMeasure.textSpec.fontFamily===r&&this.mathTextMeasure.textSpec.fontSize===s||(this.mathTextMeasure.textSpec.fontFamily=r,this.mathTextMeasure.textSpec.fontSize=s,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,n){this.nativeContext.strokeRect(t,e,i,n)}strokeText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(cf(my,[e,i,n],this.modelMatrix),e=my[0],i=my[1],n=my[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setCommonStyle(t,e,i,n,s)}return this._setCommonStyle(t,e,i,n,r)}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,o>1e-12&&a>1e-12&&(s.fillStyle=Wc(this,l,t,i,n))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const n=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(n,t)})),this._setShadowBlendStyle(t,e,n)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:o=i.shadowColor,shadowOffsetX:a=i.shadowOffsetX,shadowOffsetY:l=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:c=i.globalCompositeOperation}=e;r<=1e-12||(s||a||l?(n.shadowBlur=s*this.dpr,n.shadowColor=o,n.shadowOffsetX=a*this.dpr,n.shadowOffsetY=l*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),h?(n.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(n.filter="blur(0px)",this._clearFilterStyle=!1),c?(n.globalCompositeOperation=c,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(n.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setStrokeStyle(t,e,i,n,s)}return this._setStrokeStyle(t,e,i,n,r)}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(s.globalAlpha=o*a*this.baseGlobalAlpha,o>1e-12&&a>1e-12){const{lineWidth:o=r.lineWidth,stroke:a=r.stroke,lineJoin:l=r.lineJoin,lineDash:h=r.lineDash,lineCap:c=r.lineCap,miterLimit:u=r.miterLimit}=e;s.lineWidth=Uc(this,o,this.dpr),s.strokeStyle=Wc(this,a,t,i,n),s.lineJoin=l,h&&s.setLineDash(h),s.lineCap=c,s.miterLimit=u}}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?n.font=t.font:n.font=al(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=al(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>yc.free(t))),this.stack.length=0}};yy.env="browser",yy=gy([g(),vy("design:paramtypes",[Object,Number])],yy);var by=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let wy=class extends t.BaseCanvas{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=pn.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new yy(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:n=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:o}=this;o.width=e*n,o.height=i*n,!o.style||this.setCanvasStyle(o,r,s,e,i),t.id&&(o.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,n,r){this.controled&&(t.style.width=`${n}px`,t.style.height=`${r}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Ay(t,e){return new i((i=>{i(Pn).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(Rn).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}wy.env="browser",wy=by([g(),xy("design:paramtypes",[Object])],wy);const Sy=Ay(wy,yy);var Ty=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Cy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_y=function(t,e){return function(i,n){e(i,n,t)}};let By=class extends t.DefaultPickService{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=ar.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),o=s?t:null,a={graphic:o,params:s};if(o)return a;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}return a}};By=Ty([g(),_y(0,p(E)),_y(0,v(ry)),_y(1,p(Dd)),_y(2,p(E)),_y(2,v(np)),Cy("design:paramtypes",[Object,Object,Object])],By);var Py=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Ry=class{constructor(){this.type="group",this.numberType=ta}contains(t,e,i){return!1}};Ry=Py([g()],Ry);const My=new i(((t,e,i,n)=>{My.__vloaded||(My.__vloaded=!0,t(ny).to(Ry).inSingletonScope(),t(ry).toService(ny),L(t,ry))}));My.__vloaded=!1;var ky=My;const Ey=new i(((t,e,i,n)=>{i(By)||t(By).toSelf().inSingletonScope(),i(Qd)?n(Qd).toService(By):t(Qd).toService(By)}));function Oy(t){t.load(ky),t.load(Ey)}var Ly,Iy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Dy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jy=Ly=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Ly.idprefix}_${Ly.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=pn.global,this.viewBox=new Vt,this.modelMatrix=new $t(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>n)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:Ly.GenerateCanvasId(),canvasControled:!0};this.canvas=new wy(n)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let n=t.width,r=t.height;if(null==n||null==r||!t.canvasControled){const t=i.getBoundingClientRect();n=t.width,r=t.height}let s=t.dpr;null==s&&(s=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/n),this.canvas=new wy({width:n,height:r,dpr:s,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};jy.env="browser",jy.idprefix="visactor_window",jy.prefix_count=0,jy=Ly=Iy([g(),Dy("design:paramtypes",[])],jy);const Uy=new i((t=>{t(jy).toSelf(),t(ur).toDynamicValue((t=>t.container.get(jy))).whenTargetNamed(jy.env)}));var Wy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ny=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Fy{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function zy(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}t.BrowserEnvContribution=class extends t.BaseEnvContribution{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,n;let r=0,s=0,o=0,a=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=e.clientX||0,s=e.clientY||0,o=r,a=s}else r=t.clientX||0,s=t.clientY||0,o=t.offsetX||0,a=t.offsetY||0;if(e){const t=r,i=s,o=e.getBoundingClientRect(),a=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;let l,h;return a&&(l=o.width/a.offsetWidth,h=o.height/a.offsetHeight),{x:(t-o.left)/(ot(l)?l:1),y:(i-o.top)/(ot(h)?h:1)}}return{x:o,y:a}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Fy(t)}return new Vt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:n,style:r}=e;return r&&(it(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=i&&(t.style.width=`${i}px`),null!=n&&(t.style.height=`${n}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,n=document.createElement(e);if(this.updateDom(n,t),i){const t=it(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(n)}return n}loadImage(t){return zy(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return zy(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var i,n;const r=document.createElement("canvas");t.id&&(r.id=null!==(i=t.id)&&void 0!==i?i:e.GenAutoIncrementId().toString());const s=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.width=t.width*s,r.height=t.height*s),r}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let i=t.offsetTop,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,n=n.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetLeft,n=n.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,n=t.offsetLeft,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{top:i,left:n}}},t.BrowserEnvContribution=Wy([g(),Ny("design:paramtypes",[])],t.BrowserEnvContribution);const Gy=new i((e=>{Gy.isBrowserBound||(Gy.isBrowserBound=!0,e(t.BrowserEnvContribution).toSelf().inSingletonScope(),e(U).toService(t.BrowserEnvContribution))}));function Hy(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Hy.__loaded||(Hy.__loaded=!0,t.load(Gy),t.load(Sy),t.load(Uy),e&&Oy(t))}Gy.isBrowserBound=!1,Hy.__loaded=!1;var Vy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Yy=class extends yy{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}getImageData(t,e,i,n){return new Promise(((r,s)=>{var o;try{tt.canvasGetImageData({canvasId:null!==(o=this.canvas.nativeCanvas.id)&&void 0!==o?o:this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}createPattern(t,e){return null}};Yy.env="feishu",Yy=Vy([g()],Yy);var Xy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$y=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let qy=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Yy(this,this._dpr)}release(){}};qy.env="feishu",qy=Xy([g(),$y("design:paramtypes",[Object])],qy);const Ky=Ay(qy,Yy);var Zy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Jy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qy=function(t,e){return function(i,n){e(i,n,t)}};let tb=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new qy(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new qy({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};tb.env="feishu",tb=Zy([g(),Qy(0,p(W)),Jy("design:paramtypes",[Object])],tb);const eb=new i((t=>{t(tb).toSelf(),t(ur).toDynamicValue((t=>t.container.get(tb))).whenTargetNamed(tb.env)}));var ib=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},nb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rb=function(t,e){return function(i,n){e(i,n,t)}};let sb=class extends t.DefaultPickService{constructor(t,e){super(e),this.contributions=t,this.pickItemInterceptorContributions=e,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){this.pickContext=new t.EmptyContext2d(null,1)}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),o=s?t:null;return o?{graphic:o,params:s}:null}};sb=ib([g(),rb(0,p(E)),rb(0,v(Mm)),rb(1,p(E)),rb(1,v(np)),nb("design:paramtypes",[Object,Object])],sb);const ob=new i((t=>{ob.__vloaded||(ob.__vloaded=!0,L(t,Mm))}));ob.__vloaded=!1;var ab=ob,lb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cb=function(t,e){return function(i,n){e(i,n,t)}};let ub=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=qo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};ub=lb([g(),cb(0,p(yd)),hb("design:paramtypes",[Object])],ub);let db=!1;const pb=new i(((t,e,i,n)=>{db||(db=!0,t(km).to(ub).inSingletonScope(),t(Mm).toService(km))}));var fb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vb=function(t,e){return function(i,n){e(i,n,t)}};let mb=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Zo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),n.highPerformanceRestore(),a}};mb=fb([g(),vb(0,p(xd)),gb("design:paramtypes",[Object])],mb);let yb=!1;const bb=new i(((t,e,i,n)=>{yb||(yb=!0,t(Em).to(mb).inSingletonScope(),t(Mm).toService(Em))}));var xb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},wb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ab=function(t,e){return function(i,n){e(i,n,t)}};let Sb=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Jo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Sb=xb([g(),Ab(0,p(wd)),wb("design:paramtypes",[Object])],Sb);let Tb=!1;const Cb=new i(((t,e,i,n)=>{Tb||(Tb=!0,t(Om).to(Sb).inSingletonScope(),t(Mm).toService(Om))}));var _b=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Bb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pb=function(t,e){return function(i,n){e(i,n,t)}};let Rb=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=Qo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,null,i))})),n}return!1}};Rb=_b([g(),Pb(0,p(Od)),Bb("design:paramtypes",[Object])],Rb);let Mb=!1;const kb=new i(((t,e,i,n)=>{Mb||(Mb=!0,t(Fm).to(Rb).inSingletonScope(),t(Rb).toService(Fm))}));var Eb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Ob=class{constructor(){this.type="image",this.numberType=ea}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};Ob=Eb([g()],Ob);let Lb=!1;const Ib=new i(((t,e,i,n)=>{Lb||(Lb=!0,t(Lm).to(Ob).inSingletonScope(),t(Ob).toService(Lm))}));var Db=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},jb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ub=function(t,e){return function(i,n){e(i,n,t)}};let Wb=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=ia}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).line;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Wb=Db([g(),Ub(0,p(Td)),jb("design:paramtypes",[Object])],Wb);let Nb=!1;const Fb=new i(((t,e,i,n)=>{Nb||(Nb=!0,t(Im).to(Wb).inSingletonScope(),t(Mm).toService(Im))}));var zb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Gb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hb=function(t,e){return function(i,n){e(i,n,t)}};let Vb=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=ra}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Vb=zb([g(),Hb(0,p(_d)),Gb("design:paramtypes",[Object])],Vb);let Yb=!1;const Xb=new i(((t,e,i,n)=>{Yb||(Yb=!0,t(Nm).to(Vb).inSingletonScope(),t(Mm).toService(Nm))}));var $b=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kb=function(t,e){return function(i,n){e(i,n,t)}};let Zb=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=na}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).path;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Zb=$b([g(),Kb(0,p(Cd)),qb("design:paramtypes",[Object])],Zb);let Jb=!1;const Qb=new i(((t,e,i,n)=>{Jb||(Jb=!0,t(Dm).to(Zb).inSingletonScope(),t(Mm).toService(Dm))}));var tx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ex=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ix=function(t,e){return function(i,n){e(i,n,t)}};const nx=new Vt;let rx=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=oa}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,l=!1,n.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||st(s,!0)&&0!==s||nt(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,r)=>{if(h)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)h=!0;else if(n){const i=t.AABBBounds;nx.setValue(i.x1,i.y1,i.x2,i.y2),nx.expand(-s/2),h=!nx.containsPoint(e)}}return n.highPerformanceRestore(),h}};rx=tx([g(),ix(0,p(Bd)),ex("design:paramtypes",[Object])],rx);let sx=!1;const ox=new i(((t,e,i,n)=>{sx||(sx=!0,t(jm).to(rx).inSingletonScope(),t(Mm).toService(jm))}));let ax=!1;const lx=new i(((t,e,i,n)=>{ax||(ax=!0,t(Lm).to(Ob).inSingletonScope(),t(Ob).toService(Lm))}));var hx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},cx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ux=function(t,e){return function(i,n){e(i,n,t)}};let dx=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=ha}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).symbol;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};dx=hx([g(),ux(0,p(Rd)),cx("design:paramtypes",[Object])],dx);let px=!1;const fx=new i(((t,e,i,n)=>{px||(px=!0,t(Um).to(dx).inSingletonScope(),t(Mm).toService(Um))}));var gx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let vx=class{constructor(){this.type="text",this.numberType=ca}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};vx=gx([g()],vx);let mx=!1;const yx=new i(((t,e,i,n)=>{mx||(mx=!0,t(Wm).to(vx).inSingletonScope(),t(Mm).toService(Wm))})),bx=new i(((t,e,i,n)=>{i(sb)||t(sb).toSelf().inSingletonScope(),i(Qd)?n(Qd).toService(sb):t(Qd).toService(sb)}));function xx(t){t.load(ab),t.load(bx),t.load(pb),t.load(bb),t.load(Cb),t.load(kb),t.load(Ib),t.load(Fb),t.load(Xb),t.load(Qb),t.load(ox),t.load(lx),t.load(fx),t.load(yx)}class Ax{get width(){return this._w*this.dpr}set width(t){}get height(){return this._h*this.dpr}set height(t){}get offsetWidth(){return this._w}set offsetWidth(t){}get offsetHeight(){return this._h}set offsetHeight(t){}constructor(t,e,i,n,r,s){this.nativeCanvas=t,this.ctx=e,this._w=n,this._h=r,this.id=s,t.id=s,this.dpr=i}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}class Sx{get width(){return this._w*this.dpr}set width(t){this._w=t/this.dpr,this.nativeCanvas.width=t}get height(){return this._h*this.dpr}set height(t){this._h=t/this.dpr,this.nativeCanvas.height=t}get offsetWidth(){return this._w}set offsetWidth(t){this._w=t,this.nativeCanvas.width=t*this.dpr}get offsetHeight(){return this._h}set offsetHeight(t){this._h=t,this.nativeCanvas.height=t*this.dpr}constructor(t,e,i,n,r,s){this.nativeCanvas=t,this.ctx=e,this._w=n,this._h=r,this.id=s,t.id=s,this.dpr=i}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}var Tx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Cx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _x=class extends t.BaseEnvContribution{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s){const o=null!=s?s:tt.getSystemInfoSync().pixelRatio;e.forEach(((e,s)=>{const a=tt.createCanvasContext(e),l=new Ax(a.canvas||{},a,o,t.width,t.height,e);a.canvas=l,i.set(e,l),s>=n&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.pixelRatio))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};_x=Tx([g(),Cx("design:paramtypes",[])],_x);const Bx=new i((t=>{Bx.isFeishuBound||(Bx.isFeishuBound=!0,t(_x).toSelf().inSingletonScope(),t(U).toService(_x))}));function Px(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Px.__loaded||(Px.__loaded=!0,t.load(Bx),t.load(Ky),t.load(eb),e&&xx(t))}Bx.isFeishuBound=!1,Px.__loaded=!1;var Rx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Mx=class extends yy{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,s.lineWidth=Uc(this,l,this.dpr),s.strokeStyle=Wc(this,h,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||u&&s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,pn.global.devicePixelRatio),super.measureText(t,e)}createPattern(t,e){return null}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}};Mx.env="lynx",Mx=Rx([g()],Mx);var kx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ex=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ox=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Mx(this,this._dpr)}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._nativeCanvas.nativeCanvas&&(this._nativeCanvas.nativeCanvas.width=this._pixelWidth,this._nativeCanvas.nativeCanvas.height=this._pixelHeight),this._context.dpr=this._dpr}release(){}};Ox.env="lynx",Ox=kx([g(),Ex("design:paramtypes",[Object])],Ox);var Lx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ix=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dx=function(t,e){return function(i,n){e(i,n,t)}};let jx=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Ox(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Ox({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};jx.env="lynx",jx=Lx([g(),Dx(0,p(W)),Ix("design:paramtypes",[Object])],jx);const Ux=new i((t=>{t(jx).toSelf(),t(ur).toDynamicValue((t=>t.container.get(jx))).whenTargetNamed(jx.env)})),Wx=Ay(Ox,Mx);var Nx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Fx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zx=!1;try{zx=!!lynx.createCanvasNG}catch(t){}let Gx=class extends t.BaseEnvContribution{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s,o){const a=null!=o?o:SystemInfo.pixelRatio;if(e.forEach(((e,o)=>{let l;s?l=lynx.createOffscreenCanvas():(l=zx?lynx.createCanvasNG(e):lynx.createCanvas(e),zx&&l.attachToCanvasView(e)),l.width=t.width*a,l.height=t.height*a;const h=l.getContext("2d"),c=new Sx(l,h,a,t.width,t.height,e);i.set(e,c),o>n&&r.push(c)})),!r.length&&lynx.createOffscreenCanvas){const e=lynx.createOffscreenCanvas();e.width=t.width*a,e.height=t.height*a;const n=e.getContext("2d"),s=Math.random().toString(),o=new Sx(e,n,a,t.width,t.height,s);i.set(s,o),r.push(o)}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,!!e.offscreen,e.pixelRatio))}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}loadImage(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();const e=lynx.createImage(t);return new Promise(((t,i)=>{e.onload=()=>{t(e)},e.onerror=()=>{i(new Error("加载失败"))}}))}(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};Gx=Nx([g(),Fx("design:paramtypes",[])],Gx);const Hx=new i((t=>{Hx.isLynxBound||(Hx.isLynxBound=!0,t(Gx).toSelf().inSingletonScope(),t(U).toService(Gx))}));function Vx(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Vx.__loaded||(Vx.__loaded=!0,t.load(Hx),t.load(Wx),t.load(Ux),e&&xx(t))}Hx.isLynxBound=!1,Vx.__loaded=!1;var Yx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Xx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let $x=class extends yy{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new $t(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};$x.env="node",$x=Yx([g(),Xx("design:paramtypes",[Object,Number])],$x);var qx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Kx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Zx=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new $x(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(){this._nativeCanvas.release&&$(this._nativeCanvas.release)&&this._nativeCanvas.release()}};Zx.env="node",Zx=qx([g(),Kx("design:paramtypes",[Object])],Zx);const Jx=Ay(Zx,$x);var Qx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},tw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ew=function(t,e){return function(i,n){e(i,n,t)}};let iw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Zx(n)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,n=t.height;null!=i&&null!=n&&t.canvasControled||(i=e.width,n=e.height),this.canvas=new Zx({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};iw.env="node",iw=Qx([g(),ew(0,p(W)),tw("design:paramtypes",[Object])],iw);const nw=new i((t=>{t(iw).toSelf(),t(ur).toDynamicValue((t=>t.container.get(iw))).whenTargetNamed(iw.env)}));var rw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let sw=class extends t.BaseEnvContribution{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};sw=rw([g()],sw);const ow=new i((t=>{ow.isNodeBound||(ow.isNodeBound=!0,t(sw).toSelf().inSingletonScope(),t(U).toService(sw))}));function aw(t){aw.__loaded||(aw.__loaded=!0,t.load(ow),t.load(Jx),t.load(nw))}ow.isNodeBound=!1,aw.__loaded=!1;var lw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let hw=class extends yy{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,i){}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;o>1e-12&&a>1e-12&&(s.setGlobalAlpha(o*a),s.setFillStyle(Wc(this,l,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(Uc(this,l,this.dpr)),s.setStrokeStyle(Wc(this,h,t,i,n)),s.setLineJoin(c),u&&s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){var i;const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=al(t,e),n.setFontSize(null!==(i=t.fontSize)&&void 0!==i?i:e.fontSize)}setTextStyle(t,e){var i,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=al(t,e),r.setTextAlign(null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign),r.setTextBaseline(null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}getImageData(t,e,i,n){const r=this.nativeContext,s=r.taro;if(r&&s)return!r.getImageData&&s.canvasGetImageData?new Promise(((r,o)=>{try{s.canvasGetImageData({canvasId:this.canvas.nativeCanvas.id,sx:t,sy:e,sw:i,sh:n,success(t){r(t)}})}catch(t){o(t)}})):void 0}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createCircularGradient&&this.nativeContext.createCircularGradient(t,e,i,n,r,s)}};hw.env="taro",hw=lw([g()],hw);var cw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},uw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let dw=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new hw(this,this._dpr)}release(){}};dw.env="taro",dw=cw([g(),uw("design:paramtypes",[Object])],dw);const pw=Ay(dw,hw);var fw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vw=function(t,e){return function(i,n){e(i,n,t)}};let mw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new dw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new dw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,i)=>{t.changedTouches[i]=Object.assign(Object.assign({},t.changedTouches[i]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,i)=>{t.touches[i]=Object.assign(Object.assign({},t.touches[i]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};mw.env="taro",mw=fw([g(),vw(0,p(W)),gw("design:paramtypes",[Object])],mw);const yw=new i((t=>{t(mw).toSelf(),t(ur).toDynamicValue((t=>t.container.get(mw))).whenTargetNamed(mw.env)}));var bw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ww=class extends t.BaseEnvContribution{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}configure(t,e){var i,n,r,s,o,a,l;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,o=this.freeCanvasList,a=e.taro,l=e.pixelRatio,n.forEach(((t,e)=>{const n=a.createCanvasContext(t),h=new Ax(n.canvas||{},n,l,i.width,i.height,t);return n.canvas=h,r.set(t,h),e>=s&&o.push(h),h})),this.taro=e.taro,this.pixelRatio=e.pixelRatio)}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const i=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],n=(new XMLSerializer).serializeToString(i),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const i=new e.Blob([t],{type:"image/svg+xml"}),n=e.URL.createObjectURL(i);return Promise.resolve({data:n,loadState:"success"})}return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return this.pixelRatio}getRequestAnimationFrame(){return requestAnimationFrame}getCancelAnimationFrame(){return cancelAnimationFrame}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};ww=bw([g(),xw("design:paramtypes",[])],ww);const Aw=new i((t=>{Aw.isTaroBound||(Aw.isTaroBound=!0,t(ww).toSelf().inSingletonScope(),t(U).toService(ww))}));function Sw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Sw.__loaded||(Sw.__loaded=!0,t.load(Aw),t.load(pw),t.load(yw),e&&xx(t))}Aw.isTaroBound=!1,Sw.__loaded=!1;var Tw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Cw=class extends yy{draw(){}createPattern(t,e){return null}};Cw.env="wx",Cw=Tw([g()],Cw);var _w=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Bw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Pw=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Cw(this,this._dpr)}release(){}};Pw.env="wx",Pw=_w([g(),Bw("design:paramtypes",[Object])],Pw);const Rw=Ay(Pw,Cw);var Mw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},kw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ew=function(t,e){return function(i,n){e(i,n,t)}};let Ow=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Pw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Pw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){var e,i,n,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(i=t.changedTouches[0].x)&&void 0!==i?i:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(n=t.changedTouches[0].y)&&void 0!==n?n:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};Ow.env="wx",Ow=Mw([g(),Ew(0,p(W)),kw("design:paramtypes",[Object])],Ow);const Lw=new i((t=>{t(Ow).toSelf(),t(ur).toDynamicValue((t=>t.container.get(Ow))).whenTargetNamed(Ow.env)}));var Iw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Dw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jw=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};let Uw=class extends t.BaseEnvContribution{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r,s){return jw(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let l=wx.createSelectorQuery();s&&(l=l.in(s)),l.select(`#${a}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const l=s[0].node,h=s[0].width,c=s[0].height;l.width=h*t,l.height=c*t,i.set(a,l),o>=n&&r.push(l),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return wx.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};Uw=Iw([g(),Dw("design:paramtypes",[])],Uw);const Ww=new i((t=>{Ww._isWxBound||(Ww._isWxBound=!0,t(Uw).toSelf().inSingletonScope(),t(U).toService(Uw))}));function Nw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Nw.__loaded||(Nw.__loaded=!0,t.load(Ww),t.load(Rw),t.load(Lw),e&&xx(t))}function Fw(t){zw(t)}function zw(t){zw.__loaded||(zw.__loaded=!0,Hy(t,!1),Px(t,!1),Vx(t,!1),aw(t),Sw(t,!1),Nw(t,!1),Oy(t),Vp.hooks.onSetEnv.tap("loadMathPicker",((e,i)=>{"browser"!==i&&xx(t)})))}Ww._isWxBound=!1,Nw.__loaded=!1,zw.__loaded=!1;var Gw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Hw=class extends Yy{};Hw.env="tt",Hw=Gw([g()],Hw);var Vw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Yw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Xw=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Hw(this,this._dpr)}release(){}};Xw.env="tt",Xw=Vw([g(),Yw("design:paramtypes",[Object])],Xw);const $w=Ay(Xw,Hw);var qw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Kw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zw=function(t,e){return function(i,n){e(i,n,t)}};let Jw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="tt",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Xw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Xw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};Jw.env="tt",Jw=qw([g(),Zw(0,p(W)),Kw("design:paramtypes",[Object])],Jw);const Qw=new i((t=>{t(Jw).toSelf(),t(ur).toDynamicValue((t=>t.container.get(Jw))).whenTargetNamed(Jw.env)}));var tA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},eA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iA=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};let nA=class extends t.BaseEnvContribution{constructor(){super(),this.type="tt",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r,s){return iA(this,void 0,void 0,(function*(){const t=tt.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let l=tt.createSelectorQuery();s&&(l=l.in(s)),l.select(`#${a}`).node().exec((s=>{const l=s[0].node,h=l.width,c=l.height;l.width=h*t,l.height=c*t,i.set(a,l),o>=n&&r.push(l),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return gs.call(t)}}getCancelAnimationFrame(){return t=>{gs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};nA=tA([g(),eA("design:paramtypes",[])],nA);const rA=new i((t=>{rA.isTTBound||(rA.isTTBound=!0,t(nA).toSelf().inSingletonScope(),t(U).toService(nA))}));function sA(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];sA.__loaded||(sA.__loaded=!0,t.load(rA),t.load($w),t.load(Qw),e&&xx(t))}rA.isTTBound=!1,sA.__loaded=!1;var oA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let aA=class extends yy{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,s.lineWidth=Uc(this,l,this.dpr),s.strokeStyle=Wc(this,h,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||u&&s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,pn.global.devicePixelRatio),super.measureText(t,e)}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;let s="";s=t.font?t.font:al(t,e,r&&this.camera&&this.camera.getProjectionScale(i)),n.font=(s||"").replace("px","vp");const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes);let o="";o=t.font?t.font:al(t,e,this.camera&&this.camera.getProjectionScale(i)),s.font=(o||"").replace("px","vp");const{fontFamily:a=e.fontFamily,fontSize:l=e.fontSize}=t;this.fontFamily=a,this.fontSize=l,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}createPattern(t,e){return null}drawImage(){const t=this.nativeContext,e=arguments;e[0].drawImage&&(e[0]=e[0].transferToImageBitmap()),3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}draw(){}};aA.env="harmony",aA=oA([g()],aA);var lA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let cA=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new aA(this,this._dpr)}resize(t,e){}release(){}};cA.env="harmony",cA=lA([g(),hA("design:paramtypes",[Object])],cA);var uA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},dA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pA=function(t,e){return function(i,n){e(i,n,t)}};class fA{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}let gA=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="harmony",this.eventManager=new fA}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new cA(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}this.canvas=new cA({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};gA.env="harmony",gA=uA([g(),pA(0,p(W)),dA("design:paramtypes",[Object])],gA);const vA=new i((t=>{t(gA).toSelf(),t(ur).toDynamicValue((t=>t.container.get(gA))).whenTargetNamed(gA.env)})),mA=Ay(cA,aA);var yA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},bA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let xA=class extends t.BaseEnvContribution{constructor(){super(),this.type="harmony",this.supportEvent=!0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0,this.rafSTO=new fs(0)}configure(t,e){t.env===this.type&&t.setActiveEnvContribution(this)}getDynamicCanvasCount(){return 9999}getStaticCanvasCount(){return 9999}loadImage(t){}loadSvg(t){return Promise.reject()}createCanvas(t){return function(t,e,i){const n=new OffscreenCanvas(t,e),r=n.getContext("2d");return new Ax({width:t,height:e,context:r,_c:n,getBoundingClientRect:()=>({width:t,height:e}),getContext:()=>r},r,1,t,e,i)}(t.width,t.height,t.id)}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return t=>this.rafSTO.call(t)}getCancelAnimationFrame(){return t=>{this.rafSTO.clear(t)}}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return null}getRootElement(){return null}getDocument(){return null}release(){}};xA=yA([g(),bA("design:paramtypes",[])],xA);const wA=new i((t=>{wA.isHarmonyBound||(wA.isHarmonyBound=!0,t(xA).toSelf().inSingletonScope(),t(U).toService(xA))}));function AA(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];AA.__loaded||(AA.__loaded=!0,t.load(wA),t.load(mA),t.load(vA),e&&xx(t))}wA.isHarmonyBound=!1,AA.__loaded=!1;var SA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},TA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},CA=function(t,e){return function(i,n){e(i,n,t)}};let _A=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=qo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};_A=SA([g(),CA(0,p(yd)),TA("design:paramtypes",[Object])],_A);let BA=!1;const PA=new i(((t,e,i,n)=>{BA||(BA=!0,t(zm).to(_A).inSingletonScope(),t(ry).toService(zm))}));var RA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},MA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kA=function(t,e){return function(i,n){e(i,n,t)}};const EA=new Vt;let OA=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=oa}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,l=!1,n.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||st(s,!0)&&0!==s||nt(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,r)=>{if(h)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)h=!0;else if(n){const i=t.AABBBounds;EA.setValue(i.x1,i.y1,i.x2,i.y2),EA.expand(-s/2),h=!EA.containsPoint(e)}}return n.highPerformanceRestore(),h}};OA=RA([g(),kA(0,p(Bd)),MA("design:paramtypes",[Object])],OA);let LA=!1;const IA=new i(((t,e,i,n)=>{LA||(LA=!0,t(qm).to(OA).inSingletonScope(),t(ry).toService(qm))}));var DA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let jA=class extends Ic{};jA=DA([g()],jA);var UA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},WA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},NA=function(t,e){return function(i,n){e(i,n,t)}};let FA=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=ia}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const r=Tr(t).line,s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Uc(n,r+s,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};FA=UA([g(),NA(0,p(Td)),WA("design:paramtypes",[Object])],FA);let zA=!1;const GA=new i(((t,e,i,n)=>{zA||(zA=!0,t(Xm).to(FA).inSingletonScope(),t(ry).toService(Xm))}));var HA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},VA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},YA=function(t,e){return function(i,n){e(i,n,t)}};let XA=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Zo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;const{fillPickable:a=r.fillPickable,strokePickable:l=r.strokePickable}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let h=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!h||!!a&&(h=t.isPointInPath(e.x,e.y),h)),((t,i,r)=>{if(h)return!0;if(!l)return!1;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),h=t.isPointInStroke(e.x,e.y),h})),n.highPerformanceRestore(),h}};XA=HA([g(),YA(0,p(xd)),VA("design:paramtypes",[Object])],XA);let $A=!1;const qA=new i(((t,e,i,n)=>{$A||($A=!0,t(Hm).to(XA).inSingletonScope(),t(ry).toService(Hm))}));var KA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ZA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},JA=function(t,e){return function(i,n){e(i,n,t)}};let QA=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ha}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const s=Tr(t).symbol,o=this.transform(t,s,n),{x:a,y:l,z:h,lastModelMatrix:c}=o;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,a,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Uc(n,r+s,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&bc.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};QA=KA([g(),JA(0,p(Rd)),ZA("design:paramtypes",[Object])],QA);let tS=!1;const eS=new i(((t,e,i,n)=>{tS||(tS=!0,t(Zm).to(QA).inSingletonScope(),t(ry).toService(Zm))}));var iS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},nS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rS=function(t,e){return function(i,n){e(i,n,t)}};let sS=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Jo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};sS=iS([g(),rS(0,p(wd)),nS("design:paramtypes",[Object])],sS);let oS=!1;const aS=new i(((t,e,i,n)=>{oS||(oS=!0,t(Vm).to(sS).inSingletonScope(),t(ry).toService(Vm))}));var lS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cS=function(t,e){return function(i,n){e(i,n,t)}};let uS=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=ca}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=Tr(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,l=this.transform(t,s,n,a),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,h,c,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:o=s.textBaseline,textAlign:a=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),v=cl(o,d,r),m=hl(a,g);return e.rect(m+h,v+c,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&bc.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};uS=lS([g(),cS(0,p(Md)),hS("design:paramtypes",[Object])],uS);let dS=!1;const pS=new i(((t,e,i,n)=>{dS||(dS=!0,t(Jm).to(uS).inSingletonScope(),t(ry).toService(Jm))}));var fS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vS=function(t,e){return function(i,n){e(i,n,t)}};let mS=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=na}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).path;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Uc(n,r+s,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};mS=fS([g(),vS(0,p(Cd)),gS("design:paramtypes",[Object])],mS);let yS=!1;const bS=new i(((t,e,i,n)=>{yS||(yS=!0,t($m).to(mS).inSingletonScope(),t(ry).toService($m))}));var xS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},wS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},AS=function(t,e){return function(i,n){e(i,n,t)}};let SS=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=ra}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Uc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};SS=xS([g(),AS(0,p(_d)),wS("design:paramtypes",[Object])],SS);let TS=!1;const CS=new i(((t,e,i,n)=>{TS||(TS=!0,t(Qm).to(SS).inSingletonScope(),t(ry).toService(Qm))}));var _S=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},BS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},PS=function(t,e){return function(i,n){e(i,n,t)}};let RS=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=Qo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{if(n)return;const s=r.pickItem(t,e,null,i);n=!(!s||!s.graphic)})),n}return!1}};RS=_S([g(),PS(0,p(Od)),BS("design:paramtypes",[Object])],RS);let MS=!1;const kS=new i(((t,e,i,n)=>{MS||(MS=!0,t(iy).to(RS).inSingletonScope(),t(ry).toService(iy))}));var ES=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},OS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},LS=function(t,e){return function(i,n){e(i,n,t)}};let IS=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=la}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};IS=ES([g(),LS(0,p(kd)),OS("design:paramtypes",[Object])],IS);let DS=!1;const jS=new i(((t,e,i,n)=>{DS||(DS=!0,t(ey).to(IS).inSingletonScope(),t(ry).toService(ey))}));var US=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let WS=class{constructor(){this.type="image",this.numberType=ea}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};WS=US([g()],WS);let NS=!1;const FS=new i(((t,e,i,n)=>{NS||(NS=!0,t(Ym).to(WS).inSingletonScope(),t(ry).toService(Ym))}));var zS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},GS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},HS=function(t,e){return function(i,n){e(i,n,t)}};new Vt;let VS=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=aa}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).rect;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};VS=zS([g(),HS(0,p(Pd)),GS("design:paramtypes",[Object])],VS);let YS=!1;const XS=new i(((t,e,i,n)=>{YS||(YS=!0,t(Km).to(VS).inSingletonScope(),t(ry).toService(Km))}));var $S=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},qS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},KS=function(t,e){return function(i,n){e(i,n,t)}};let ZS=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Ko}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).arc;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};ZS=$S([g(),KS(0,p(bd)),qS("design:paramtypes",[Object])],ZS);let JS=!1;const QS=new i(((t,e,i,n)=>{JS||(JS=!0,t(Gm).to(ZS).inSingletonScope(),t(ry).toService(Gm))}));var tT=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},eT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iT=function(t,e){return function(i,n){e(i,n,t)}};let nT=class extends jA{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=sa}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Tr(t).polygon;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==h&&bc.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}};nT=tT([g(),iT(0,p(Ed)),eT("design:paramtypes",[Object])],nT);let rT=!1;const sT=new i(((t,e,i,n)=>{rT||(rT=!0,t(ty).to(nT).inSingletonScope(),t(ry).toService(ty))})),oT=ff();function aT(){aT.__loaded||(aT.__loaded=!0,Yg(),Bn.load(og),Bn.load(oT?PA:pb))}aT.__loaded=!1;const lT=aT;function hT(){hT.__loaded||(hT.__loaded=!0,Xg(),Bn.load(Fg),Bn.load(QS))}hT.__loaded=!1;const cT=hT;function uT(){uT.__loaded||(uT.__loaded=!0,$g(),Bn.load(dg),Bn.load(oT?qA:bb))}uT.__loaded=!1;const dT=uT;function pT(){pT.__loaded||(pT.__loaded=!0,qg(),Bn.load(vg),Bn.load(oT?aS:Cb))}pT.__loaded=!1;const fT=pT;function gT(){gT.__loaded||(gT.__loaded=!0,Kg(),Bn.load(_g),Bn.load(oT?kS:kb))}gT.__loaded=!1;const vT=gT;function mT(){mT.__loaded||(mT.__loaded=!0,Zg())}mT.__loaded=!1;const yT=mT;function bT(){bT.__loaded||(bT.__loaded=!0,Jg(),Bn.load(Og),Bn.load(oT?FS:Ib))}bT.__loaded=!1;const xT=bT;function wT(){wT.__loaded||(wT.__loaded=!0,Qg(),Bn.load(cg),Bn.load(oT?GA:Fb))}wT.__loaded=!1;const AT=wT;function ST(){ST.__loaded||(ST.__loaded=!0,tv(),Bn.load(xg),Bn.load(oT?bS:Qb))}ST.__loaded=!1;const TT=ST;function CT(){CT.__loaded||(CT.__loaded=!0,ev(),Bn.load(Ag),Bn.load(oT?CS:Xb))}CT.__loaded=!1;const _T=CT;function BT(){BT.__loaded||(BT.__loaded=!0,iv(),Bn.load(Vg),Bn.load(sT))}BT.__loaded=!1;const PT=BT;function RT(){RT.__loaded||(RT.__loaded=!0,nv(),Bn.load(lg),Bn.load(oT?IA:ox))}RT.__loaded=!1;const MT=RT;function kT(){kT.__loaded||(kT.__loaded=!0,rv(),Bn.load(jg),Bn.load(XS))}kT.__loaded=!1;const ET=kT;function OT(){OT.__loaded||(OT.__loaded=!0,sv(),Bn.load(kg),Bn.load(oT?jS:lx))}OT.__loaded=!1;const LT=OT;function IT(){IT.__loaded||(IT.__loaded=!0,lv())}IT.__loaded=!1;const DT=IT;function jT(){jT.__loaded||(jT.__loaded=!0,ov(),Bn.load(fg),Bn.load(oT?eS:fx))}jT.__loaded=!1;const UT=jT;function WT(){WT.__loaded||(WT.__loaded=!0,av(),Bn.load(yg),Bn.load(oT?pS:yx))}WT.__loaded=!1;const NT=WT;function FT(){FT.__loaded||(FT.__loaded=!0,hv())}FT.__loaded=!1;const zT=FT,GT=Rm;Hp(),ff()?Hy(Bn):gf()&&aw(Bn),lT(),cT(),dT(),fT(),vT(),yT(),xT(),AT(),TT(),_T(),PT(),MT(),ET(),LT(),DT(),UT(),NT(),zT(),t.ACustomAnimate=Xr,t.ARC3D_NUMBER_TYPE=Ko,t.ARC_NUMBER_TYPE=qo,t.AREA_NUMBER_TYPE=Zo,t.Animate=qr,t.AnimateGroup=class extends Xr{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Hr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Xr{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Hr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Application=dn,t.Arc=tc,t.Arc3d=ic,t.Arc3dRender=bd,t.ArcRender=yd,t.ArcRenderContribution=Ya,t.Area=Zh,t.AreaRender=xd,t.AreaRenderContribution=Xa,t.AttributeAnimate=class extends Xr{constructor(t,e,i){super({},t,e,i)}getEndProps(){return this.to}onBind(){Object.keys(this.to).forEach((t=>{this.from[t]=this.target.getComputedAttribute(t)}))}onEnd(){}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this.to,this.from)}},t.AutoEnablePlugins=op,t.BaseRender=Ic,t.Basis=di,t.BeforeRenderConstribution=Kd,t.BoundsContext=Se,t.BoundsPicker=tp,t.CIRCLE_NUMBER_TYPE=Jo,t.Canvas3DDrawItemInterceptor=Vd,t.CanvasArc3dPicker=Gm,t.CanvasArcPicker=zm,t.CanvasAreaPicker=Hm,t.CanvasCirclePicker=Vm,t.CanvasFactory=Pn,t.CanvasGlyphPicker=iy,t.CanvasGroupPicker=ny,t.CanvasImagePicker=Ym,t.CanvasLinePicker=Xm,t.CanvasPathPicker=$m,t.CanvasPickerContribution=ry,t.CanvasPolygonPicker=Qm,t.CanvasPyramid3dPicker=ty,t.CanvasRect3dPicker=Km,t.CanvasRectPicker=qm,t.CanvasRichTextPicker=ey,t.CanvasSymbolPicker=Zm,t.CanvasTextLayout=dl,t.CanvasTextPicker=Jm,t.CbAnimate=$r,t.Circle=sl,t.CircleRender=wd,t.CircleRenderContribution=$a,t.ClipAngleAnimate=class extends ys{constructor(t,e,i,n,r){var s,o,a,l,h,c,u,d,p,f,g,v;const m=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},y=null!==(a=m.width)&&void 0!==a?a:0,b=null!==(l=m.height)&&void 0!==l?l:0,x=null!==(h=null==r?void 0:r.animationType)&&void 0!==h?h:"in",w=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,A=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let S=0,T=0;"anticlockwise"===A?(T="in"===x?w+2*Math.PI:w,T=w+2*Math.PI):(S=w,T="out"===x?w+2*Math.PI:w);const C=pn.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:b/2,outerRadius:null!==(v=null==r?void 0:r.radius)&&void 0!==v?v:(y+b)/2,innerRadius:0,startAngle:S,endAngle:T,fill:!0});let _,B;"anticlockwise"===A?(_={startAngle:w+2*Math.PI},B={startAngle:w}):(_={endAngle:w},B={endAngle:w+2*Math.PI}),super("in"===x?_:B,"in"===x?B:_,i,n,{group:null==r?void 0:r.group,clipGraphic:C})}},t.ClipDirectionAnimate=class extends ys{constructor(t,e,i,n,r){var s,o,a,l,h,c,u,d,p;const f=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},g=null!==(l=null!==(a=null==r?void 0:r.width)&&void 0!==a?a:f.width)&&void 0!==l?l:0,v=null!==(c=null!==(h=null==r?void 0:r.height)&&void 0!==h?h:f.height)&&void 0!==c?c:0,m=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",y=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",b=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=pn.graphicService.creator.rect({x:0,y:0,width:"in"===m&&"x"===y?0:g,height:"in"===m&&"y"===y?0:v,fill:!0});let w={},A={};"y"===y?"negative"===b?(w={y:v,height:0},A={y:0,height:v}):(w={height:0},A={height:v}):"negative"===b?(w={x:g,width:0},A={x:0,width:g}):(w={width:0},A={width:g}),super("in"===m?w:A,"in"===m?A:w,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=ys,t.ClipRadiusAnimate=class extends ys{constructor(t,e,i,n,r){var s,o,a,l,h,c,u,d,p,f,g;const v=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},m=null!==(a=v.width)&&void 0!==a?a:0,y=null!==(l=v.height)&&void 0!==l?l:0,b=null!==(h=null==r?void 0:r.animationType)&&void 0!==h?h:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,w=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((m/2)**2+(y/2)**2),A=pn.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:m/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:y/2,outerRadius:"out"===b?w:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),S={outerRadius:x},T={outerRadius:w};super("in"===b?S:T,"in"===b?T:S,i,n,{group:null==r?void 0:r.group,clipGraphic:A})}},t.ColorInterpolate=za,t.ColorStore=Ys,t.CommonRenderContribution=il,t.Container=k,t.ContainerModule=i,t.Context2dFactory=Rn,t.ContributionProvider=E,t.CurveContext=class{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new ni(new Ft(this._lastX,this._lastY),new Ft(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new ei(new Ft(this._lastX,this._lastY),new Ft(t,e),new Ft(i,n),new Ft(r,s));this.path.curves.push(o),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,o,a){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}},t.CustomEvent=Er,t.CustomPath2D=Di,t.CustomSymbolClass=mh,t.DebugDrawItemInterceptorContribution=Gd,t.DefaultArcAllocate=Gf,t.DefaultArcAttribute=Ki,t.DefaultArcRenderContribution=Xc,t.DefaultAreaAllocate=Vf,t.DefaultAreaAttribute=Zi,t.DefaultAreaTextureRenderContribution=yu,t.DefaultAttribute=qi,t.DefaultBaseBackgroundRenderContribution=Gc,t.DefaultBaseTextureRenderContribution=Vc,t.DefaultCanvasAllocate=or,t.DefaultCircleAllocate=Xf,t.DefaultCircleAttribute=Ji,t.DefaultCircleRenderContribution=Zc,t.DefaultConnectAttribute=Xi,t.DefaultDebugAttribute=$i,t.DefaultFillStyle=Fi,t.DefaultGlyphAttribute=tn,t.DefaultGraphicAllocate=Nf,t.DefaultGraphicMemoryManager=ng,t.DefaultGroupAttribute=Qi,t.DefaultGroupBackgroundRenderContribution=eu,t.DefaultImageAttribute=cn,t.DefaultImageBackgroundRenderContribution=cu,t.DefaultImageRenderContribution=uu,t.DefaultLayout=Wi,t.DefaultLineAllocate=qf,t.DefaultLineAttribute=en,t.DefaultMat4Allocate=mc,t.DefaultMatrixAllocate=vc,t.DefaultMorphingAnimateConfig=Qr,t.DefaultPathAllocate=Zf,t.DefaultPathAttribute=nn,t.DefaultPickStyle=Vi,t.DefaultPolygonAttribute=rn,t.DefaultRect3dAttribute=on,t.DefaultRectAllocate=Ff,t.DefaultRectAttribute=sn,t.DefaultRectRenderContribution=ou,t.DefaultRichTextAttribute=hn,t.DefaultRichTextIconAttribute=un,t.DefaultStateAnimateConfig=Jr,t.DefaultStrokeStyle=Gi,t.DefaultStyle=Yi,t.DefaultSymbolAllocate=Qf,t.DefaultSymbolAttribute=an,t.DefaultSymbolRenderContribution=fu,t.DefaultTextAllocate=eg,t.DefaultTextAttribute=ln,t.DefaultTextStyle=Hi,t.DefaultTicker=Gr,t.DefaultTimeline=Vr,t.DefaultTransform=Ni,t.DragNDrop=class{constructor(t){this.onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function o(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!n){e.attribute.pickable=!1;const n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.attribute.pickable=!0,r!==n&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),r=n,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",o);const a=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",o)};e.addEventListener("pointerup",a,{once:!0}),e.addEventListener("pointerupoutside",a,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=Dd,t.DrawItemInterceptor=Wd,t.DynamicLayerHandlerContribution=Ca,t.EnvContribution=U,t.EventManager=Ir,t.EventSystem=Ur,t.EventTarget=Dr,t.FORMAT_ELEMENT_COMMAND="FORMAT_ELEMENT_COMMAND",t.FORMAT_TEXT_COMMAND=Wf,t.FadeInPlus=class extends Xr{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=ms.LEFT_TO_RIGHT,fill:o=!0,stroke:a=!0}=r||{};this.direction=s,this.fill=o,this.stroke=a,this.fillGradient={gradient:"linear",stops:[]},this.strokeGradient={gradient:"linear",stops:[]}}getEndProps(){return{fill:this.toFill,stroke:this.toStroke}}onBind(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}onEnd(){}onUpdate(t,e,i){if(this.toFill&&this.toStroke)switch(this.direction){case ms.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case ms.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case ms.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case ms.STROKE:this.strokePath(t,e,i);break;default:this.leftToRight(t,e,i)}}leftToRight(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,6*e),color:"transparent"}],i.stroke=this.strokeGradient}}strokePath(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=300,n=e*t;i.lineDash=[n,t-n]}}rightToLeft(t,e,i){}topToBottom(t,e,i){}bottomToTop(t,e,i){}},t.FederatedEvent=Pr,t.FederatedMouseEvent=Rr,t.FederatedPointerEvent=Mr,t.FederatedWheelEvent=kr,t.Fragment=cy,t.GLYPH_NUMBER_TYPE=Qo,t.GRAPHIC_UPDATE_TAG_KEY=xo,t.GROUP_NUMBER_TYPE=ta,t.Generator=e,t.Gesture=class extends V{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,n,r,s,o,a,l,h,c,u;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.reset(),this.startTime=Or.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:n,y:r}=e[t],s={x:n,y:r};i[t]=s}if(1!==i.length)this.startDistance=fy(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,n=0,r=0;for(;r<e;)i+=t[r].x,n+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(n/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:o}=n;for(let t=0,e=i.length;t<e;t++)if(o===i[t].pointerId){i[t]=n;break}const a={x:r,y:s},l=i.map((t=>({x:t.x,y:t.y}))),h=Or.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=a,1===e.length){const t=e[0],i=r-t.x,o=s-t.y,h=this.direction||py(t,a);this.direction=h;const c=this.getEventType(a);return n.direction=h,n.deltaX=i,n.deltaY=o,n.points=l,this.triggerStartEvent(c,n),void this.triggerEvent(c,n)}const{startDistance:c}=this,u=fy(l[0],l[1]);n.scale=u/c,n.center=this.center,n.points=l,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const i=Or.now(),r=this.lastMoveTime;if(i-r<100){const t=r-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=fy(i,r),o=s/t;o>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=o,e.direction=py(i,r),this.triggerEvent("swipe",e))}}i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0)}for(let t=0,r=i.length;t<r;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),n.splice(t,1);break}this.reset(),i.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(n=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==n?n:251,threshold:null!==(s=null===(r=null==e?void 0:e.press)||void 0===r?void 0:r.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(a=null===(o=null==e?void 0:e.swipe)||void 0===o?void 0:o.threshold)&&void 0!==a?a:10,velocity:null!==(h=null===(l=null==e?void 0:e.swipe)||void 0===l?void 0:l.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(u=null===(c=null==e?void 0:e.tap)||void 0===c?void 0:c.interval)&&void 0!==u?u:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if(e)return e;let r;return r=Or.now()-i>this.config.press.time&&fy(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,n={type:t,ev:e};for(let e=0,r=i.length;e<r;e++)if(i[e].type===t)return void i.splice(e,1,n);i.push(n)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:n}=this;i||(this.throttleTimer=pn.global.getRequestAnimationFrame()((()=>{for(let t=0,e=n.length;t<e;t++){const{type:e,ev:i}=n[t];this.emitEvent(e,i)}this.throttleTimer=0,this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}},t.GlobalPickerService=ep,t.Glyph=Lh,t.GlyphRender=Od,t.Graphic=_o,t.GraphicAnimate=class extends Xr{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0:r.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=da,t.GraphicPicker=Jd,t.GraphicRender=Ad,t.GraphicService=ua,t.GraphicUtil=Aa,t.Group=ya,t.GroupFadeIn=class extends Xr{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends Xr{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupRender=Sd,t.GroupRenderContribution=qa,t.HtmlAttributePlugin=Qp,t.IMAGE_NUMBER_TYPE=ea,t.Image=Wh,t.ImageRender=Ld,t.ImageRenderContribution=Ka,t.IncreaseCount=class extends Xr{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n,r,s,o,a;this.fromNumber=st(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=st(null===(n=this.to)||void 0===n?void 0:n.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(a=null===(o=this.params)||void 0===o?void 0:o.fixed)&&void 0!==a?a:Math.max(Nt(this.fromNumber),Nt(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}},t.IncrementalDrawContribution=md,t.InputText=class extends Xr{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(n=null===(i=this.to)||void 0===i?void 0:i.text)&&void 0!==n?n:"",!this.toText||nt(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=pn.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,o=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,o);const a=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),l=this.target.clipedWidth+2;a.setAttribute("x",l)}},t.InteractiveDrawItemInterceptorContribution=Hd,t.InteractiveSubRenderContribution=nl,t.LINE_NUMBER_TYPE=ia,t.Layer=xa,t.LayerService=Sa,t.Line=_h,t.LineRender=Td,t.Linear=li,t.LinearClosed=Pi,t.ManualTickHandler=Wr,t.ManualTicker=class extends Gr{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Wr;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}tickAt(t){this.tickerHandler.tick(t-this.lastFrameTime,(t=>{this.handleTick(t,{once:!0})}))}ifCanStop(){return!1}},t.Mat4Allocate=fc,t.MathArcPicker=km,t.MathAreaPicker=Em,t.MathCirclePicker=Om,t.MathGlyphPicker=Fm,t.MathImagePicker=Lm,t.MathLinePicker=Im,t.MathPathPicker=Dm,t.MathPickerContribution=Mm,t.MathPolygonPicker=Nm,t.MathRectPicker=jm,t.MathSymbolPicker=Um,t.MathTextPicker=Wm,t.MatrixAllocate=pc,t.Meteor=class extends Xr{get lastPos(){return this.posList[this.posList.length-1]}constructor(t,e,i,n){super(null,null,e,i,n),this.size=t,this.posList=[]}onBind(){const e=this.target.attachShadow();this.root=e;for(let i=0;i<this.size;i++){const n=this.target.clone(),r=Math.min((this.size-i)/this.size*3,1),s=Math.min(.2+.7/this.size);n.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:s},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(n)}}onUpdate(t,e,i){if(t)return this.target.detachShadow(),void(this.posList.length=0);const n=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),s=new Ft(n,r);this.posList.length?(this.target.shadowRoot.forEachChildren(((t,e)=>{const i=this.posList[Math.max(this.posList.length-e-1,0)];t.setAttributes({x:i.x-n,y:i.y-r},!1)})),this.posList.push(s)):this.posList.push(s)}},t.MonotoneX=bi,t.MonotoneY=xi,t.MorphingPath=lo,t.MotionPath=class extends Xr{constructor(t,e,i,n,r){var s;super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=null!==(s=r.initAngle)&&void 0!==s?s:0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=co,t.NOWORK_ANIMATE_ATTR=Co,t.Node=Br,t.PATH_NUMBER_TYPE=na,t.POLYGON_NUMBER_TYPE=ra,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=sa,t.Path=$h,t.PathRender=Cd,t.PathRenderContribution=Za,t.PickItemInterceptor=np,t.PickerService=Qd,t.PluginService=ap,t.Polygon=sc,t.PolygonRender=_d,t.PolygonRenderContribution=Ja,t.Pyramid3d=ac,t.Pyramid3dRender=Ed,t.RAFTickHandler=Fr,t.REACT_TO_CANOPUS_EVENTS=sy,t.REACT_TO_CANOPUS_EVENTS_LIST=oy,t.RECT3D_NUMBER_TYPE=aa,t.RECT_NUMBER_TYPE=oa,t.RICHTEXT_NUMBER_TYPE=la,t.RafBasedSTO=fs,t.ReactAttributePlugin=vf,t.Rect=Rh,t.Rect3DRender=Pd,t.Rect3d=Eh,t.RectRender=Bd,t.RectRenderContribution=Qa,t.ReflectSegContext=si,t.RenderSelector=Id,t.RenderService=qd,t.ResourceLoader=vo,t.RichText=Vh,t.RichTextEditPlugin=class{constructor(){this.name="RichTextEditPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.editing=!1,this.pointerDown=!1,this.handleInput=(t,e,i,n,r)=>{const s=this.getPointByColumnIdx(i,n,r);this.hideSelection(),this.setCursor(s.x,s.y1,s.y2),this.updateCbs.forEach((t=>t("input",this)))},this.handleChange=(t,e,i,n,r)=>{const s=this.getPointByColumnIdx(i,n,r);this.curCursorIdx=i,this.selectionStartCursorIdx=i,this.setCursorAndTextArea(s.x,s.y1,s.y2,n),this.hideSelection(),this.updateCbs.forEach((t=>t("change",this)))},this.handleMove=t=>{this.isRichtext(t)&&(this.currRt=t.target,this.handleEnter(t),t.target.once("pointerleave",this.handleLeave),this.showSelection(t))},this.handlePointerDown=t=>{this.editing?this.onFocus(t):this.deFocus(t),this.applyUpdate(),this.pointerDown=!0,this.updateCbs.forEach((t=>t(this.editing?"onfocus":"defocus",this)))},this.handlePointerUp=t=>{this.pointerDown=!1},this.handleEnter=t=>{this.editing=!0,this.pluginService.stage.setCursor("text")},this.handleLeave=t=>{this.editing=!1,this.pluginService.stage.setCursor("default")},this.commandCbs=new Map,this.commandCbs.set(Wf,[this.formatTextCommandCb]),this.updateCbs=[]}getSelection(){return this.selectionStartCursorIdx&&this.curCursorIdx&&this.selectionStartCursorIdx!==this.curCursorIdx&&this.currRt?new Uf(this.selectionStartCursorIdx,this.curCursorIdx,Df(this.currRt.attribute.textConfig,this.selectionStartCursorIdx),Df(this.currRt.attribute.textConfig,this.curCursorIdx),this.currRt):null}formatTextCommandCb(t,e){const i=e.currRt;if(!i)return;const n=e.getSelection();if(!n)return;const{selectionStartCursorIdx:r,curCursorIdx:s}=n,o=i.attribute.textConfig.slice(r+1,s+1);"bold"===t?o.forEach((t=>t.fontWeight="bold")):"italic"===t?o.forEach((t=>t.fontStyle="italic")):"underline"===t?o.forEach((t=>t.underline=!0)):"lineThrough"===t?o.forEach((t=>t.lineThrough=!0)):Z(t)&&o.forEach((e=>function(t){let e=-1;const i=arguments.length<=1?0:arguments.length-1;for(;++e<i;)ut(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}(e,t))),i.setAttributes(i.attribute)}dispatchCommand(t,e){const i=this.commandCbs.get(t);i&&i.forEach((t=>t(e,this))),this.updateCbs.forEach((t=>t("dispatch",this)))}registerCommand(t,e){(this.commandCbs.get(t)||[]).push(e)}registerUpdateListener(t){(this.updateCbs||[]).push(t)}activate(t){this.pluginService=t,this.editModule=new jf,t.stage.on("pointermove",this.handleMove),t.stage.on("pointerdown",this.handlePointerDown),t.stage.on("pointerup",this.handlePointerUp),t.stage.on("pointerleave",this.handlePointerUp),this.editModule.onInput(this.handleInput),this.editModule.onChange(this.handleChange)}showSelection(t){const e=t.target.getFrameCache();if(e&&this.editBg&&this.pointerDown){let i=this.lastPoint,n=this.getEventPosition(t),r=this.getLineByPoint(e,n);const s=this.getColumnByLinePoint(r,n),o=r.top,a=r.top+r.height;let l=s.left+s.width,h=this.getColumnIndex(e,s);n.x<s.left+s.width/2&&(l=s.left,h-=1),n.x=l,n.y=(o+a)/2;let c=this.getLineByPoint(e,i);if((i.y>n.y||i.y===n.y&&i.x>n.x)&&([i,n]=[n,i],[r,c]=[c,r]),this.editBg.removeAllChild(),c===r){const t=this.getColumnByLinePoint(c,i);this.editBg.setAttributes({x:i.x,y:c.top,width:n.x-i.x,height:t.height,fill:"#336df4",fillOpacity:.2})}else{this.editBg.setAttributes({x:0,y:c.top,width:0,height:0});const t=e.lines.findIndex((t=>t===c)),s=e.lines.findIndex((t=>t===r));let o=0;for(let r=t;r<=s;r++){const a=e.lines[r];if(r===t){const t=a.paragraphs[a.paragraphs.length-1];this.editBg.add(Mh({x:i.x,y:o,width:t.left+t.width-i.x,height:a.height,fill:"#336df4",fillOpacity:.2}))}else if(r===s){const t=a.paragraphs[0];this.editBg.add(Mh({x:t.left,y:o,width:n.x-t.left,height:a.height,fill:"#336df4",fillOpacity:.2}))}else{const t=a.paragraphs[0],e=a.paragraphs[a.paragraphs.length-1];this.editBg.add(Mh({x:t.left,y:o,width:e.left+e.width-t.left,height:a.height,fill:"#336df4",fillOpacity:.2}))}o+=a.height}}this.curCursorIdx=h,this.setCursorAndTextArea(l,o+2,a-2,t.target),this.applyUpdate(),this.updateCbs.forEach((t=>t("selection",this)))}}hideSelection(){this.editBg&&(this.editBg.removeAllChild(),this.editBg.setAttributes({fill:"transparent"}))}isRichtext(t){return!(!t.target||"richtext"!==t.target.type||!t.target.attribute.editable)}getEventPosition(t){const e=this.pluginService.stage.eventPointTransform(t),i={x:0,y:0};return t.target.globalTransMatrix.transformPoint(e,i),i}getLineByPoint(t,e){let i=t.lines[0];for(let n=0;n<t.lines.length&&!(i.top<=e.y&&i.top+i.height>=e.y);n++)i=t.lines[n+1];return i}getColumnByLinePoint(t,e){let i=t.paragraphs[0];for(let n=0;n<t.paragraphs.length&&!(i.left<=e.x&&i.left+i.width>=e.x);n++)i=t.paragraphs[n];return i}onFocus(t){this.deFocus(t);const e=t.target;this.tryUpdateRichtext(e);const i=e.attachShadow();i.setAttributes({shadowRootIdx:-1});const n=e.getFrameCache();if(!n)return;if(!this.editLine){const t=Bh({x:0,y:0,lineWidth:1,stroke:"black"});t.animate().to({opacity:1},10,"linear").wait(700).to({opacity:0},10,"linear").wait(700).loop(1/0),this.editLine=t;const e=ba({x:0,y:0,width:0,height:0});this.editBg=e,i.add(this.editLine),i.add(this.editBg)}const r=this.getEventPosition(t),s=this.getLineByPoint(n,r);if(s){const t=this.getColumnByLinePoint(s,r);if(!t)return;let i=s.top,o=s.top+s.height,a=t.left+t.width;i+=2,o-=2;let l=this.getColumnIndex(n,t);r.x<t.left+t.width/2&&(a=t.left,l-=1),this.lastPoint={x:a,y:(i+o)/2},this.curCursorIdx=l,this.selectionStartCursorIdx=l,this.setCursorAndTextArea(a,i,o,e)}}getPointByColumnIdx(t,e,i){const n=e.getFrameCache(),{lineInfo:r,columnInfo:s}=this.getColumnByIndex(n,t);let o=r.top,a=r.top+r.height;return o+=2,a-=2,{x:s.left+("left"===i?0:s.width),y1:o,y2:a}}getColumnIndex(t,e){let i=-1;for(let n=0;n<t.lines.length;n++){const r=t.lines[n];for(let t=0;t<r.paragraphs.length;t++)if(i++,e===r.paragraphs[t])return i}return-1}getColumnByIndex(t,e){let i=-1;for(let n=0;n<t.lines.length;n++){const r=t.lines[n];for(let t=0;t<r.paragraphs.length;t++){const n=r.paragraphs[t];if(i++,i===e)return{lineInfo:r,columnInfo:n}}}return null}setCursorAndTextArea(t,e,i,n){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]});const r={x:0,y:0};n.globalTransMatrix.getInverse().transformPoint({x:t,y:e},r);const{left:s,top:o}=this.pluginService.stage.window.getBoundingClientRect();r.x+=s,r.y+=o,this.editModule.moveTo(r.x,r.y,n,this.curCursorIdx,this.selectionStartCursorIdx)}setCursor(t,e,i){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]})}applyUpdate(){this.pluginService.stage.renderNextFrame()}deFocus(t){t.target.detachShadow(),this.currRt=null,this.editLine&&(this.editLine.parent.removeChild(this.editLine),this.editLine.release(),this.editLine=null,this.editBg.parent.removeChild(this.editBg),this.editBg.release(),this.editBg=null)}splitText(t){return Array.from(t)}tryUpdateRichtext(t){if(!t.getFrameCache().lines.every((t=>t.paragraphs.every((t=>!(t.text&&it(t.text)&&this.splitText(t.text).length>1)))))){const e=[];t.attribute.textConfig.forEach((t=>{const i=this.splitText(t.text.toString());if(it(t.text)&&i.length>1)for(let n=0;n<i.length;n++){const r=i[n];e.push(Object.assign(Object.assign({},t),{text:r}))}else e.push(t)})),t.setAttributes({textConfig:e}),t.doUpdateFrameCache(e)}}onSelect(){}deactivate(t){t.stage.off("pointermove",this.handleMove),t.stage.off("pointerdown",this.handlePointerDown),t.stage.off("pointerup",this.handlePointerUp),t.stage.off("pointerleave",this.handlePointerUp)}release(){this.editModule.release()}},t.RichTextRender=kd,t.RotateBySphereAnimate=class extends Xr{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),s=Math.acos((n-t.y)/e);let o=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(o=Bt-o),this.theta=o,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r,cb:s}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,a=this.theta+o,l=this.phi,h=r*Math.sin(l)*Math.cos(a)+n.x,c=r*Math.cos(l)+n.y,u=r*Math.sin(l)*Math.sin(a)+n.z;for(i.x=h,i.y=c,i.z=u,i.alpha=a+Tt/2;i.alpha>Bt;)i.alpha-=Bt;i.alpha=Bt-i.alpha,i.zIndex=-1e4*i.z,s&&s(i)}},t.SVG_ATTRIBUTE_MAP=pa,t.SVG_ATTRIBUTE_MAP_KEYS=fa,t.SVG_PARSE_ATTRIBUTE_MAP=ga,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=va,t.SYMBOL_NUMBER_TYPE=ha,t.SegContext=ri,t.ShadowRoot=hc,t.ShadowRootDrawItemInterceptorContribution=zd,t.Stage=yf,t.StaticLayerHandlerContribution=Ta,t.Step=Ci,t.StreamLight=class extends Xr{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}onStartLineOrArea(t){var e;const i=this.target.attachShadow(),n=pn.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=n,n.pathProxy=new Di,i.add(n)}onStartRect(){var t,e,i;const n=this.target.attachShadow(),r=null===(e=null===(t=this.params)||void 0===t?void 0:t.isHorizontal)||void 0===e||e,s=r?"height":"width",o=r?"width":"height",a=this.target.AABBBounds[s](),l=r?0:this.target.AABBBounds.y1,h=pn.graphicService.creator.rect(Object.assign(Object.assign({[s]:a,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(i=this.params)||void 0===i?void 0:i.attribute),{x:0,y:l,[o]:0}));this.rect=h,n.add(h)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){return this.rect?this.onUpdateRect(t,e,i):this.line||this.area?this.onUpdateLineOrArea(t,e,i):void 0}onUpdateRect(e,i,n){var r,s,o,a,l,h,c,u,d,p,f,g,v,m,y,b;const x=null===(s=null===(r=this.params)||void 0===r?void 0:r.isHorizontal)||void 0===s||s,w=this.target.attribute;if(x){const n=null!==(a=null!==(o=w.width)&&void 0!==o?o:Math.abs(w.x1-w.x))&&void 0!==a?a:250,r=null!==(h=null===(l=this.params)||void 0===l?void 0:l.streamLength)&&void 0!==h?h:n,s=null!==(d=null===(u=null===(c=this.params)||void 0===c?void 0:c.attribute)||void 0===u?void 0:u.width)&&void 0!==d?d:60,p=-s,f=p+(r-p)*i,g=Math.max(f,0),v=Math.min(Math.min(f+s,s),r-f),m=v+g>n?Math.max(n-g,0):v;this.rect.setAttributes({x:g,width:m,dx:Math.min(w.x1-w.x,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}else{const n=null!==(f=null!==(p=w.height)&&void 0!==p?p:Math.abs(w.y1-w.y))&&void 0!==f?f:250,r=null!==(v=null===(g=this.params)||void 0===g?void 0:g.streamLength)&&void 0!==v?v:n,s=null!==(b=null===(y=null===(m=this.params)||void 0===m?void 0:m.attribute)||void 0===y?void 0:y.height)&&void 0!==b?b:60,o=n-(r+s)*i;let a=Math.min(o,n);const l=Math.min(n-o,s);let h;a<=0?(h=Math.max(a+l,0),a=0):h=l,this.rect.setAttributes({y:a,height:h,dy:Math.min(w.y1-w.y,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}}onUpdateLineOrArea(t,e,i){const n=this.line||this.area;if(!n)return;const r=n.pathProxy,s=this.target;s.cache||s.cacheArea?this._onUpdateLineOrAreaWithCache(r,s,t,e,i):this._onUpdateLineWithoutCache(r,s,t,e,i);const o=s.attribute;n.setAttributes(Object.assign({stroke:o.stroke},n.attribute)),n.addUpdateBoundTag()}_onUpdateLineOrAreaWithCache(t,e,i,n,r){if(t.clear(),"line"===e.type){let i=e.cache;Array.isArray(i)||(i=[i]);const r=i.reduce(((t,e)=>t+e.getLength()),0),s=[];return i.forEach((t=>{t.curves.forEach((t=>s.push(t)))})),this._updateCurves(t,s,r,n)}if("area"===e.type){const i=e.cacheArea,r=i.top.curves.reduce(((t,e)=>t+e.getLength()),0);return this._updateCurves(t,i.top.curves,r,n)}}_updateCurves(t,e,i,n){var r,s;const o=i*n,a=Math.min(null!==(s=o+(null===(r=this.params)||void 0===r?void 0:r.streamLength))&&void 0!==s?s:10,i);let l=0,h=!1;for(let i=0;i<e.length;i++){const n=e[i],r=n.getLength(),s=1-(l+r-o)/r;let c,u=1-(l+r-a)/r;if(l<o&&l+r>o)if(h=!0,n.p2&&n.p3){const[e,i]=ti(n,s);t.moveTo(i.p0.x,i.p0.y),c=i}else{const e=n.getPointAt(s);t.moveTo(e.x,e.y)}if(l<a&&l+r>a){if(n.p2&&n.p3){c&&(u=(a-o)/c.getLength());const[e]=ti(c||n,u);t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else{const e=n.getPointAt(u);t.lineTo(e.x,e.y)}break}if(h)if(n.p2&&n.p3){const e=c||n;t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else t.lineTo(n.p1.x,n.p1.y);l+=r}}_onUpdateLineWithoutCache(t,e,i,n,r){var s,o;const{points:a,curveType:l}=e.attribute;if(!a||a.length<2||"linear"!==l)return;let h=0;for(let t=1;t<a.length;t++)h+=zt.distancePP(a[t],a[t-1]);const c=h*n,u=Math.min(null!==(o=c+(null===(s=this.params)||void 0===s?void 0:s.streamLength))&&void 0!==o?o:10,h),d=[];let p=0;for(let t=1;t<a.length;t++){const e=zt.distancePP(a[t],a[t-1]);if(p<c&&p+e>c&&d.push(zt.pointAtPP(a[t-1],a[t],1-(p+e-c)/e)),p<u&&p+e>u){d.push(zt.pointAtPP(a[t-1],a[t],1-(p+e-u)/e));break}d.length&&d.push(a[t]),p+=e}if(d.length&&!(d.length<2)){t.clear(),t.moveTo(d[0].x,d[0].y);for(let e=1;e<d.length;e++)t.lineTo(d[e].x,d[e].y)}}},t.SubAnimate=Kr,t.Symbol=Sh,t.SymbolRender=Rd,t.SymbolRenderContribution=tl,t.TEXT_NUMBER_TYPE=ca,t.TagPointsUpdate=class extends Xr{constructor(t,e,i,n,r){var s,o;super(t,e,i,n,r),this.newPointAnimateType=null!==(s=null==r?void 0:r.newPointAnimateType)&&void 0!==s?s:"grow",this.clipRangeByDimension=null!==(o=null==r?void 0:r.clipRangeByDimension)&&void 0!==o?o:"x"}onBind(){var t,e;const i=null===(t=this.from)||void 0===t?void 0:t.points,n=null===(e=this.to)||void 0===e?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=n?Array.isArray(n)?n:[n]:[];const r=new Map;this.fromPoints.forEach((t=>{t.context&&r.set(t.context,t)}));let s,o,a=1/0,l=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(r.has(this.toPoints[t].context)){a=t,s=r.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(r.has(this.toPoints[t].context)){l=t,o=r.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(l)?(this.clipRange=this.toPoints[l][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],ot(this.clipRange)?this.clipRange=At(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let h=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=r.get(t.context);return i?(h=i,[i,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:e<a&&s?[s,t]:e>l&&o?[o,t]:[h,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new Ft(e.x,e.y,e.x1,e.y1);return n.defined=i.defined,n.context=i.context,n}))}onUpdate(t,e,i){this.points=this.points.map(((t,i)=>{const n=hs(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),this.clipRange&&(i.clipRange=this.clipRange+(1-this.clipRange)*e),i.points=this.points}},t.Text=fl,t.TextMeasureContribution=_n,t.TextRender=Md,t.TextRenderContribution=el,t.Theme=Ar,t.TimeOutTickHandler=Nr,t.TransformUtil=wa,t.VArc=function(t){return Mc.arc(t?t.attribute:{})},t.VArc3d=function(t){return Mc.arc3d(t?t.attribute:{})},t.VArea=function(t){return Mc.area(t?t.attribute:{})},t.VCircle=function(t){return Mc.circle(t?t.attribute:{})},t.VGlobal=W,t.VGlyph=function(t){return Mc.glyph(t?t.attribute:{})},t.VGroup=function(t){return Mc.group(t?t.attribute:{})},t.VImage=function(t){return Mc.image(t?t.attribute:{})},t.VLine=function(t){return Mc.line(t?t.attribute:{})},t.VPath=function(t){return Mc.path(t?t.attribute:{})},t.VPolygon=function(t){return Mc.polygon(t?t.attribute:{})},t.VPyramid3d=function(t){return Mc.pyramid3d(t?t.attribute:{})},t.VRect=function(t){return Mc.rect(t?t.attribute:{})},t.VRect3d=function(t){return Mc.rect3d(t?t.attribute:{})},t.VRichText=ay,t.VSymbol=function(t){return Mc.symbol(t?t.attribute:{})},t.VText=function(t){return Mc.text(t?t.attribute:{})},t.VWindow=cr,t.VirtualLayerHandlerContribution=_a,t.WILDCARD="*",t.WindowHandlerContribution=ur,t.WrapText=ml,t.XMLParser=Do,t._interpolateColor=qs,t._registerArc=aT,t.addArcToBezierPath=Ye,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=_s,t.alignSubpath=xs,t.application=pn,t.applyTransformOnBezierCurves=Rs,t.arc3dCanvasPickModule=QS,t.arc3dModule=Fg,t.arcCanvasPickModule=PA,t.arcMathPickModule=pb,t.arcModule=og,t.areaCanvasPickModule=qA,t.areaMathPickModule=bb,t.areaModule=dg,t.bezier=He,t.bezierCurversToPath=Ms,t.binarySplitPolygon=Fs,t.bindContributionProvider=L,t.bindContributionProviderNoSingletonScope=I,t.boundStroke=No,t.browserEnvModule=Gy,t.builtInSymbolStrMap=xh,t.builtinSymbols=yh,t.builtinSymbolsMap=bh,t.calcLineCache=Ii,t.calculateLineHeight=vs,t.canvasAllocate=ar,t.centroidOfSubpath=Ss,t.circleBounds=as,t.circleCanvasPickModule=aS,t.circleMathPickModule=Cb,t.circleModule=vg,t.clock=Or,t.cloneGraphic=fo,t.colorEqual=function(t,e){const i=se.parseColorString(t),n=se.parseColorString(e);return!(!i||!n)&&i.r===n.r&&i.g===n.g&&i.b===n.b&&i.opacity===n.opacity},t.colorStringInterpolationToStr=io,t.container=Bn,t.cornerTangents=Wa,t.createArc=ec,t.createArc3d=nc,t.createArea=Jh,t.createCircle=ol,t.createColor=Wc,t.createConicalGradient=Va,t.createGlyph=Ih,t.createGroup=ba,t.createImage=Nh,t.createImageElement=zy,t.createLine=Bh,t.createMat4=gc,t.createPath=qh,t.createPolygon=oc,t.createPyramid3d=lc,t.createRect=Mh,t.createRect3d=Oh,t.createRectPath=ru,t.createRichText=Yh,t.createShadowRoot=cc,t.createStage=function(t){return new yf(t)},t.createSymbol=Th,t.createText=gl,t.createWrapText=yl,t.cubicCalc=Je,t.cubicLength=Ze,t.cubicPointAt=Qe,t.cubicSubdivide=bs,t.decodeReactDom=uy,t.defaultArcAllocate=Hf,t.defaultArcBackgroundRenderContribution=Kc,t.defaultArcRenderContribution=$c,t.defaultArcTextureRenderContribution=qc,t.defaultAreaAllocate=Yf,t.defaultBaseBackgroundRenderContribution=Hc,t.defaultBaseTextureRenderContribution=Yc,t.defaultCircleAllocate=$f,t.defaultCircleBackgroundRenderContribution=tu,t.defaultCircleRenderContribution=Jc,t.defaultCircleTextureRenderContribution=Qc,t.defaultGraphicMemoryManager=rg,t.defaultGroupBackgroundRenderContribution=iu,t.defaultImageBackgroundRenderContribution=pu,t.defaultImageRenderContribution=du,t.defaultLineAllocate=Kf,t.defaultPathAllocate=Jf,t.defaultRectAllocate=zf,t.defaultRectBackgroundRenderContribution=hu,t.defaultRectRenderContribution=au,t.defaultRectTextureRenderContribution=lu,t.defaultSymbolAllocate=tg,t.defaultSymbolBackgroundRenderContribution=mu,t.defaultSymbolRenderContribution=gu,t.defaultSymbolTextureRenderContribution=vu,t.defaultTextAllocate=ig,t.defaultTicker=sf,t.defaultTimeline=Yr,t.drawArc=Ve,t.drawArcPath=Na,t.drawAreaSegments=Mu,t.drawIncrementalAreaSegments=Pu,t.drawIncrementalSegments=Bu,t.drawPathProxy=ja,t.drawSegments=_u,t.enumCommandMap=Be,t.feishuEnvModule=Bx,t.fillVisible=Oa,t.findBestMorphingRotation=Cs,t.findNextGraphic=Pp,t.flatten_simplify=function(t,e,i){if(t.length<=10)return t;const n=void 0!==e?e*e:1;return If(t=i?t:function(t,e){let i,n,r=t[0].x,s=t[0].y;const o=[t[0]];for(let a=1,l=t.length;a<l;a++)i=t[a].x-r,n=t[a].y-s,i*i+n*n>e&&(r=t[a].x,s=t[a].y,o.push(t[a]));return t[t.length-1].x===r&&t[t.length-1].y===s||o.push(t[t.length-1]),o}(t,n),n)},t.foreach=_p,t.foreachAsync=Bp,t.genBasisSegments=fi,t.genBasisTypeSegments=pi,t.genLinearClosedSegments=Ri,t.genLinearClosedTypeSegments=Mi,t.genLinearSegments=hi,t.genLinearTypeSegments=ci,t.genMonotoneXSegments=Ai,t.genMonotoneXTypeSegments=wi,t.genMonotoneYSegments=Ti,t.genMonotoneYTypeSegments=Si,t.genNumberType=zo,t.genStepSegments=_i,t.genStepTypeSegments=Bi,t.getAttributeFromDefaultAttrList=ps,t.getConicGradientAt=Ha,t.getContextFont=al,t.getCurrentEnv=function(){return ff()?"browser":"node"},t.getExtraModelMatrix=function(t,e,i){const{alpha:n,beta:r}=i.attribute;if(!n&&!r)return null;const{anchor3d:s=i.attribute.anchor}=i.attribute,o=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.AABBBounds;o[0]=e.x1+(e.x2-e.x1)*t}else o[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=i.AABBBounds;o[1]=e.x1+(e.x2-e.x1)*t}else o[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;o[0]+=hl(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=bc.allocate();return Cc(a,a,[o[0],o[1],0]),r&&Sc(a,a,r),n&&Tc(a,a,n),Cc(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=Pc,t.getRichTextBounds=function(t){return Ec||(Ec=Mc.CreateGraphic("richtext",{})),Ec.setAttributes(t),Ec.AABBBounds},t.getScaledStroke=Uc,t.getTextBounds=Oc,t.getTheme=Tr,t.getThemeFromGroup=Cr,t.globalTheme=Sr,t.glyphCanvasPickModule=kS,t.glyphMathPickModule=kb,t.glyphModule=_g,t.graphicCreator=Mc,t.graphicService=$p,t.graphicUtil=Yp,t.harmonyEnvModule=wA,t.imageCanvasPickModule=FS,t.imageMathPickModule=Ib,t.imageModule=Og,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.initAllEnv=function(){Fw(Bn)},t.initBrowserEnv=function(){Hy(Bn)},t.initFeishuEnv=function(){Px(Bn)},t.initHarmonyEnv=function(){AA(Bn)},t.initLynxEnv=function(){Vx(Bn)},t.initNodeEnv=function(){aw(Bn)},t.initTTEnv=function(){sA(Bn)},t.initTaroEnv=function(){Sw(Bn)},t.initWxEnv=function(){Nw(Bn)},t.inject=p,t.injectable=g,t.interpolateColor=$s,t.interpolateGradientConicalColor=Js,t.interpolateGradientLinearColor=Ks,t.interpolateGradientRadialColor=Zs,t.interpolatePureColorArray=Qs,t.intersect=Ua,t.isBrowserEnv=ff,t.isNodeEnv=gf,t.isSvg=jo,t.isTransformKey=ds,t.isXML=Uo,t.jsx=function(t,e){const i=e||{},{key:n,name:r,id:s,attribute:o,stateProxy:a}=i,l=ly(i,["key","name","id","attribute","stateProxy"]);let h=t;it(t)&&(h=Mc[t]);const c=[];for(var u=arguments.length,d=new Array(u>2?u-2:0),p=2;p<u;p++)d[p-2]=arguments[p];d.length&&hy(1===d.length?d[0]:d,c);const f="Group"===h.name?new h(o):h(e);return function(t,e,i){let n,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":n=t.attribute||{},e[0]&&(n.text=e[0]);break;default:r=!0}r?(e.forEach((e=>{e&&t.add(e)})),Object.keys(i).forEach((e=>{const n=sy[e];n&&t.on(n,i[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((t=>t.attribute)).filter((t=>t)))}(f,c,l),a&&(f.stateProxy=a),f},t.layerService=qp,t.lineCanvasPickModule=GA,t.lineMathPickModule=Fb,t.lineModule=cg,t.loadAllEnv=Fw,t.loadAllModule=zw,t.loadBrowserEnv=Hy,t.loadFeishuEnv=Px,t.loadHarmonyEnv=AA,t.loadLynxEnv=Vx,t.loadNodeEnv=aw,t.loadTTEnv=sA,t.loadTaroEnv=Sw,t.loadWxEnv=Nw,t.lookAt=af,t.lynxEnvModule=Hx,t.mat3Tomat4=_c,t.mat4Allocate=bc,t.matrixAllocate=yc,t.morphPath=ho,t.multiInject=f,t.multiToOneMorph=(e,i,n)=>{var r,s,o;const a=e.filter((t=>t.toCustomPath&&t.valid));a.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const l=("clone"===(null==n?void 0:n.splitPath)?fo:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:go)(i,a.length,!0),h=i.attribute;i.setAttribute("visible",!1);const c=a.map(((t,e)=>so(t.toCustomPath(),l[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:l[e].globalTransMatrix}))),u=a.map(((t,e)=>ao(t.attribute,h)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=a.length;const o=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};l.forEach(((t,i)=>{var r,s,l;const h=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,a.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:o}));d.wait(h),d.play(new lo({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:Qr.duration,null!==(l=n.easing)&&void 0!==l?l:Qr.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const a=i.animate(r);(null==n?void 0:n.delay)&&a.wait(n.delay),a.play(new co({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:Qr.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:Qr.easing))}},t.multiply=hf,t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i.a,x=i.b,w=0,A=0;return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*l+w*d+A*v,t[2]=b*s+x*h+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i.c,x=i.d,w=0,A=0,t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*l+w*d+A*v,t[6]=b*s+x*h+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=0,x=0,w=1,A=0,t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*l+w*d+A*v,t[10]=b*s+x*h+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i.e,x=i.f,w=0,A=1,t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*l+w*d+A*v,t[14]=b*s+x*h+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t},t.multiplyMat4Mat4=Bc,t.named=v,t.newThemeObj=br,t.nodeEnvModule=ow,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?fo:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:go)(t,r.length,!1),o=null==i?void 0:i.onEnd;let a=r.length;const l=()=>{a--,0===a&&o&&o()};r.forEach(((e,n)=>{var o;const a=s[n],h=(null!==(o=null==i?void 0:i.delay)&&void 0!==o?o:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,a,e):0);ho(a,e,Object.assign({},i,{onEnd:l,delay:h}),t.globalTransMatrix)}))},t.ortho=lf,t.parsePadding=rs,t.parseStroke=is,t.parseSvgPath=Le,t.pathCanvasPickModule=bS,t.pathMathPickModule=Qb,t.pathModule=xg,t.pathToBezierCurves=Ps,t.point=ui,t.pointEqual=ls,t.pointInterpolation=hs,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=Ut(t.x,t.y,e.x,e.y,i),{x:o,y:a}=Ut(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=o,n.y1=a,n.defined=e.defined,n},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every(((t,i)=>ls(t,e[i]))):!Number.isNaN(t.x+t.y)&&ls(t,e))},t.pointsInterpolation=cs,t.polygonCanvasPickModule=CS,t.polygonMathPickModule=Xb,t.polygonModule=Ag,t.preLoadAllModule=Hp,t.pyramid3dCanvasPickModule=sT,t.pyramid3dModule=Vg,t.rafBasedSto=gs,t.rect3dCanvasPickModule=XS,t.rect3dModule=jg,t.rectCanvasPickModule=IA,t.rectFillVisible=La,t.rectMathPickModule=ox,t.rectModule=lg,t.rectStrokeVisible=Da,t.recursiveCallBinarySplit=zs,t.registerArc=lT,t.registerArc3d=cT,t.registerArc3dGraphic=Xg,t.registerArcGraphic=Yg,t.registerArea=dT,t.registerAreaGraphic=$g,t.registerCircle=fT,t.registerCircleGraphic=qg,t.registerGlyph=vT,t.registerGlyphGraphic=Kg,t.registerGroup=yT,t.registerGroupGraphic=Zg,t.registerImage=xT,t.registerImageGraphic=Jg,t.registerLine=AT,t.registerLineGraphic=Qg,t.registerPath=TT,t.registerPathGraphic=tv,t.registerPolygon=_T,t.registerPolygonGraphic=ev,t.registerPyramid3d=PT,t.registerPyramid3dGraphic=iv,t.registerRect=MT,t.registerRect3d=ET,t.registerRect3dGraphic=rv,t.registerRectGraphic=nv,t.registerRichtext=LT,t.registerRichtextGraphic=sv,t.registerShadowRoot=DT,t.registerShadowRootGraphic=lv,t.registerSymbol=UT,t.registerSymbolGraphic=ov,t.registerText=NT,t.registerTextGraphic=av,t.registerWrapText=zT,t.registerWrapTextGraphic=hv,t.renderCommandList=$e,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.richTextMathPickModule=lx,t.richtextCanvasPickModule=jS,t.richtextModule=kg,t.rotateX=Sc,t.rotateY=Tc,t.roughModule=GT,t.runFill=ka,t.runStroke=Ea,t.segments=Ge,t.shouldUseMat4=Rc,t.snapLength=Ke,t.splitArc=Ls,t.splitArea=js,t.splitCircle=Is,t.splitGraphic=go,t.splitLine=Us,t.splitPath=Hs,t.splitPolygon=Gs,t.splitRect=Os,t.splitToGrids=Es,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=Ia,t.symbolCanvasPickModule=eS,t.symbolMathPickModule=fx,t.symbolModule=fg,t.taroEnvModule=Aw,t.textAttributesToStyle=ul,t.textCanvasPickModule=pS,t.textDrawOffsetX=hl,t.textDrawOffsetY=ll,t.textLayoutOffsetY=cl,t.textMathPickModule=yx,t.textModule=yg,t.transformKeys=us,t.transformMat4=cf,t.transformUtil=Xp,t.translate=Cc,t.ttEnvModule=rA,t.version="0.19.24-alpha.8",t.verticalLayout=Ho,t.vglobal=Vp,t.waitForAllSubLayers=function(t){return Wo(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{pn.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)}))},t.wrapCanvas=Mn,t.wrapContext=function(t,e){return Bn.getNamed(Rn,pn.global.env)(t,e)},t.wxEnvModule=Ww,t.xul=function(t){const e=nt(t)?t[0]:t,i=[];if(!e)return i;if(!0===Uo(e)){const t=(new Do).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};$o(t,e);const i=t["#text"];return i&&(e.text=i),e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};$o(t,e);const i=e.image;return i&&(e.image=i.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">")),e}(t.tc[e]))}))}return i}}));