@visactor/vrender-core 0.16.0-alpha.0 → 0.16.0-alpha.1

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.
Files changed (155) hide show
  1. package/cjs/animate/animate.js +8 -2
  2. package/cjs/animate/animate.js.map +1 -1
  3. package/cjs/core/constants.d.ts +3 -0
  4. package/cjs/core/constants.js +4 -2
  5. package/cjs/core/constants.js.map +1 -1
  6. package/cjs/core/contributions/layerHandler/canvas2d-contribution.d.ts +3 -1
  7. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +1 -1
  8. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  9. package/cjs/core/contributions/layerHandler/empty-contribution.d.ts +24 -0
  10. package/cjs/core/contributions/layerHandler/empty-contribution.js +57 -0
  11. package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -0
  12. package/cjs/core/contributions/layerHandler/modules.js +4 -2
  13. package/cjs/core/contributions/layerHandler/modules.js.map +1 -1
  14. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.d.ts +3 -1
  15. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +1 -1
  16. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  17. package/cjs/core/layer-service.d.ts +5 -2
  18. package/cjs/core/layer-service.js +22 -3
  19. package/cjs/core/layer-service.js.map +1 -1
  20. package/cjs/core/layer.d.ts +4 -3
  21. package/cjs/core/layer.js +13 -8
  22. package/cjs/core/layer.js.map +1 -1
  23. package/cjs/core/stage.d.ts +8 -7
  24. package/cjs/core/stage.js +30 -36
  25. package/cjs/core/stage.js.map +1 -1
  26. package/cjs/graphic/config.d.ts +2 -1
  27. package/cjs/graphic/config.js +11 -6
  28. package/cjs/graphic/config.js.map +1 -1
  29. package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -0
  30. package/cjs/graphic/graphic-service/graphic-service.js +4 -0
  31. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  32. package/cjs/graphic/graphic.js +3 -2
  33. package/cjs/graphic/graphic.js.map +1 -1
  34. package/cjs/graphic/node-tree.d.ts +1 -1
  35. package/cjs/graphic/node-tree.js +2 -2
  36. package/cjs/graphic/node-tree.js.map +1 -1
  37. package/cjs/graphic/text.d.ts +12 -0
  38. package/cjs/graphic/text.js +31 -5
  39. package/cjs/graphic/text.js.map +1 -1
  40. package/cjs/interface/core.d.ts +2 -1
  41. package/cjs/interface/core.js.map +1 -1
  42. package/cjs/interface/graphic/text.d.ts +3 -0
  43. package/cjs/interface/graphic/text.js.map +1 -1
  44. package/cjs/interface/graphic-service.d.ts +2 -0
  45. package/cjs/interface/graphic-service.js.map +1 -1
  46. package/cjs/interface/graphic.d.ts +6 -1
  47. package/cjs/interface/graphic.js.map +1 -1
  48. package/cjs/interface/layer.d.ts +9 -2
  49. package/cjs/interface/layer.js.map +1 -1
  50. package/cjs/interface/picker.d.ts +5 -5
  51. package/cjs/interface/picker.js.map +1 -1
  52. package/cjs/interface/render.d.ts +1 -1
  53. package/cjs/interface/render.js.map +1 -1
  54. package/cjs/interface/stage.d.ts +3 -8
  55. package/cjs/interface/stage.js.map +1 -1
  56. package/cjs/picker/global-picker-service.d.ts +1 -1
  57. package/cjs/picker/global-picker-service.js +14 -4
  58. package/cjs/picker/global-picker-service.js.map +1 -1
  59. package/cjs/picker/pick-interceptor.d.ts +3 -3
  60. package/cjs/picker/pick-interceptor.js +4 -4
  61. package/cjs/picker/pick-interceptor.js.map +1 -1
  62. package/cjs/picker/picker-service.d.ts +1 -1
  63. package/cjs/picker/picker-service.js +5 -4
  64. package/cjs/picker/picker-service.js.map +1 -1
  65. package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +1 -0
  66. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +7 -0
  67. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  68. package/cjs/render/contributions/render/draw-interceptor.d.ts +10 -0
  69. package/cjs/render/contributions/render/draw-interceptor.js +63 -1
  70. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  71. package/cjs/render/contributions/render/module.js +4 -0
  72. package/cjs/render/contributions/render/module.js.map +1 -1
  73. package/cjs/render/contributions/render/text-render.js +9 -2
  74. package/cjs/render/contributions/render/text-render.js.map +1 -1
  75. package/cjs/render/contributions/render/utils.js +1 -1
  76. package/cjs/render/contributions/render/utils.js.map +1 -1
  77. package/dist/index.js +351 -66
  78. package/dist/index.min.js +1 -1
  79. package/es/animate/animate.js +8 -2
  80. package/es/animate/animate.js.map +1 -1
  81. package/es/core/constants.d.ts +3 -0
  82. package/es/core/constants.js +6 -0
  83. package/es/core/constants.js.map +1 -1
  84. package/es/core/contributions/layerHandler/canvas2d-contribution.d.ts +3 -1
  85. package/es/core/contributions/layerHandler/canvas2d-contribution.js +1 -1
  86. package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  87. package/es/core/contributions/layerHandler/empty-contribution.d.ts +24 -0
  88. package/es/core/contributions/layerHandler/empty-contribution.js +53 -0
  89. package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -0
  90. package/es/core/contributions/layerHandler/modules.js +6 -2
  91. package/es/core/contributions/layerHandler/modules.js.map +1 -1
  92. package/es/core/contributions/layerHandler/offscreen2d-contribution.d.ts +3 -1
  93. package/es/core/contributions/layerHandler/offscreen2d-contribution.js +1 -1
  94. package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  95. package/es/core/layer-service.d.ts +5 -2
  96. package/es/core/layer-service.js +25 -2
  97. package/es/core/layer-service.js.map +1 -1
  98. package/es/core/layer.d.ts +4 -3
  99. package/es/core/layer.js +11 -7
  100. package/es/core/layer.js.map +1 -1
  101. package/es/core/stage.d.ts +8 -7
  102. package/es/core/stage.js +30 -36
  103. package/es/core/stage.js.map +1 -1
  104. package/es/graphic/config.d.ts +2 -1
  105. package/es/graphic/config.js +10 -4
  106. package/es/graphic/config.js.map +1 -1
  107. package/es/graphic/graphic-service/graphic-service.d.ts +2 -0
  108. package/es/graphic/graphic-service/graphic-service.js +4 -0
  109. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  110. package/es/graphic/graphic.js +3 -2
  111. package/es/graphic/graphic.js.map +1 -1
  112. package/es/graphic/node-tree.d.ts +1 -1
  113. package/es/graphic/node-tree.js +2 -2
  114. package/es/graphic/node-tree.js.map +1 -1
  115. package/es/graphic/text.d.ts +12 -0
  116. package/es/graphic/text.js +31 -5
  117. package/es/graphic/text.js.map +1 -1
  118. package/es/interface/core.d.ts +2 -1
  119. package/es/interface/core.js.map +1 -1
  120. package/es/interface/graphic/text.d.ts +3 -0
  121. package/es/interface/graphic/text.js.map +1 -1
  122. package/es/interface/graphic-service.d.ts +2 -0
  123. package/es/interface/graphic-service.js.map +1 -1
  124. package/es/interface/graphic.d.ts +6 -1
  125. package/es/interface/graphic.js.map +1 -1
  126. package/es/interface/layer.d.ts +9 -2
  127. package/es/interface/layer.js.map +1 -1
  128. package/es/interface/picker.d.ts +5 -5
  129. package/es/interface/picker.js.map +1 -1
  130. package/es/interface/render.d.ts +1 -1
  131. package/es/interface/render.js.map +1 -1
  132. package/es/interface/stage.d.ts +3 -8
  133. package/es/interface/stage.js.map +1 -1
  134. package/es/picker/global-picker-service.d.ts +1 -1
  135. package/es/picker/global-picker-service.js +14 -4
  136. package/es/picker/global-picker-service.js.map +1 -1
  137. package/es/picker/pick-interceptor.d.ts +3 -3
  138. package/es/picker/pick-interceptor.js +4 -4
  139. package/es/picker/pick-interceptor.js.map +1 -1
  140. package/es/picker/picker-service.d.ts +1 -1
  141. package/es/picker/picker-service.js +4 -4
  142. package/es/picker/picker-service.js.map +1 -1
  143. package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +1 -0
  144. package/es/plugins/builtin-plugin/html-attribute-plugin.js +7 -0
  145. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  146. package/es/render/contributions/render/draw-interceptor.d.ts +10 -0
  147. package/es/render/contributions/render/draw-interceptor.js +64 -0
  148. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  149. package/es/render/contributions/render/module.js +3 -1
  150. package/es/render/contributions/render/module.js.map +1 -1
  151. package/es/render/contributions/render/text-render.js +9 -2
  152. package/es/render/contributions/render/text-render.js.map +1 -1
  153. package/es/render/contributions/render/utils.js +1 -1
  154. package/es/render/contributions/render/utils.js.map +1 -1
  155. package/package.json +2 -2
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).VRenderCore={})}(this,(function(t){"use strict";let e=0;function i(){return e++}class n{constructor(t){this.id=i(),this.registry=t}}const r="named",s="name",o="unmanaged",a="optional",h="inject",l="multi_inject",c="inversify:tagged",u="inversify:tagged_props",d="inversify:paramtypes",p="post_construct",f="pre_destroy";const g=[h,l,s,o,r,a],m="Metadata key was used more than once in a parameter:",y="NULL argument",v="Key Not Found",b="Ambiguous match found for serviceIdentifier:",x="No matching bindings found for serviceIdentifier:",A="Missing required @injectable annotation in:",T="Missing required @inject or @multiInject annotation in:",B="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",w=(...t)=>`The number of constructor arguments in the derived class ${t[0]} must be >= than the number of constructor arguments of its base class.`,S=(t,e)=>`@preDestroy error in class ${t}: ${e}`,_=(t,e)=>`onDeactivation() error in class ${t}: ${e}`;class C{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===r?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}let P;var E=function(t){return function(e){const i="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")();let n=r(t);function r(t,e){return function(i,n){"function"!=typeof t[i]&&Object.defineProperty(t,i,{configurable:!0,writable:!0,value:n}),e&&e(i,n)}}void 0===i.Reflect?i.Reflect=t:n=r(i.Reflect,n),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,h={create:s?function(){return W(Object.create(null))}:o?function(){return W({__proto__:null})}:function(){return W({})},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]}},l=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?L():Map;c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?U():Set;const d=new(c||"function"!=typeof WeakMap?N():WeakMap);function p(t,e,i,n){if(!C(i))throw new TypeError;return w(n)||(n=R(n)),T(t,e,i,n)}function f(t,e,i){if(!C(e))throw new TypeError;return w(i)||(i=R(i)),v(t,e,i)}function g(t,e,i){if(!C(e))throw new TypeError;return w(i)||(i=R(i)),b(t,e,i)}function m(t,e,i){if(!C(e))throw new TypeError;return w(i)||(i=R(i)),x(t,e,i)}function y(t,e,i){let n=d.get(t);if(w(n)){if(!i)return;n=new u,d.set(t,n)}let r=n.get(e);if(w(r)){if(!i)return;r=new u,n.set(e,r)}return r}function v(t,e,i){if(b(t,e,i))return!0;const n=I(e);return!S(n)&&v(t,n,i)}function b(t,e,i){const n=y(e,i,!1);return!w(n)&&M(n.has(t))}function x(t,e,i){if(b(t,e,i))return A(t,e,i);const n=I(e);return S(n)?void 0:x(t,n,i)}function A(t,e,i){const n=y(e,i,!1);if(!w(n))return n.get(t)}function T(t,e,i,n){y(i,n,!0).set(t,e)}function B(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function w(t){return void 0===t}function S(t){return null===t}function _(t){return"symbol"==typeof t}function C(t){return"object"==typeof t?null!==t:"function"==typeof t}function P(t,e){switch(B(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=D(t,n);if(void 0!==r){const e=r.call(t,i);if(C(e))throw new TypeError;return e}return E(t,"default"===i?"number":i)}function E(t,e){if("string"===e){const e=t.toString;if(O(e)){const i=e.call(t);if(!C(i))return i}const i=t.valueOf;if(O(i)){const e=i.call(t);if(!C(e))return e}}else{const e=t.valueOf;if(O(e)){const i=e.call(t);if(!C(i))return i}const i=t.toString;if(O(i)){const e=i.call(t);if(!C(e))return e}}throw new TypeError}function M(t){return!!t}function k(t){return""+t}function R(t){const e=P(t,3);return _(e)?e:k(e)}function O(t){return"function"==typeof t}function D(t,e){const i=t[e];if(null!=i){if(!O(i))throw new TypeError;return i}}function I(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)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 L(){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]}}function U(){return function(){function t(){this._map=new u}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()},t}()}function N(){const t=16,i=h.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&&h.has(e,this._key)},t.prototype.get=function(t){const e=s(t,!1);return void 0!==e?h.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@@"+l()}while(h.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:h.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(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t)}function l(){const e=a(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;let i="";for(let n=0;n<t;++n){const t=e[n];4!==n&&6!==n&&8!==n||(i+="-"),t<16&&(i+="0"),i+=t.toString(16).toLowerCase()}return i}}function W(t){return t.__=void 0,delete t.__,t}t("defineMetadata",p),t("hasMetadata",f),t("hasOwnMetadata",g),t("getMetadata",m)}(n)}(),t}(P||(P={}));function M(t,e,i,n){!function(t){if(void 0!==t)throw new Error(B)}(e),R(c,t,i.toString(),n)}function k(t){let e=[];if(Array.isArray(t)){e=t;const i=function(t){const e=new Set;for(const i of t){if(e.has(i))return i;e.add(i)}}(e.map((t=>t.key)));if(void 0!==i)throw new Error(`${m} ${i.toString()}`)}else e=[t];return e}function R(t,e,i,n){const r=k(n);let s={};E.hasOwnMetadata(t,e)&&(s=E.getMetadata(t,e));let o=s[i];if(void 0===o)o=[];else for(const t of o)if(r.some((e=>e.key===t.key)))throw new Error(`${m} ${t.key.toString()}`);o.push(...r),s[i]=o,E.defineMetadata(t,s,e)}function O(t){return(e,i,n)=>{"number"==typeof n?M(e,i,n,t):function(t,e,i){if(void 0!==t.prototype)throw new Error(B);R(u,t.constructor,e,i)}(e,i,t)}}function D(t){return e=>(i,n,r)=>{if(void 0===e){const t="function"==typeof i?i.name:i.constructor.name;throw new Error(`@inject called with undefined this could mean that the class ${t} has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.`)}return O(new C(t,e))(i,n,r)}}const I=D(h),L=D(l);function U(){return function(t){if(E.hasOwnMetadata(d,t))throw new Error("Cannot apply @injectable decorator multiple times.");const e=E.getMetadata("design:paramtypes",t)||[];return E.defineMetadata(d,e,t),t}}function N(t){return O(new C(r,t))}function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(r=n.key,s=void 0,"symbol"==typeof(s=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"))?s:String(s)),n)}var r,s}function z(t,e,i){return e&&j(t.prototype,e),i&&j(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function G(t){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},G(t)}function H(t,e){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},H(t,e)}function V(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=G(t);if(e){var r=G(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return V(this,i)}}function X(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":W(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 q(t,e){return function(i,n){e(i,n,t)}}function K(t,e){if("object"===("undefined"==typeof Reflect?"undefined":W(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function $(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Z={Request:"Request",Singleton:"Singleton",Transient:"Transient"},J={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},Q={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};class tt{constructor(t,e){this.id=i(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=J.Invalid,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}clone(){const t=new tt(this.serviceIdentifier,this.scope);return t.activated=t.scope===Z.Singleton&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.onDeactivation=this.onDeactivation,t.cache=this.cache,t}}class et{getConstructorMetadata(t){return{compilerGeneratedMetadata:E.getMetadata(d,t),userGeneratedMetadata:E.getMetadata(c,t)||{}}}getPropertiesMetadata(t){return E.getMetadata(u,t)||[]}}const it={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function nt(t){if("function"==typeof t){return t.name}if("symbol"==typeof t)return t.toString();return t}function rt(t,e,i){let n="";const r=i(t,e);return 0!==r.length&&(n="\nRegistered bindings:",r.forEach((t=>{let e="Object";null!==t.implementationType&&(e=st(t.implementationType)),n=`${n}\n ${e}`,t.constraint.metaData&&(n=`${n} - ${t.constraint.metaData}`)}))),n}function st(t){if(t.name)return t.name;const e=t.toString(),i=e.match(/^function\s*([^\s(]+)/);return i?i[1]:`Anonymous function: ${e}`}class ot{constructor(t){this.id=i(),this.container=t}addPlan(t){this.plan=t}setCurrentRequest(t){this.currentRequest=t}}class at{constructor(t,e){this.parentContext=t,this.rootRequest=e}}class ht{constructor(t){this._cb=t}unwrap(){return this._cb()}}class lt{constructor(t){this.str=t}startsWith(t){return 0===this.str.indexOf(t)}endsWith(t){let e="";const i=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},i)}contains(t){return-1!==this.str.indexOf(t)}equals(t){return this.str===t}value(){return this.str}}class ct{constructor(t,e,n,s){this.id=i(),this.type=t,this.serviceIdentifier=n;const o="symbol"==typeof e?e.toString().slice(7,-1):e;this.name=new lt(o||""),this.identifier=e,this.metadata=[];let a=null;"string"==typeof s?a=new C(r,s):s instanceof C&&(a=s),null!==a&&this.metadata.push(a)}hasTag(t){for(const e of this.metadata)if(e.key===t)return!0;return!1}isArray(){return this.hasTag(l)}matchesArray(t){return this.matchesTag(l)(t)}isNamed(){return this.hasTag(r)}isTagged(){return this.metadata.some((t=>g.every((e=>t.key!==e))))}isOptional(){return this.matchesTag(a)(!0)}getNamedTag(){return this.isNamed()?this.metadata.filter((t=>t.key===r))[0]:null}getCustomTags(){return this.isTagged()?this.metadata.filter((t=>g.every((e=>t.key!==e)))):null}matchesNamedTag(t){return this.matchesTag(r)(t)}matchesTag(t){return e=>{for(const i of this.metadata)if(i.key===t&&i.value===e)return!0;return!1}}}function ut(t,e,i,n){const r=t.getConstructorMetadata(i),s=r.compilerGeneratedMetadata;if(void 0===s){throw new Error(`${A} ${e}.`)}const o=r.userGeneratedMetadata,a=Object.keys(o),h=0===i.length&&a.length>0,l=a.length>i.length,c=function(t,e,i,n,r){const s=[];for(let o=0;o<r;o++){const r=dt(o,t,e,i,n);null!==r&&s.push(r)}return s}(n,e,s,o,h||l?a.length:i.length);return[...c,...ft(t,i,e)]}function dt(t,e,i,n,r){const s=r[t.toString()]||[],o=mt(s),a=!0!==o.unmanaged;let h=n[t];const l=o.inject||o.multiInject;if(h=l||h,h instanceof ht&&(h=h.unwrap()),a){if(!e&&(h===Object||h===Function||void 0===h)){throw new Error(`${T} argument ${t} in class ${i}.`)}const n=new ct(Q.ConstructorArgument,o.targetName,h);return n.metadata=s,n}return null}function pt(t,e,i,n){const r=t||e;if(void 0===r){const t=`${A} for property ${String(i)} in class ${n}.`;throw new Error(t)}return r}function ft(t,e,i){const n=t.getPropertiesMetadata(e);let r=[];const s=Object.getOwnPropertySymbols(n),o=Object.keys(n).concat(s);for(const t of o){const e=n[t],s=mt(e),o=s.targetName||t,a=pt(s.inject,s.multiInject,t,i),h=new ct(Q.ClassProperty,o,a);h.metadata=e,r.push(h)}const a=Object.getPrototypeOf(e.prototype).constructor;if(a!==Object){const e=ft(t,a,i);r=[...r,...e]}return r}function gt(t,e){const i=Object.getPrototypeOf(e.prototype).constructor;if(i!==Object){const e=ut(t,st(i),i,!0),n=e.map((t=>t.metadata.filter((t=>t.key===o)))),r=[].concat.apply([],n).length,s=e.length-r;return s>0?s:gt(t,i)}return 0}function mt(t){const e={};return t.forEach((t=>{e[t.key.toString()]=t.value})),{inject:e[h],multiInject:e[l],targetName:e[s],unmanaged:e[o]}}class yt{constructor(t,e,n,r,s){this.id=i(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=s,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}addChildRequest(t,e,i){const n=new yt(t,this.parentContext,this,e,i);return this.childRequests.push(n),n}}function vt(t){return t._bindingDictionary}function bt(t,e,i,n,r){let s=At(i.container,r.serviceIdentifier),o=[];return s.length===it.NoBindingsAvailable&&i.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(r.serviceIdentifier).toSelf(),s=At(i.container,r.serviceIdentifier)),o=e?s:s.filter((t=>{const e=new yt(t.serviceIdentifier,i,n,t,r);return t.constraint(e)})),function(t,e,i,n){switch(e.length){case it.NoBindingsAvailable:if(i.isOptional())return e;const r=nt(t);let s=x;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){let i="";const n=e.getNamedTag(),r=e.getCustomTags();return null!==n&&(i+=n.toString()+"\n"),null!==r&&r.forEach((t=>{i+=t.toString()+"\n"})),` ${t}\n ${t} - ${i}`}return` ${t}`}(r,i),s+=rt(n,r,At),new Error(s);case it.OnlyOneBindingAvailable:return e;case it.MultipleBindingsAvailable:default:if(i.isArray())return e;{const e=nt(t);let i=`${b} ${e}`;throw i+=rt(n,e,At),new Error(i)}}}(r.serviceIdentifier,o,r,i.container),o}function xt(t,e,i,n,r,s){let o,a;if(null===r){o=bt(t,e,n,null,s),a=new yt(i,n,null,o,s);const r=new at(n,a);n.addPlan(r)}else o=bt(t,e,n,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((e=>{let i=null;if(s.isArray())i=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;i=a}if(e.type===J.Instance&&null!==e.implementationType){const r=function(t,e){return ut(t,st(e),e,!1)}(t,e.implementationType);if(!n.container.options.skipBaseClassChecks){const i=gt(t,e.implementationType);if(r.length<i){const t=w(st(e.implementationType));throw new Error(t)}}r.forEach((e=>{xt(t,!1,e.serviceIdentifier,n,i,e)}))}}))}function At(t,e){let i=[];const n=vt(t);return n.hasKey(e)?i=n.get(e):null!==t.parent&&(i=At(t.parent,e)),i}function Tt(t,e,i,n,r,s,o,a=!1){const c=new ot(e),u=function(t,e,i,n,r,s){const o=new C(t?l:h,i),a=new ct(e,n,i,o);if(void 0!==r){const t=new C(r,s);a.metadata.push(t)}return a}(i,n,r,"",s,o);return xt(t,a,r,c,null,u),c}function Bt(t){return("object"==typeof t&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function wt(t){return!!Bt(t)||Array.isArray(t)&&t.some(Bt)}const St=(t,e,i)=>{t.has(e.id)||t.set(e.id,i)},_t=(t,e)=>{t.cache=e,t.activated=!0,Bt(e)&&Ct(t,e)},Ct=(t,e)=>$(void 0,void 0,void 0,(function*(){try{const i=yield e;t.cache=i}catch(e){throw t.cache=null,t.activated=!1,e}}));var Pt;!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(Pt||(Pt={}));function Et(t,e,i){let n;if(e.length>0){const r=function(t,e){return t.reduce(((t,i)=>{const n=e(i);return i.target.type===Q.ConstructorArgument?t.constructorInjections.push(n):(t.propertyRequests.push(i),t.propertyInjections.push(n)),t.isAsync||(t.isAsync=wt(n)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,i),s=Object.assign(Object.assign({},r),{constr:t});n=r.isAsync?function(t){return $(this,void 0,void 0,(function*(){const e=yield kt(t.constructorInjections),i=yield kt(t.propertyInjections);return Mt(Object.assign(Object.assign({},t),{constructorInjections:e,propertyInjections:i}))}))}(s):Mt(s)}else n=new t;return n}function Mt(t){const e=new t.constr(...t.constructorInjections);return t.propertyRequests.forEach(((i,n)=>{const r=i.target.identifier,s=t.propertyInjections[n];e[r]=s})),e}function kt(t){return $(this,void 0,void 0,(function*(){const e=[];for(const i of t)Array.isArray(i)?e.push(Promise.all(i)):e.push(i);return Promise.all(e)}))}function Rt(t,e){const i=function(t,e){var i,n;if(E.hasMetadata(p,t)){return null===(n=(i=e)[E.getMetadata(p,t).value])||void 0===n?void 0:n.call(i)}}(t,e);return Bt(i)?i.then((()=>e)):e}function Ot(t,e){t.scope!==Z.Singleton&&function(t,e){const i=`Class cannot be instantiated in ${t.scope===Z.Request?"request":"transient"} scope.`;if("function"==typeof t.onDeactivation)throw new Error(_(e.name,i));if(E.hasMetadata(f,e))throw new Error(S(e.name,i))}(t,e)}const Dt=t=>e=>{e.parentContext.setCurrentRequest(e);const i=e.bindings,n=e.childRequests,r=e.target&&e.target.isArray(),s=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(r&&s)return n.map((e=>Dt(t)(e)));if(e.target.isOptional()&&0===i.length)return;const o=i[0];return Nt(t,e,o)},It=(t,e)=>{const i=(t=>{switch(t.type){case J.Factory:return{factory:t.factory,factoryType:Pt.Factory};case J.Provider:return{factory:t.provider,factoryType:Pt.Provider};case J.DynamicValue:return{factory:t.dynamicValue,factoryType:Pt.DynamicValue};default:throw new Error(`Unexpected factory type ${t.type}`)}})(t);return(()=>i.factory.bind(t)(e))()},Lt=(t,e,i)=>{let n;const r=e.childRequests;switch((t=>{let e=null;switch(t.type){case J.ConstantValue:case J.Function:e=t.cache;break;case J.Constructor:case J.Instance:e=t.implementationType;break;case J.DynamicValue:e=t.dynamicValue;break;case J.Provider:e=t.provider;break;case J.Factory:e=t.factory}if(null===e){const e=nt(t.serviceIdentifier);throw new Error(`Invalid binding type: ${e}`)}})(i),i.type){case J.ConstantValue:case J.Function:n=i.cache;break;case J.Constructor:n=i.implementationType;break;case J.Instance:n=function(t,e,i,n){Ot(t,e);const r=Et(e,i,n);return Bt(r)?r.then((t=>Rt(e,t))):Rt(e,r)}(i,i.implementationType,r,Dt(t));break;default:n=It(i,e.parentContext)}return n},Ut=(t,e,i)=>{let n=((t,e)=>e.scope===Z.Singleton&&e.activated?e.cache:e.scope===Z.Request&&t.has(e.id)?t.get(e.id):null)(t,e);return null!==n||(n=i(),((t,e,i)=>{e.scope===Z.Singleton&&_t(e,i),e.scope===Z.Request&&St(t,e,i)})(t,e,n)),n},Nt=(t,e,i)=>Ut(t,i,(()=>Lt(t,e,i)));class Wt{constructor(t){this._binding=t}}const Ft=(jt=r,t=>{const e=e=>null!==e&&null!==e.target&&e.target.matchesTag(jt)(t);return e.metaData=new C(jt,t),e});var jt;class zt{constructor(t){this._binding=t}whenTargetNamed(t){return this._binding.constraint=Ft(t),new Wt(this._binding)}}class Gt{constructor(t){this._binding=t,this._bindingWhenSyntax=new zt(this._binding)}whenTargetNamed(t){return this._bindingWhenSyntax.whenTargetNamed(t)}}class Ht{constructor(t){this._binding=t}inRequestScope(){return this._binding.scope=Z.Request,new Gt(this._binding)}inSingletonScope(){return this._binding.scope=Z.Singleton,new Gt(this._binding)}inTransientScope(){return this._binding.scope=Z.Transient,new Gt(this._binding)}}class Vt{constructor(t){this._binding=t,this._bindingWhenSyntax=new zt(this._binding),this._bindingInSyntax=new Ht(t)}inRequestScope(){return this._bindingInSyntax.inRequestScope()}inSingletonScope(){return this._bindingInSyntax.inSingletonScope()}inTransientScope(){return this._bindingInSyntax.inTransientScope()}whenTargetNamed(t){return this._bindingWhenSyntax.whenTargetNamed(t)}}class Yt{constructor(t){this._binding=t}to(t){return this._binding.type=J.Instance,this._binding.implementationType=t,new Vt(this._binding)}toSelf(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");const t=this._binding.serviceIdentifier;return this.to(t)}toConstantValue(t){return this._binding.type=J.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Z.Singleton,new Gt(this._binding)}toDynamicValue(t){return this._binding.type=J.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Vt(this._binding)}toConstructor(t){return this._binding.type=J.Constructor,this._binding.implementationType=t,this._binding.scope=Z.Singleton,new Gt(this._binding)}toFactory(t){return this._binding.type=J.Factory,this._binding.factory=t,this._binding.scope=Z.Singleton,new Gt(this._binding)}toFunction(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");const e=this.toConstantValue(t);return this._binding.type=J.Function,this._binding.scope=Z.Singleton,e}toAutoFactory(t){return this._binding.type=J.Factory,this._binding.factory=e=>()=>e.container.get(t),this._binding.scope=Z.Singleton,new Gt(this._binding)}toAutoNamedFactory(t){return this._binding.type=J.Factory,this._binding.factory=e=>i=>e.container.getNamed(t,i),new Gt(this._binding)}toProvider(t){return this._binding.type=J.Provider,this._binding.provider=t,this._binding.scope=Z.Singleton,new Gt(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}class Xt{constructor(){this._map=new Map}getMap(){return this._map}add(t,e){if(null==t)throw new Error(y);if(null==e)throw new Error(y);const i=this._map.get(t);void 0!==i?i.push(e):this._map.set(t,[e])}get(t){if(null==t)throw new Error(y);const e=this._map.get(t);if(void 0!==e)return e;throw new Error(v)}remove(t){if(null==t)throw new Error(y);if(!this._map.delete(t))throw new Error(v)}removeIntersection(t){this.traverse(((e,i)=>{const n=t.hasKey(e)?t.get(e):void 0;if(void 0!==n){const t=i.filter((t=>!n.some((e=>t===e))));this._setValue(e,t)}}))}removeByCondition(t){const e=[];return this._map.forEach(((i,n)=>{const r=[];for(const n of i){t(n)?e.push(n):r.push(n)}this._setValue(n,r)})),e}hasKey(t){if(null==t)throw new Error(y);return this._map.has(t)}clone(){const t=new Xt;return this._map.forEach(((e,i)=>{e.forEach((e=>{return t.add(i,"object"==typeof(n=e)&&null!==n&&"clone"in n&&"function"==typeof n.clone?e.clone():e);var n}))})),t}traverse(t){this._map.forEach(((e,i)=>{t(i,e)}))}_setValue(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)}}class qt{static merge(t,e,...i){const n=new qt,r=[t,e,...i].map((t=>vt(t))),s=vt(n);return r.forEach((t=>{var e;e=s,t.traverse(((t,i)=>{i.forEach((t=>{e.add(t.serviceIdentifier,t.clone())}))}))})),n}constructor(t){const e=t||{};if("object"!=typeof e)throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=Z.Transient;else if(e.defaultScope!==Z.Singleton&&e.defaultScope!==Z.Transient&&e.defaultScope!==Z.Request)throw new Error('Invalid Container option. Default scope must be a string ("singleton" or "transient").');if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=i(),this._bindingDictionary=new Xt,this.parent=null,this._metadataReader=new et}load(...t){const e=this._getContainerModuleHelpersFactory();for(const i of t){const t=e(i.id);i.registry(t.bindFunction,t.unbindFunction,t.isboundFunction,t.rebindFunction)}}unload(...t){t.forEach((t=>{const e=this._removeModuleBindings(t.id);this._deactivateSingletons(e)}))}bind(t){const e=this.options.defaultScope||Z.Transient,i=new tt(t,e);return this._bindingDictionary.add(t,i),new Yt(i)}rebind(t){return this.unbind(t),this.bind(t)}unbind(t){if(this._bindingDictionary.hasKey(t)){const e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)}unbindAll(){this._bindingDictionary.traverse(((t,e)=>{this._deactivateSingletons(e)})),this._bindingDictionary=new Xt}isBound(t){let e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e}isCurrentBound(t){return this._bindingDictionary.hasKey(t)}isBoundNamed(t,e){return this.isBoundTagged(t,r,e)}isBoundTagged(t,e,i){let n=!1;if(this._bindingDictionary.hasKey(t)){const r=this._bindingDictionary.get(t),s=function(t,e,i,n){const r=new ct(Q.Variable,"",e,new C(i,n)),s=new ot(t);return new yt(e,s,null,[],r)}(this,t,e,i);n=r.some((t=>t.constraint(s)))}return!n&&this.parent&&(n=this.parent.isBoundTagged(t,e,i)),n}applyCustomMetadataReader(t){this._metadataReader=t}get(t){const e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)}getAsync(t){return $(this,void 0,void 0,(function*(){const e=this._getNotAllArgs(t,!1);return this._get(e)}))}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._getButThrowIfAsync(n)}getNamed(t,e){return this.getTagged(t,r,e)}getAll(t){const e=this._getAllArgs(t);return this._getButThrowIfAsync(e)}getAllTagged(t,e,i){const n=this._getNotAllArgs(t,!0,e,i);return this._getButThrowIfAsync(n)}getAllNamed(t,e){return this.getAllTagged(t,r,e)}resolve(t){const e=this.isBound(t);e||this.bind(t).toSelf();const i=this.get(t);return e||this.unbind(t),i}_preDestroy(t,e){var i,n;if(E.hasMetadata(f,t)){return null===(n=(i=e)[E.getMetadata(f,t).value])||void 0===n?void 0:n.call(i)}}_removeModuleBindings(t){return this._bindingDictionary.removeByCondition((e=>e.moduleId===t))}_deactivate(t,e){const i=Object.getPrototypeOf(e).constructor;try{const n=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i);if(Bt(n))return this._handleDeactivationError(n,i)}catch(t){if(t instanceof Error)throw new Error(_(i.name,t.message))}}_handleDeactivationError(t,e){return $(this,void 0,void 0,(function*(){try{yield t}catch(t){if(t instanceof Error)throw new Error(_(e.name,t.message))}}))}_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})}_get(t){const e=Object.assign(Object.assign({},t),{contextInterceptor:t=>t,targetType:Q.Variable});return this._planAndResolve()(e)}_getButThrowIfAsync(t){const e=this._get(t);if(wt(e))throw new Error((t=>`You are attempting to construct '${t}' in a synchronous way\n but it has asynchronous dependencies.`)(t.serviceIdentifier));return e}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_planAndResolve(){return t=>{let e=Tt(this._metadataReader,this,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints);e=t.contextInterceptor(e);const i=function(t){return Dt(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(e);return i}}_deactivateIfSingleton(t){if(t.activated)return Bt(t.cache)?t.cache.then((e=>this._deactivate(t,e))):this._deactivate(t,t.cache)}_deactivateSingletons(t){for(const e of t){if(Bt(this._deactivateIfSingleton(e)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}}_propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,i)}_removeServiceFromDictionary(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(`Could not unbind serviceIdentifier: ${nt(t)}`)}}_bindingDeactivationAndPreDestroy(t,e,i){if("function"==typeof t.onDeactivation){const n=t.onDeactivation(e);if(Bt(n))return n.then((()=>this._preDestroy(i,e)))}return this._preDestroy(i,e)}_bindingDeactivationAndPreDestroyAsync(t,e,i){return $(this,void 0,void 0,(function*(){"function"==typeof t.onDeactivation&&(yield t.onDeactivation(e)),yield this._preDestroy(i,e)}))}}const Kt=($t=p,Zt="Cannot apply @postConstruct decorator multiple times in the same class",()=>(t,e)=>{const i=new C($t,e);if(E.hasOwnMetadata($t,t.constructor))throw new Error(Zt);E.defineMetadata($t,i,t.constructor)});var $t,Zt;const Jt=Symbol("ContributionProvider");class Qt{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 te(t,e){t(Jt).toDynamicValue((({container:t})=>new Qt(e,t))).inSingletonScope().whenTargetNamed(e)}function ee(t,e){t(Jt).toDynamicValue((({container:t})=>new Qt(e,t))).whenTargetNamed(e)}class ie{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 ne extends ie{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const re=Symbol.for("EnvContribution"),se=Symbol.for("VGlobal"),oe="browser";function ae(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(oe),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(oe),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv(oe),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv(oe),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv(oe),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv(oe),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new ne(["lastEnv","env","global"])},this.measureTextMethod="native"}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(oe),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(oe),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(oe),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(oe),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(oe),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(oe),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(oe),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(oe),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(oe),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(oe),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(oe),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(oe),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(oe),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(oe),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 this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}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)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=X([U(),q(0,I(Jt)),q(0,N(re)),K("design:paramtypes",[Object])],t.DefaultGlobal);var he={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),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=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 h,l,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(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}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 h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||r&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l: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}(he);var le=ae(he.exports),ce=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},ue=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||ce(t,"Boolean")},de=function(t){return"function"==typeof t},pe=function(t){return null==t},fe=function(t){return null!=t},ge=function(t){var e=W(t);return null!==t&&"object"===e||"function"===e},me=function(t){return void 0===t},ye=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=W(t);return e?"string"===i:"string"===i||ce(t,"String")},ve=function(t){return Array.isArray?Array.isArray(t):ce(t,"Array")},be=function(t){return ce(t,"Date")},xe=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=W(t);return e?"number"===i:"number"===i||ce(t,"Number")},Ae=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},Te=function(t){return ce(t,"RegExp")},Be=function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)},we=function(t,e,i){for(var n=ye(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},Se=Object.prototype.hasOwnProperty,_e=function(t,e){return null!=t&&Se.call(t,e)};function Ce(t,e){if(!ve(t)||!ve(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var Pe=1e-10,Ee=1e-10;function Me(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pe,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ee)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var ke=function(t,e,i){return t<e?e:t>i?i:t},Re=1e-12,Oe=Math.PI,De=Oe/2,Ie=2*Oe,Le=2*Math.PI,Ue=Math.abs,Ne=Math.atan2,We=Math.cos,Fe=Math.max,je=Math.min,ze=Math.sin,Ge=Math.sqrt,He=Math.pow;function Ve(t){return t>1?0:t<-1?Oe:Math.acos(t)}function Ye(t){return t>=1?De:t<=-1?-De:Math.asin(t)}function Xe(t,e,i,n,r){var s,o;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 qe(t,e){return t[0]*e[1]-t[1]*e[0]}var Ke=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;F(this,t),this.x=0,this.y=0,this.x=e,this.y=i,this.x1=n,this.y1=r}return z(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(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}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return xe(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return xe(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}]),t}(),$e=function(){function t(){F(this,t)}return z(t,null,[{key:"distancePP",value:function(t,e){return Ge(He(t.x-e.x,2)+He(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return Ge(He(t-i,2)+He(e-n,2))}},{key:"distancePN",value:function(t,e,i){return Ge(He(e-t.x,2)+He(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new Ke((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}]),t}();function Ze(t,e,i){var n=e.x1,r=e.y1,s=e.x2,o=e.y2;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)}var Je=function(){function t(e){F(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return z(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var 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}},{key:"set",value:function(){var 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}},{key:"add",value:function(){var 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}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return ve(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}},{key:"round",value:function(){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}},{key:"translate",value:function(){var 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}},{key:"rotate",value:function(){var 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=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])}},{key:"scale",value:function(){var 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,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(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}},{key:"intersect",value:function(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}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var 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)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return Ze(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,s=this.x2,o=this.y2,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*r+l,h*n+a*r+c,a*n-h*o+l,h*n+a*o+c,a*s-h*r+l,h*s+a*r+c,a*s-h*o+l,h*s+a*o+c]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}]),t}(),Qe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&H(t,e)}(i,t);var e=Y(i);function i(){return F(this,i),e.apply(this,arguments)}return z(i)}(Je);var ti=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Ie;)t+=Ie;else if(t>0)for(;t>Ie;)t-=Ie;return t};function ei(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var ii=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;F(this,t),this.a=e,this.b=i,this.c=n,this.d=r,this.e=s,this.f=o}return z(t,[{key:"equalToMatrix",value:function(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)}},{key:"equalTo",value:function(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)}},{key:"setValue",value:function(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}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.e,o=this.f,a=new t,h=e*r-i*n;return a.a=r/h,a.b=-i/h,a.c=-n/h,a.d=e/h,a.e=(n*o-r*s)/h,a.f=-(e*o-i*s)/h,a}},{key:"rotate",value:function(t){var 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}},{key:"rotateByCenter",value:function(t,e,i){var 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,h=r*this.a+n*this.b,l=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=h,this.c=l,this.d=c,this.e=u,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}},{key:"multiply",value:function(t,e,i,n,r,s){var o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,u=a*t+l*e,d=o*i+h*n,p=a*i+l*n,f=o*r+h*s+this.e,g=a*r+l*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}},{key:"interpolate",value:function(e,i){var n=new t;return n.a=this.a+(e.a-this.a)*i,n.b=this.b+(e.b-this.b)*i,n.c=this.c+(e.c-this.c)*i,n.d=this.d+(e.d-this.d)*i,n.e=this.e+(e.e-this.e)*i,n.f=this.f+(e.f-this.f)*i,n}},{key:"transformPoint",value:function(t,e){var i=this.a,n=this.b,r=this.c,s=this.d,o=this.e,a=this.f,h=i*s-n*r,l=s/h,c=-n/h,u=-r/h,d=i/h,p=(r*a-s*o)/h,f=-(i*a-n*o)/h,g=t.x,m=t.y;e.x=g*l+m*u+p,e.y=g*c+m*d+f}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var 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){var 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){var a=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}]),t}();function ni(t,e,i){e/=100,i/=100;var n=(1-Math.abs(2*i-1))*e,r=n*(1-Math.abs(t/60%2-1)),s=i-n/2,o=0,a=0,h=0;return 0<=t&&t<60?(o=n,a=r,h=0):60<=t&&t<120?(o=r,a=n,h=0):120<=t&&t<180?(o=0,a=n,h=r):180<=t&&t<240?(o=0,a=r,h=n):240<=t&&t<300?(o=r,a=0,h=n):300<=t&&t<360&&(o=n,a=0,h=r),{r:o=Math.round(255*(o+s)),g:a=Math.round(255*(a+s)),b:h=Math.round(255*(h+s))}}function ri(t,e,i){t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),s=r-n,o=0,a=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))<0&&(o+=360),a=(r+n)/2,{h:o,s:+(100*(0===s?0:s/(1-Math.abs(2*a-1)))).toFixed(1),l:a=+(100*a).toFixed(1)}}var si=/^#([0-9a-f]{3,8})$/,oi={transparent:4294967040},ai={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 hi(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function li(t){return xe(t)?new pi(t>>16,t>>8&255,255&t,1):ve(t)?new pi(t[0],t[1],t[2]):new pi(255,255,255)}function ci(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ui(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var di=function(){function t(e){F(this,t);var i=t.parseColorString(e);i?this.color=i:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new pi(255,255,255))}return z(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"brighter",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}},{key:"add",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r+=Math.min(255,i+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,r+t.color.b),this}},{key:"sub",value:function(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}},{key:"multiply",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(i*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t.color.b))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){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)}},{key:"setHsl",value:function(t,e,i){var n=this.color.opacity,r=ri(this.color.r,this.color.g,this.color.b),s=ni(pe(t)?r.h:ke(t,0,360),pe(e)?r.s:e>=0&&e<=1?100*e:e,pe(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new pi(s.r,s.g,s.b,n),this}},{key:"setRGB",value:function(t,e,i){return!pe(t)&&(this.color.r=t),!pe(e)&&(this.color.g=e),!pe(i)&&(this.color.b=i),this}},{key:"setHex",value:function(t){var e="".concat(t).trim().toLowerCase(),i=si.exec(e),n=parseInt(i[1],16),r=i[1].length;return 3===r?new pi((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):6===r?li(n):8===r?new pi(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):this}},{key:"setColorName",value:function(t){var e=ai[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"setScalar",value:function(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}},{key:"clone",value:function(){return new t(this.color.toString())}},{key:"copyGammaToLinear",value:function(t){var 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}},{key:"copyLinearToGamma",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,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}},{key:"convertGammaToLinear",value:function(t){return this.copyGammaToLinear(this,t),this}},{key:"convertLinearToGamma",value:function(t){return this.copyLinearToGamma(this,t),this}},{key:"copySRGBToLinear",value:function(t){return this.color.r=ci(t.color.r),this.color.g=ci(t.color.g),this.color.b=ci(t.color.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.color.r=ui(t.color.r),this.color.g=ui(t.color.g),this.color.b=ui(t.color.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}}],[{key:"Brighter",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===i?e:new t(e).brighter(i).toRGBA()}},{key:"SetOpacity",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===i?e:new t(e).setOpacity(i).toRGBA()}},{key:"getColorBrightness",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",n=e instanceof t?e:new t(e);switch(i){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3()}}},{key:"parseColorString",value:function(t){if(fe(oi[t]))return function(t){return xe(t)?new pi(t>>>24,t>>>16&255,t>>>8&255,255&t):ve(t)?new pi(t[0],t[1],t[2],t[3]):new pi(255,255,255,1)}(oi[t]);if(fe(ai[t]))return li(ai[t]);var e="".concat(t).trim().toLowerCase(),i=si.exec(e);if(i){var n=parseInt(i[1],16),r=i[1].length;return 3===r?new pi((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):6===r?li(n):8===r?new pi(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var s=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new pi(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10),parseFloat(s[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var o=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),a=ni(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10));return new pi(a.r,a.g,a.b,parseFloat(o[3]))}}}]),t}(),pi=function(){function t(e,i,n,r){F(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),fe(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}return z(t,[{key:"formatHex",value:function(){return"#".concat(hi(this.r)+hi(this.g)+hi(this.b)+(1===this.opacity?"":hi(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=ri(this.r,this.g,this.b),i=e.h,n=e.s,r=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(i,",").concat(n,"%,").concat(r,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}]),t}();var fi,gi,mi,yi,vi,bi,xi,Ai,Ti,Bi=Object.freeze({__proto__:null,Color:di,DEFAULT_COLORS:ai,RGB:pi,hexToRgb:function(t){for(var e="",i="",n="",r="#"===t[0]?1:0,s=r;s<t.length;s++)"#"!==t[s]&&(s<r+2?e+=t[s]:s<r+4?i+=t[s]:s<r+6&&(n+=t[s]));return[parseInt(e,16),parseInt(i,16),parseInt(n,16)]},hslToRgb:ni,interpolateRgb:function(t,e){var i=t.r,n=e.r,r=t.g,s=e.g,o=t.b,a=e.b,h=t.opacity,l=e.opacity;return function(t){var e=Math.round(i*(1-t)+n*t),c=Math.round(r*(1-t)+s*t),u=Math.round(o*(1-t)+a*t);return new pi(e,c,u,h*(1-t)+l*t)}},rgbToHex:function(t,e,i){return Number((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},rgbToHsl:ri});function wi(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Si(t,e,i,n){if(!function(t,e,i,n){var r,s=t[0],o=e[0],a=i[0],h=n[0];return o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),!(o<a||h<s||(s=t[1],o=e[1],a=i[1],h=n[1],o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),o<a||h<s))}(t,e,i,n))return!1;var r,s,o=[0,0],a=[0,0],h=[0,0];if(wi(o,e,t),wi(a,n,i),Ue((r=o)[0]-(s=a)[0])+Ue(r[1]-s[1])<1e-12)return!0;wi(h,i,t);var l=qe(h,a)/qe(o,a);return l>=0&&l<=1&&[t[0]+o[0]*l,t[1]+o[1]*l]}function _i(t,e,i){var n,r,s,o;return!(t&&e&&(i?(fi=t.x1,gi=t.x2,mi=t.y1,yi=t.y2,vi=e.x1,bi=e.x2,xi=e.y1,Ai=e.y2,fi>gi&&(n=[gi,fi],fi=n[0],gi=n[1]),mi>yi&&(r=[yi,mi],mi=r[0],yi=r[1]),vi>bi&&(s=[bi,vi],vi=s[0],bi=s[1]),xi>Ai&&(o=[Ai,xi],xi=o[0],Ai=o[1]),fi>bi||gi<vi||mi>Ai||yi<xi):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"}(Ti||(Ti={}));var Ci=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),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"};var Pi=function(){function t(e,i){F(this,t),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=e,this._userSpec=null!=i?i:{},this.textSpec=this._initSpec(),fe(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=fe(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return z(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(pe(this._canvas)&&(fe(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),pe(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&fe(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),pe(this._context)&&fe(this._canvas)){var t=this._canvas.getContext("2d");fe(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.fontStyle,n=void 0===i?e.fontStyle:i,r=t.fontVariant,s=void 0===r?e.fontVariant:r,o=t.fontWeight,a=void 0===o?e.fontWeight:o,h=t.fontSize,l=void 0===h?e.fontSize:h,c=t.fontFamily;return(n?n+" ":"")+(s?s+" ":"")+(a?a+" ":"")+l+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!pe(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,s=this._userSpec,o=s.fontStyle,a=void 0===o?r.fontStyle:o,h=s.fontVariant,l=void 0===h?r.fontVariant:h,c=s.fontWeight,u=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,d=s.fontSize,p=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,f=s.fontFamily,g=void 0===f?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":f,m=s.align,y=s.textAlign,v=void 0===y?null!=m?m:"center":y,b=s.baseline,x=s.textBaseline,A=void 0===x?null!=b?b:"middle":x,T=s.ellipsis,B=s.limit,w=s.lineHeight;return{fontStyle:a,fontVariant:l,fontFamily:g,fontSize:p,fontWeight:u,textAlign:v,textBaseline:A,ellipsis:T,limit:B,lineHeight:void 0===w?p:w}}},{key:"measure",value:function(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)}}},{key:"fullMeasure",value:function(t){if(pe(t))return{width:0,height:0};if(pe(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,s=i.fontWeight,o=i.textAlign,a=i.textBaseline,h=i.ellipsis,l=i.limit,c=i.lineHeight;try{var u=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:s,textAlign:o,textBaseline:a,ellipsis:!!h,maxLineWidth:l||1/0,lineHeight:c});e={width:u.width(),height:u.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),i=this.textSpec,n=i.fontSize,r=i.lineHeight;return{width:e.width,height:null!=r?r:n}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],s=this._measureSpecialChar(r);pe(s)&&t.NUMBERS_CHAR_SET.includes(r)&&(s=this._measureNumberChar()),pe(s)&&["F","W"].includes(Ci(r))&&(s=this._measureFullSizeChar()),pe(s)&&(s=this._measureLetterChar()),i.width+=s.width,i.height=Math.max(i.height,s.height)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},i=this.textSpec,n=i.fontSize,r=i.lineHeight,s=0;s<t.length;s++){var o=t[s],a=["F","W"].includes(Ci(o))?1:.53;e.width+=a*n}return e.height=null!=r?r:n,e}},{key:"_measureReduce",value:function(t,e){var i=this.textSpec,n=i.fontSize,r=i.lineHeight,s={width:0,height:0};if(pe(t))return s;if(ve(t)){var o=t.filter(fe).map((function(t){return t.toString()}));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:o.length*((null!=r?r:n)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(pe(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return pe(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(pe(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return fe(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){fe(this._canvas)&&(this._canvas=null),fe(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();Pi.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Pi.NUMBERS_CHAR_SET="0123456789",Pi.FULL_SIZE_CHAR="字";const Ei=Ie-1e-8;class Mi{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Ei)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=Ie)<0&&(n+=Ie),(r%=Ie)<0&&(r+=Ie),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=Ie,o=n-n%De,a=0;a<4&&o>r;++a,o-=De)f(o);else for(o=n-n%De+De,a=0;a<4&&o<r;++a,o+=De)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(...t){}}class ki{constructor(){this.curves=[],this.bounds=new Qe}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Ri=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Oi={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},Di={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Ii,Li,Ui,Ni,Wi,Fi;function ji(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(Ii=e[t],Li=Ii.slice(1),Ui=Ii[0],i=[Ui],n=Li.match(Ri),null!==n){for(let t=0,e=n.length;t<e;t++)Ni=n[t],Wi=parseFloat(Ni),Number.isNaN(Wi)||i.push(Wi);if(Fi=Oi[Ui],i.length-1>Fi){let t;for(let e=1,n=i.length;e<n;e+=Fi){t=[Ui];for(let n=e,r=e+Fi;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var zi,Gi,Hi,Vi,Yi,Xi,qi,Ki;function $i(t,e,i,n,r,s,o,a,h){const l=o*(Math.PI/180);const c=Math.sin(l),u=Math.cos(l),d=u*(a-t)*.5+c*(h-e)*.5,p=u*(h-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,m=c/i,y=-c/n,v=u/n,b=g*a+m*h,x=y*a+v*h,A=g*t+m*e,T=y*t+v*e;let B=1/((A-b)*(A-b)+(T-x)*(T-x))-.25;B<0&&(B=0);let w=Math.sqrt(B);s===r&&(w=-w);const S=.5*(b+A)-w*(T-x),_=.5*(x+T)+w*(A-b),C=Math.atan2(x-_,b-S);let P=Math.atan2(T-_,A-S)-C;P<0&&1===s?P+=Ie:P>0&&0===s&&(P-=Ie);const E=Math.ceil(Math.abs(P/(De+.001))),M=[];for(let t=0;t<E;++t){const e=C+t*P/E,r=C+(t+1)*P/E;M[t]=[S,_,e,r,i,n,c,u]}return M}function Zi(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=h*s,c=-a*o,u=a*s,d=h*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),m=Math.sin(r),y=.5*(r-n),v=Math.sin(.5*y),b=8/3*v*v/Math.sin(y),x=e+p-b*f,A=i+f+b*p,T=e+g,B=i+m,w=T+b*m,S=B-b*g;return[l*x+c*A,u*x+d*A,l*w+c*S,u*w+d*S,l*T+c*B,u*T+d*B]}function Ji(t,e,i,n){const r=$i(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=Zi(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(zi=t.UpdateTag||(t.UpdateTag={}))[zi.NONE=0]="NONE",zi[zi.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",zi[zi.UPDATE_SHAPE=2]="UPDATE_SHAPE",zi[zi.CLEAR_SHAPE=253]="CLEAR_SHAPE",zi[zi.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",zi[zi.INIT=179]="INIT",zi[zi.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",zi[zi.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",zi[zi.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",zi[zi.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",zi[zi.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",zi[zi.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",zi[zi.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",zi[zi.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(Gi=t.IContainPointMode||(t.IContainPointMode={}))[Gi.GLOBAL=1]="GLOBAL",Gi[Gi.LOCAL=16]="LOCAL",Gi[Gi.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Gi[Gi.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Hi=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Hi.INIT=0]="INIT",Hi[Hi.DEFAULT=1]="DEFAULT",Hi[Hi.STATE=2]="STATE",Hi[Hi.ANIMATE_BIND=10]="ANIMATE_BIND",Hi[Hi.ANIMATE_PLAY=11]="ANIMATE_PLAY",Hi[Hi.ANIMATE_START=12]="ANIMATE_START",Hi[Hi.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Hi[Hi.ANIMATE_END=14]="ANIMATE_END",Hi[Hi.TRANSLATE=20]="TRANSLATE",Hi[Hi.TRANSLATE_TO=21]="TRANSLATE_TO",Hi[Hi.SCALE=22]="SCALE",Hi[Hi.SCALE_TO=23]="SCALE_TO",Hi[Hi.ROTATE=24]="ROTATE",Hi[Hi.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Vi=t.AnimateStatus||(t.AnimateStatus={}))[Vi.INITIAL=0]="INITIAL",Vi[Vi.RUNNING=1]="RUNNING",Vi[Vi.PAUSED=2]="PAUSED",Vi[Vi.END=3]="END",t.AnimateMode=void 0,(Yi=t.AnimateMode||(t.AnimateMode={}))[Yi.NORMAL=0]="NORMAL",Yi[Yi.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Xi=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Xi.from="from",Xi.to="to",Xi.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,(qi=t.CurveTypeEnum||(t.CurveTypeEnum={}))[qi.CubicBezierCurve=0]="CubicBezierCurve",qi[qi.QuadraticBezierCurve=1]="QuadraticBezierCurve",qi[qi.ArcCurve=2]="ArcCurve",qi[qi.LineCurve=3]="LineCurve",qi[qi.EllipseCurve=4]="EllipseCurve",qi[qi.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Ki=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Ki.beforeFillStroke=0]="beforeFillStroke",Ki[Ki.afterFillStroke=1]="afterFillStroke";const Qi=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),h=4*Math.tan(a/4)/3,l=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,m=d*s+n,y=p*o+r,v=s*h*l,b=o*h*l;t.push(f-v*u,g+b*c,m+v*p,y-b*d,m,y)},tn=[(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 en(t,e,i=0,n=0,r=1,s=1,o){for(let a=0;a<t.length;a++){const h=t[a];tn[h[0]](h,e,i,n,r,s,o)}}class nn{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function rn(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],h=e[(r+1)%n];i+=$e.distanceNN(s,o,a,h)}return i/2}function sn(t,e,i,n,r){return rn([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function on(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 an(t,e,i,n,r){const s=on(t.x,e.x,i.x,n.x,r),o=on(t.y,e.y,i.y,n.y,r);return new Ke(s,o)}function hn(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=an(i,n,r,s,e),a=$e.pointAtPP(i,n,e),h=$e.pointAtPP(n,r,e),l=$e.pointAtPP(r,s,e),c=$e.pointAtPP(a,h,e),u=$e.pointAtPP(h,l,e);return[new ln(i,a,c,o),new ln(o,u,l,s)]}class ln extends nn{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 an(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?sn(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Ue(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Ue(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Fe(t-.01,0),i=je(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return Ne(r.y-n.y,r.x-n.x)}}function cn(t,e){const{p0:i,p1:n}=t,r=$e.pointAtPP(i,n,e);return[new un(i,r),new un(r,n)]}class un extends nn{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return $e.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=Ne(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()?$e.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Ue(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Ue(this.p0.y-this.p1.y):0}}class dn{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 h=new ln(new Ke(this._lastX,this._lastY),new Ke(t,e),new Ke(i,n),new Ke(r,s));h.originP1=this._lastOriginP,h.originP2=a,h.defined=o,this.curves.push(h),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 un(new Ke(this._lastX,this._lastY),new Ke(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 Ue(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 Ue(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class pn extends dn{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 fn(t,e,i=1){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}class gn{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 mn(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new dn("linear",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return yn(new gn(s,r),e),s}function yn(t,e){return fn(t,e,1)}function vn(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 bn{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(){if(2===this._point)vn(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:vn(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 xn(t,e){return fn(t,e,2)}function An(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mn(e,i);const s=new dn("basis",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return xn(new bn(s,r),e),s}function Tn(t){return t<0?-1:1}function Bn(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(Tn(s)+Tn(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function wn(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Sn(t,e,i,n,r){const s=t._x0,o=t._y0,a=t._x1,h=t._y1,l=(a-s)/3;t.context.bezierCurveTo(s+l,o+l*e,a-l,h-l*i,a,h,n,t.lastPoint1)}class _n{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._lastDefined2,this.lastPoint1);break;case 3:Sn(this,this._t0,wn(this,this._t0),!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;if(i!==this._x1||n!==this._y1){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,Sn(this,wn(this,e=Bn(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Sn(this,this._t0,e=Bn(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 Cn extends _n{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Pn(t,e){return fn(t,e,2)}function En(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mn(e,i);const s=new dn("monotoneX",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Pn(new _n(s,r),e),s}function Mn(t,e){return fn(t,e,2)}function kn(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mn(e,i);const s=new pn("monotoneY",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Mn(new Cn(s,r),e),s}let Rn=class{constructor(t,e=.5,i){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 On(e,i,n={}){const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new dn("step",null!=r?r:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Dn(new Rn(o,i,s),e),o}function Dn(t,e){return fn(t,e,1)}class In{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.context.closePath()}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 Ln(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new dn("linear",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Un(new In(s,r),e),s}function Un(t,e){return fn(t,e,1)}function Nn(t,e,i){switch(e){case"linear":default:return mn(t,i);case"basis":return An(t,i);case"monotoneX":return En(t,i);case"monotoneY":return kn(t,i);case"step":return On(t,.5,i);case"stepBefore":return On(t,0,i);case"stepAfter":return On(t,1,i);case"linearClosed":return Ln(t,i)}}class Wn extends ki{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Mi(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Di.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Di.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Di.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([Di.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([Di.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([Di.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([Di.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([Di.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Di.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}toString(){if(!this.toStringCbList){const t=[];t[Di.M]=t=>`M${t[1]} ${t[2]}`,t[Di.L]=t=>`L${t[1]} ${t[2]}`,t[Di.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Di.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Di.A]=t=>{const e=[];Qi(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[Di.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=ji(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=Nn(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[Di.M]=this.moveToTransform,t[Di.L]=this.lineToTransform,t[Di.Q]=this.quadraticCurveToTransform,t[Di.C]=this.bezierCurveToTransform,t[Di.AT]=this.arcToTransform,t[Di.E]=this.ellipseTransform,t[Di.R]=this.rectTransform,t[Di.A]=this.arcTransform,t[Di.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,e=0,i=0,n=1,r=1){let s,o,a,h,l,c=null,u=0,d=0,p=0,f=0;for(let g=0,m=t.length;g<m;++g){switch(s=t[g],1===n&&1===r||(s=jn(s,n,r)),s[0]){case"l":u+=s[1],d+=s[2],this.lineTo(u+e,d+i);break;case"L":u=s[1],d=s[2],this.lineTo(u+e,d+i);break;case"h":u+=s[1],this.lineTo(u+e,d+i);break;case"H":u=s[1],this.lineTo(u+e,d+i);break;case"v":d+=s[1],this.lineTo(u+e,d+i);break;case"V":d=s[1],this.lineTo(u+e,d+i);break;case"m":u+=s[1],d+=s[2],this.moveTo(u+e,d+i);break;case"M":u=s[1],d=s[2],this.moveTo(u+e,d+i);break;case"c":o=u+s[5],a=d+s[6],p=u+s[3],f=d+s[4],this.bezierCurveTo(u+s[1]+e,d+s[2]+i,p+e,f+i,o+e,a+i),u=o,d=a;break;case"C":u=s[5],d=s[6],p=s[3],f=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,p+e,f+i,u+e,d+i);break;case"s":o=u+s[3],a=d+s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,u+s[1]+e,d+s[2]+i,o+e,a+i),p=u+s[1],f=d+s[2],u=o,d=a;break;case"S":o=s[3],a=s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"q":o=u+s[3],a=d+s[4],p=u+s[1],f=d+s[2],this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"Q":o=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"t":o=u+s[1],a=d+s[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-h,f=2*d-l):"q"===c[0]&&(p=2*u-p,f=2*d-f),h=p,l=f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a,p=u+s[1],f=d+s[2];break;case"T":o=s[1],a=s[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"a":Ji(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+e,s[7]+d+i]),u+=s[6],d+=s[7];break;case"A":Ji(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),u=s[6],d=s[7];break;case"z":case"Z":this.closePath()}c=s}}_runCommandList(t,e=0,i=0,n=1,r=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 Di.L:this.lineToTransform(o,e,i,n,r);break;case Di.M:this.moveToTransform(o,e,i,n,r);break;case Di.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Di.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Di.A:this.arcToTransform(o,e,i,n,r);break;case Di.E:this.ellipseTransform(o,e,i,n,r);break;case Di.R:this.rectTransform(o,e,i,n,r);break;case Di.AT:this.arcToTransform(o,e,i,n,r);break;case Di.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),en(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 Ue(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 Ue(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 Fn=["l",0,0,0,0,0,0,0];function jn(t,e,i){const n=Fn[0]=t[0];if("a"===n||"A"===n)Fn[1]=e*t[1],Fn[2]=i*t[2],Fn[3]=t[3],Fn[4]=t[4],Fn[5]=t[5],Fn[6]=e*t[6],Fn[7]=i*t[7];else if("h"===n||"H"===n)Fn[1]=e*t[1];else if("v"===n||"V"===n)Fn[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)Fn[n]=(n%2==1?e:i)*t[n];return Fn}const zn={alignSelf:"auto"},Gn={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 ii},Hn={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Vn={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Yn=Object.assign({outerBorder:Object.assign(Object.assign({},Vn),{distance:0}),innerBorder:Object.assign(Object.assign({},Vn),{distance:0})},Vn),Xn={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},qn=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,html:null},Hn),Yn),zn),Kn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},$n=Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1},qn),Gn);const Zn=Object.assign(Object.assign({},$n),{startAngle:0,endAngle:Le,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Jn=Object.assign(Object.assign(Object.assign({},$n),Kn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),Qn=Object.assign(Object.assign({},$n),{radius:1,startAngle:0,endAngle:Le}),tr=Object.assign(Object.assign({},$n),{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"}),er=Object.assign(Object.assign({},$n),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),ir=Object.assign(Object.assign(Object.assign({},$n),Kn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),nr=Object.assign(Object.assign({},$n),{path:new Wn,customPath:()=>{console.warn("空函数")}}),rr=Object.assign(Object.assign({},$n),{points:[],cornerRadius:0,closePath:!0}),sr=Object.assign(Object.assign({},$n),{width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0}),or=Object.assign(Object.assign({},$n),{width:0,height:0,cornerRadius:0,length:0}),ar=Object.assign(Object.assign({},$n),{symbolType:"circle",size:10,keepDirIn3d:!0}),hr=Object.assign(Object.assign(Object.assign({},$n),Xn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),lr=Object.assign(Object.assign({},$n),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),cr=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},$n),{fill:!0,cornerRadius:0}),ur=Object.assign(Object.assign({},cr),{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 dr{}const pr=new dr,fr={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"}},gr=!0,mr=!1,yr=/\w|\(|\)|-/,vr=/[.?!,;:/,。?!、;:]/,br=/\S/;function xr(t,e,i,n,r){if(!e||e<=0)return 0;const s=pr.graphicUtil.textMeasure;let o=n,a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width);for(;h>e||c<=e;){if(h>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width)}return r&&(o=Ar(t,o)),o}function Ar(t,e){let i=e;for(;yr.test(t[i-1])&&yr.test(t[i])||vr.test(t[i]);)if(i--,i<=0)return e;return i}function Tr(t,e){const i=pr.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}let Br=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){if(!this.context)return this.estimate(t,e).width;this.context.setTextStyleWithoutAlignBaseline(e);return this.context.measureText(t).width}estimate(t,{fontSize:e=hr.fontSize}){let i=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:n++;return{width:~~(.8*i*e+n*e),height:e}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Xn.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:Xn.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);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=Ar(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);if(n&&s.str!==t){const i=Ar(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){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipText(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 h=this.measureTextWidth(n,e),h>=i?{str:o,width:a}:this._clipText(t,e,i,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,i,n,r){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,i,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const o=this.measureTextWidth(n,e);if(o>i)return s;i-=o;const a=this.clipTextVertical(t,e,i,r);return a.width+=o,a.verticalList.push({text:n,direction:1,width:o}),a}clipTextWithSuffix(t,e,i,n,r){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};const o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;const a=this._clipText(t,e,i,0,t.length-1);if(r&&a.str!==t){const i=Ar(t,a.str.length);i!==a.str.length&&(a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a.str+=n,a.width+=o,a}};Br=X([U()],Br);const wr=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=class extends Br{},t.DefaultTextMeasureContribution=X([U()],t.DefaultTextMeasureContribution);const Sr=new qt,_r=Symbol.for("CanvasFactory"),Cr=Symbol.for("Context2dFactory");function Pr(t){return Sr.getNamed(_r,pr.global.env)(t)}const Er=1e-4,Mr=Math.sqrt(3),kr=1/3;function Rr(t){return t>-Yr&&t<Yr}function Or(t){return t>Yr||t<-Yr}const Dr=[0,0],Ir=[0,0],Lr=[0,0];function Ur(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Nr(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Wr(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 Fr(t){return(t%=Le)<0&&(t+=Le),t}function jr(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 h=o*(i-t)+t;return h===r?1/0:h>r?a:0}function zr(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;if(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||a>t+l&&a>i+l&&a>r+l||a<t-l&&a<i-l&&a<r-l)return!1;const c=function(t,e,i,n,r,s,o,a,h){let l=0,c=.005,u=1/0;Dr[0]=o,Dr[1]=a;for(let o=0;o<1;o+=.05){Ir[0]=Nr(t,i,r,o),Ir[1]=Nr(e,n,s,o);const a=Ur(Dr,Ir);a<u&&(l=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<Er);o++){const o=l-c,a=l+c;Ir[0]=Nr(t,i,r,o),Ir[1]=Nr(e,n,s,o);const h=Ur(Ir,Dr);if(o>=0&&h<u)l=o,u=h;else{Lr[0]=Nr(t,i,r,a),Lr[1]=Nr(e,n,s,a);const o=Ur(Lr,Dr);a<=1&&o<u?(l=a,u=o):c*=.5}}return h&&(h[0]=Nr(t,i,r,l),h[1]=Nr(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,a,h,null);return c<=l/2}function Gr(t,e,i,n,r,s,o,a,h,l,c){if(0===h)return!1;const u=h;if(c>e+u&&c>n+u&&c>s+u&&c>a+u||c<e-u&&c<n-u&&c<s-u&&c<a-u||l>t+u&&l>i+u&&l>r+u&&l>o+u||l<t-u&&l<i-u&&l<r-u&&l<o-u)return!1;const d=function(t,e,i,n,r,s,o,a,h,l,c){let u,d,p,f,g=0,m=.005,y=1/0;Dr[0]=h,Dr[1]=l;for(let h=0;h<1;h+=.05)Ir[0]=Wr(t,i,r,o,h),Ir[1]=Wr(e,n,s,a,h),p=Ur(Dr,Ir),p<y&&(g=h,y=p);y=1/0;for(let h=0;h<32&&!(m<Er);h++)u=g-m,d=g+m,Ir[0]=Wr(t,i,r,o,u),Ir[1]=Wr(e,n,s,a,u),p=Ur(Ir,Dr),u>=0&&p<y?(g=u,y=p):(Lr[0]=Wr(t,i,r,o,d),Lr[1]=Wr(e,n,s,a,d),f=Ur(Lr,Dr),d<=1&&f<y?(g=d,y=f):m*=.5);return c&&(c[0]=Wr(t,i,r,o,g),c[1]=Wr(e,n,s,a,g)),Math.sqrt(y)}(t,e,i,n,r,s,o,a,l,c,null);return d<=u/2}function Hr(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;a-=t,h-=e;const c=Math.sqrt(a*a+h*h);if(c-l>i||c+l<i)return!1;if(Math.abs(n-r)%Le<1e-4)return!0;if(s){const t=n;n=Fr(r),r=Fr(t)}else n=Fr(n),r=Fr(r);n>r&&(r+=Le);let u=Math.atan2(h,a);return u<0&&(u+=Le),u>=n&&u<=r||u+Le>=n&&u+Le<=r}function Vr(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,h=r/2;let l=0,c=t;if(o>e+h&&o>n+h||o<e-h&&o<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=a/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-o+c;return u*u/(l*l+1)<=a/2*a/2}const Yr=1e-4;function Xr(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 h=0;if(Rr(o)){if(Or(s)){const t=-a/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*o*a;if(Rr(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[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const qr=[-1,-1,-1],Kr=[-1,-1];function $r(){const t=Kr[0];Kr[0]=Kr[1],Kr[1]=t}function Zr(t,e,i,n,r,s,o,a,h,l){if(l>e&&l>n&&l>s&&l>a||l<e&&l<n&&l<s&&l<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),h=3*(e-t),l=t-r,c=a*a-3*o*h,u=a*h-9*o*l,d=h*h-3*a*l;let p=0;if(Rr(c)&&Rr(u))if(Rr(a))s[0]=0;else{const t=-h/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Rr(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,kr):Math.pow(i,kr),n=n<0?-Math.pow(-n,kr):Math.pow(n,kr);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),h=(-a+i*(n+Mr*Math.sin(e)))/(3*o),l=(-a+i*(n-Mr*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),l>=0&&l<=1&&(s[p++]=l)}}return p}(e,n,s,a,l,qr);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let l=0;l<c;l++){const c=qr[l],g=0===c||1===c?.5:1;Wr(t,i,r,o,c)<h||(d<0&&(d=Xr(e,n,s,a,Kr),Kr[1]<Kr[0]&&d>1&&$r(),p=Wr(e,n,s,a,Kr[0]),d>1&&(f=Wr(e,n,s,a,Kr[1]))),2===d?c<Kr[0]?u+=p<e?g:-g:c<Kr[1]?u+=f<p?g:-g:u+=a<f?g:-g:c<Kr[0]?u+=p<e?g:-g:u+=a<p?g:-g)}return u}function Jr(t,e,i,n,r,s,o,a){if(a>e&&a>n&&a>s||a<e&&a<n&&a<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,o=2*(e-t),a=t-n;let h=0;if(Rr(s)){if(Or(o)){const t=-a/o;t>=0&&t<=1&&(r[h++]=t)}}else{const t=o*o-4*s*a;if(Rr(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[h++]=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[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,a,qr);if(0===h)return 0;const l=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(l>=0&&l<=1){let a=0;const c=Nr(e,n,s,l);for(let n=0;n<h;n++){const h=0===qr[n]||1===qr[n]?.5:1;Nr(t,i,r,qr[n])<o||(qr[n]<l?a+=c<e?h:-h:a+=s<c?h:-h)}return a}const c=0===qr[0]||1===qr[0]?.5:1;return Nr(t,i,r,qr[0])<o?0:s<e?c:-c}function Qr(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const h=Math.sqrt(i*i-a*a);qr[0]=-h,qr[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=Le-1e-4){n=0,r=Le;const e=s?1:-1;return o>=qr[0]+t&&o<=qr[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=Le,r+=Le);let c=0;for(let e=0;e<2;e++){const i=qr[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=Le+t),(t>=n&&t<=r||t+Le>=n&&t+Le<=r)&&(t>Oe/2&&t<1.5*Oe&&(e=-e),c+=e)}}return c}function ts(t){return Math.round(t/Oe*1e8)/1e8%2*Oe}function es(t,e){let i=ts(t[0]);i<0&&(i+=Le);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=Le?r=i+Le:e&&i-r>=Le?r=i-Le:!e&&i>r?r=i+(Le-ts(i-r)):e&&i<r&&(r=i-(Le-ts(r-i))),t[0]=i,t[1]=r}const is=[0,0];function ns(t,e,i,n,r){const s=t,o=t.length;let a,h,l=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]===Di.M&&t>1&&(i||(l+=jr(c,u,d,p,n,r))),f&&(c=o[1],u=o[2],d=c,p=u);const g=o[0],m=o[1],y=o[2],v=o[3],b=o[4],x=o[5],A=o[6];let T=b,B=x;is[0]=T,is[1]=B,es(is,Boolean(o[6])),T=is[0],B=is[1];const w=T,S=B-T,_=!!(1-(o[6]?0:1)),C=(n-m)*v/v+m;switch(g){case Di.M:d=m,p=y,c=d,u=p;break;case Di.L:if(i){if(Vr(c,u,m,y,e,n,r))return!0}else l+=jr(c,u,m,y,n,r)||0;c=m,u=y;break;case Di.C:if(i){if(Gr(c,u,m,y,v,b,x,A,e,n,r))return!0}else l+=Zr(c,u,m,y,v,b,x,A,n,r)||0;c=x,u=A;break;case Di.Q:if(i){if(zr(c,u,m,y,v,b,e,n,r))return!0}else l+=Jr(c,u,m,y,v,b,n,r)||0;c=v,u=b;break;case Di.A:if(a=Math.cos(w)*v+m,h=Math.sin(w)*v+y,f?(d=a,p=h):l+=jr(c,u,a,h,n,r),i){if(Hr(m,y,v,w,w+S,_,e,C,r))return!0}else l+=Qr(m,y,v,w,w+S,_,C,r);c=Math.cos(w+S)*v+m,u=Math.sin(w+S)*v+y;break;case Di.R:if(d=c=m,p=u=y,a=d+v,h=p+b,i){if(Vr(d,p,a,p,e,n,r)||Vr(a,p,a,h,e,n,r)||Vr(a,h,d,h,e,n,r)||Vr(d,h,d,p,e,n,r))return!0}else l+=jr(a,p,a,h,n,r),l+=jr(d,h,d,p,n,r);break;case Di.Z:if(i){if(Vr(c,u,d,p,e,n,r))return!0}else l+=jr(c,u,d,p,n,r);c=d,u=p}}var f,g;return i||(f=u,g=p,Math.abs(f-g)<Yr)||(l+=jr(c,u,d,p,n,r)||0),0!==l}var rs;t.DefaultGraphicUtil=class{constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,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){if(this.configured)return;const i=Pr({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=i,this.context=i.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="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:Xn.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Pi(Object.assign({defaultFontParams:{fontFamily:Xn.fontFamily,fontSize:Xn.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Pi.ALPHABET_CHAR_SET+Pi.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}},t.DefaultGraphicUtil=X([U(),q(0,I(Jt)),q(0,N(wr)),q(1,I(se)),K("design:paramtypes",[Object,Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(rs||(rs={}));const ss=new ii;t.DefaultTransformUtil=class{constructor(){this.matrix=new ii}init(t){return this.mode=rs.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=rs.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(ss.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(ss.a,ss.b,ss.c,ss.d,ss.e,ss.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(ss.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(ss.a,ss.b,ss.c,ss.d,ss.e,ss.f),this}scale(t,e,i){return this.mode===rs.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===rs.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return ss.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(ss.a,ss.b,ss.c,ss.d,ss.e,ss.f),this}translate(t,e){return this.mode===rs.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===rs.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=X([U(),K("design:paramtypes",[])],t.DefaultTransformUtil);const os={arc:Zn,area:Jn,circle:Qn,line:ir,path:nr,symbol:ar,text:hr,rect:sr,rect3d:or,polygon:rr,richtext:lr,richtextIcon:ur,image:cr,group:tr,glyph:er},as=Object.keys(os);function hs(){return{arc:Object.assign({},os.arc),area:Object.assign({},os.area),circle:Object.assign({},os.circle),line:Object.assign({},os.line),path:Object.assign({},os.path),symbol:Object.assign({},os.symbol),text:Object.assign({},os.text),rect:Object.assign({},os.rect),rect3d:Object.assign({},os.rect3d),polygon:Object.assign({},os.polygon),richtext:Object.assign({},os.richtext),richtextIcon:Object.assign({},os.richtextIcon),image:Object.assign({},os.image),group:Object.assign({},os.group),glyph:Object.assign({},os.glyph)}}function ls(t,e,i=!0){e&&(i?Object.keys(e).forEach((i=>{t[i]?Object.assign(t[i],e[i]):t[i]=e[i]})):Object.keys(e).forEach((i=>{if(t[i]){const n=t[i],r=e[i];Object.keys(e[i]).forEach((t=>{void 0===n[t]&&(n[t]=r[t])}))}else t[i]=e[i]})))}const cs=new Array(60).fill(0).map((()=>hs()));class us{constructor(){this._defaultTheme=cs.pop()||hs(),this.combinedTheme=this._defaultTheme,this.dirty=!1}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,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0),this.userTheme?ls(this.userTheme,t.userTheme,!1):this.userTheme=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=[],s=[];return void 0===e&&(e=!0),void 0===i&&(i=1/0),function t(i,o){if(null===i)return null;if(0===o)return i;var a,h,l;if("object"!=W(i))return i;if(ve(i)?a=[]:Te(i)?(a=new RegExp(i.source,(l="",(h=i).global&&(l+="g"),h.ignoreCase&&(l+="i"),h.multiline&&(l+="m"),l)),i.lastIndex&&(a.lastIndex=i.lastIndex)):a=be(i)?new Date(i.getTime()):void 0===n?Object.create(Object.getPrototypeOf(i)):Object.create(n),e){var c=r.indexOf(i);if(-1!==c)return s[c];r.push(i),s.push(a)}for(var u in i)a[u]=t(i[u],o-1);return a}(t,i)}(t.userTheme),ls(e,t.userTheme)}this.userTheme?this.doCombine(e):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this._defaultTheme,n=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);as.forEach((r=>{var o,a;e[r]||s||t[r]?n[r]=Object.assign({},i[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):n[r]=i[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}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,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const ds=new us;function ps(t,e){return t.glyphHost?ps(t.glyphHost):e?(t.isContainer,e):fs(t)||ds.getTheme()}function fs(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)):ds.getTheme()}return null}class gs{static GenAutoIncrementId(){return gs.auto_increment_id++}}gs.auto_increment_id=0;class ms extends le{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=gs.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){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,e=!1){return $(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){if(this._uid===t._uid)return null;if(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,e=!1){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&&console.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(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;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,e=!1){let 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,e=!1){let 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,e=!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=ue(i,!0)&&i||ge(i)&&i.capture,r=ge(i)&&i.once,s=de(e)?void 0:e;return t=n?`${t}capture`:t,e=de(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=ue(i,!0)&&i||ge(i)&&i.capture,r=de(e)?void 0:e;t=n?`${t}capture`:t,e=de(e)?e:e.handleEvent;const s=ge(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 ge(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,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class ys{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=ys.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ke,this.page=new Ke,this.canvas=new Ke,this.viewport=new Ke,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.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class vs extends ys{constructor(){super(...arguments),this.client=new Ke,this.movement=new Ke,this.offset=new Ke,this.global=new Ke,this.screen=new Ke}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,h,l,c,u,d,p,f){throw new Error("Method not implemented.")}}class bs extends vs{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 bs(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],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(),n.type=this.type,n}}class xs extends vs{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 xs(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],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(),n.type=this.type,n}}xs.DOM_DELTA_PIXEL=0,xs.DOM_DELTA_LINE=1,xs.DOM_DELTA_PAGE=2;class As extends ys{constructor(t,e){super(),this.type=t,this.detail=e}}const Ts="object"==typeof performance&&performance.now?performance:Date;function Bs(t){return"mouse"===t||"pen"===t}class ws{constructor(t){this.dispatch=new le,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof bs))return void console.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(Bs(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 bs))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=Bs(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");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==a&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(i)}const h="dispatchEvent";this[h](r,"pointermove"),"touch"===r.pointerType&&this[h](r,"touchmove"),s&&(this[h](r,"mousemove"),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 bs))return void console.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=Bs(s.pointerType);this.dispatchEvent(s,"pointerover"),o&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(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 bs))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=Bs(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.cursor=""},this.onPointerUp=(t,e)=>{if(!(t instanceof bs))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=Ts.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(Bs(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=s;if(s&&!n.composedPath().includes(s)){let e=s;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(Bs(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:i});const s=r.clicksByButton[t.button];s.target===e.target&&i-s.timeStamp<200?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=i,e.detail=s.clickCount,Bs(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this.dispatchEvent(e,"tap"),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof bs))return void console.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"):Bs(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 xs))return void console.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.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;if(!this.rootTarget)return;const o=this.mappingTable[t.type];let a;const h=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[h])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[h])||void 0===n?void 0:n.stage.renderCount)===(null===(r=this._prePointTargetCache)||void 0===r?void 0:r.stageRenderCount)?a=this._prePointTargetCache[h]:(a=this.pickTarget(t.canvasX,t.canvasY,t),t.pickParams||(this._prePointTargetCache={[h]:a,stageRenderCount:null!==(s=null==a?void 0:a.stage.renderCount)&&void 0!==s?s:-1})),o)for(let e=0,i=o.length;e<i;e++)o[e].fn(t,a);else console.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){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){const n=this.allocateEvent(bs);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.global.x,n.global.y,n),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(xs);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.global.x,i.global.y,i),i}clonePointerEvent(t,e){const i=this.allocateEvent(bs);return 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(),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 bs&&e instanceof bs&&(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 vs&&e instanceof vs&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset),e.viewport.copyFrom(t.viewport))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Ts.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page),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.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:t>=0&&t<=we(this.rootTarget,"width")&&e>=0&&e<=we(this.rootTarget,"height")?this.rootTarget:null,i&&(i.pickParams=r.params),n}}const Ss={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof ys))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],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 As(t,e))}},_s={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Cs{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);if(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.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.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetElement(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.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.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:o=!1}=t;this.manager=new ws(n),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=o,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new bs,this.rootWheelEvent=new xs,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.setTargetElement(null)}setCursor(t="default"){const{applyStyles:e,domElement:i}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&e?i.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&e&&Object.assign(i.style,n):e&&ye(t)&&!_e(this.cursorStyles,t)&&(i.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){const e=this.viewport,{x:i,y:n}=t;return{x:i-e.x,y:n-e.y}}mapToCanvasPoint(t){var e;const i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;const{clientX:n,clientY:r}=t,s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.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];me(n.button)&&(n.button=0),me(n.buttons)&&(n.buttons=1),me(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),me(n.width)&&(n.width=n.radiusX||1),me(n.height)&&(n.height=n.radiusY||1),me(n.tiltX)&&(n.tiltX=0),me(n.tiltY)&&(n.tiltY=0),me(n.pointerType)&&(n.pointerType="touch"),me(n.pointerId)&&(n.pointerId=n.identifier||0),me(n.pressure)&&(n.pressure=n.force||.5),me(n.twist)&&(n.twist=0),me(n.tangentialPressure)&&(n.tangentialPressure=0),me(n.layerX)&&(n.layerX=n.offsetX=n.clientX),me(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))e.push(t);else{const i=t;me(i.isPrimary)&&(i.isPrimary=!0),me(i.width)&&(i.width=1),me(i.height)&&(i.height=1),me(i.tiltX)&&(i.tiltX=0),me(i.tiltY)&&(i.tiltY=0),me(i.pointerType)&&(i.pointerType="mouse"),me(i.pointerId)&&(i.pointerId=1),me(i.pressure)&&(i.pressure=.5),me(i.twist)&&(i.twist=0),me(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}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.copyFrom(e.canvas),e.offset.copyFrom(e.canvas);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.copyFrom(t.canvas),t.offset.copyFrom(t.canvas);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=_s[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Ts.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}isEventOutsideOfTargetElement(t){let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);return e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}class Ps{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Ps.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 Es{static Avaliable(){return!0}avaliable(){return Es.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 Ms{static Avaliable(){return!!pr.global.getRequestAnimationFrame()}avaliable(){return Ms.Avaliable()}tick(t,e){pr.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var ks;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(ks||(ks={}));class Rs{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){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===ks.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=ks.INITIAL,pr.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),pr.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:Ms},{mode:"timeout",cons:Es},{mode:"manual",cons:Ps}];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 Ms;break;case"timeout":t=new Es;break;case"manual":t=new Ps;break;default:console.warn("非法的计时器模式"),t=new Ms}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!==ks.INITIAL&&(this.status=ks.PAUSE,!0)}resume(){return this.status!==ks.INITIAL&&(this.status=ks.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(t=!1){if(this.status===ks.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===ks.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=ks.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=ks.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Os{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-Os.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Os.bounceIn(2*t):.5*Os.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/Le*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Le/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/Le*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*Le/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/Le*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Le/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*Le/e)*.5+1}}}Os.quadIn=Os.getPowIn(2),Os.quadOut=Os.getPowOut(2),Os.quadInOut=Os.getPowInOut(2),Os.cubicIn=Os.getPowIn(3),Os.cubicOut=Os.getPowOut(3),Os.cubicInOut=Os.getPowInOut(3),Os.quartIn=Os.getPowIn(4),Os.quartOut=Os.getPowOut(4),Os.quartInOut=Os.getPowInOut(4),Os.quintIn=Os.getPowIn(5),Os.quintOut=Os.getPowOut(5),Os.quintInOut=Os.getPowInOut(5),Os.backIn=Os.getBackIn(1.7),Os.backOut=Os.getBackOut(1.7),Os.backInOut=Os.getBackInOut(1.7),Os.elasticIn=Os.getElasticIn(1,.3),Os.elasticOut=Os.getElasticOut(1,.3),Os.elasticInOut=Os.getElasticInOut(1,.3*1.5);class Ds{constructor(){this.id=gs.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,e=!0){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 Is=new Ds;class Ls{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(){}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){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(i,this.step.getLastProps()),this.onUpdate(t,e,i),t&&this.onEnd()}}class Us extends Ls{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Ns{constructor(e=gs.GenAutoIncrementId(),i=Is){this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Ws(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=Fe(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Ns.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.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e,i=Ns.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 Us((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=Ns.interpolateMap.get(t)||Ns.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 Ws(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()}}Ns.mode=t.AnimateMode.NORMAL,Ns.interpolateMap=new Map;class Ws{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 Fs(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?Os[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?Os[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 Fs(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])}))),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 h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,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 l=!this.reversed!=!(this.bounce&&s%2);return l&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(a,l),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 console.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 Fs{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 js={duration:200,easing:"cubicOut"},zs={duration:1e3,easing:"quadInOut"};var Gs;t.Edge=void 0,(Gs=t.Edge||(t.Edge={}))[Gs.Top=1]="Top",Gs[Gs.Right=2]="Right",Gs[Gs.Bottom=4]="Bottom",Gs[Gs.Left=8]="Left",Gs[Gs.ALL=15]="ALL";const Hs=[!1,!1,!1,!1],Vs=t=>{var e;let i=!0;if(ue(t,!0)){for(let n=0;n<4;n++)Hs[n]=t,i&&(i=!(null!==(e=Hs[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Hs[e]=!!t[e],i&&(i=!!Hs[e]);else Hs[0]=!1,Hs[1]=!1,Hs[2]=!1,Hs[3]=!1;return{isFullStroke:i,stroke:Hs}},Ys=[0,0,0,0],Xs=t=>t?ve(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Ys[0]=t[0],Ys[2]=t[0],Ys[1]=t[1],Ys[3]=t[1],Ys):t:t:0,qs=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Ks=[1,2,3,0,1,2,3,0];function $s(t,e,i,n){for(;t>=Le;)t-=Le;for(;t<0;)t+=Le;for(;t>e;)e+=Le;qs[0].x=i,qs[1].y=i,qs[2].x=-i,qs[3].y=-i;const r=Math.ceil(t/De)%4,s=Math.ceil(e/De)%4;if(n.add(We(t)*i,ze(t)*i),n.add(We(e)*i,ze(e)*i),r!==s||e-t>Oe){let t=!1;for(let e=0;e<Ks.length;e++)if(t||r!==Ks[e]){if(t&&s===Ks[e])break;if(t){const t=qs[Ks[e]];n.add(t.x,t.y)}}else{t=!0;const e=qs[r];n.add(e.x,e.y)}}}function Zs(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function Js(t,e,i){const{x:n,y:r}=Xe(t.x,t.y,e.x,e.y,i),{x:s,y:o}=Xe(t.x1,t.y1,e.x1,e.y1,i),a=new Ke(n,r,s,o);return a.defined=e.defined,a}function Qs(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 Ke(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=Js(t[r],e[r],i)}else{n=e.map((t=>{const e=new Ke(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=Js(t[r],e[r],i)}return n}const to=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],eo=t=>to.includes(t);function io(t,e){if(ve(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class no{constructor(){this.durations=[],this.timeout=no.TimeOut,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)}}no.TimeOut=1e3/60;const ro=new no;var so;!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"}(so||(so={}));class oo extends Ls{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 ao(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,h=(n-i)*r+i,l=(a-o)*r+o,c=(h-a)*r+a,u=(c-l)*r+l;s[0]=t,s[1]=o,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function ho(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),h=Math.abs(n-i)/6,l=(a-2)/6,c=Math.ceil(h/l),u=[o[0],o[1]];let d=h;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],h=o[t+2],l=o[t+3];const p=o[t+4],f=o[t+5];if(d<=0){u.push(n,a,h,l,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const o=t/g;ao(e,n,h,p,o,r),ao(i,a,l,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],h=r[6],l=s[6]}d-=g-1}return o===t?[u,e]:[t,u]}function lo(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 co(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 uo(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],h=t[s],l=t[s+1],c=r*l-h*a;e+=c,i+=(r+h)*c,n+=(a+l)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function po(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,h=a-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%h+2,a=t[o]-i[0],l=t[o+1]-i[1],u=e[s]-n[0]-a,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,o=l)}return o}function fo(t,e,i,n){const r=[];let s;for(let o=0;o<t.length;o++){let a=t[o];const h=e[o],l=uo(a),c=uo(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],m=a.length;s&&(a=co(a));const y=6*po(a,h,l,c),v=m-2;for(let t=0;t<v;t+=2){const e=(y+t)%v+2;u[t+2]=a[e]-l[0],u[t+3]=a[e+1]-l[1]}if(u[0]=a[y]-l[0],u[1]=a[y+1]-l[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=h[e]-c[0],a=h[e+1]-c[1],l=o*i-a*t,d=o*t+a*i;g[e]=l,g[e+1]=d;const p=l-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<m;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function go(t,e){let i,n;const r=[],s=[];for(let o=0;o<Math.max(t.length,e.length);o++){const a=t[o],h=e[o];let l,c;a?h?([l,c]=ho(a,h),i=l,n=c):(c=lo(n,a),l=a):(l=lo(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const mo=(t,e,i,n,r)=>{Me(e,n)&&Me(i,r)||t.push(e,i,n,r,n,r)};function yo(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,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],[Di.L,Di.C,Di.Q].includes(i[0])&&(n=[o,a])),i[0]){case Di.M:r=o=i[1],s=a=i[2],h(o,a);break;case Di.L:l=i[1],c=i[2],mo(n,r,s,l,c),r=l,s=c;break;case Di.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Di.Q:l=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),u+2/3*(l-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Di.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],m=!!i[6];l=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(o=l,a=c,h(o,a)):mo(n,r,s,l,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const y=(m?-1:1)*Math.PI/2;for(let i=f;m?i>g:i<g;i+=y){const r=m?Math.max(i+y,g):Math.min(i+y,g);Qi(n,i,r,t,e,u,d)}break}case Di.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],m=i[7]+g,y=!!i[8],v=!Me(f,0),b=Math.cos(f),x=Math.sin(f);let A=Math.cos(g)*u,T=Math.sin(g)*d;v?(l=A*b-T*x+t,c=A*x+T*b+e):(l=A+t,c=T+e),p?(o=l,a=c,h(o,a)):mo(n,r,s,l,c),A=Math.cos(m)*u,T=Math.sin(m)*d,v?(r=A*b-T*x+t,s=A*x+T*b+e):(r=A+t,s=T+e);const B=(y?-1:1)*Math.PI/2;for(let i=g;y?i>m:i<m;i+=B){const r=y?Math.max(i+B,m):Math.min(i+B,m);if(Qi(n,i,r,t,e,u,d),v){const i=n.length;for(let r=i-6;r<=i-1;r+=2)A=n[r],T=n[r+1],n[r]=(A-t)*b-(T-e)*x+t,n[r+1]=(A-t)*x+(T-e)*b+e}}break}case Di.R:o=r=i[1],a=s=i[2],l=o+i[3],c=a+i[4],h(l,a),mo(n,l,a,l,c),mo(n,l,c,o,c),mo(n,o,c,o,a),mo(n,o,a,l,a);break;case Di.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],u=$e.distancePP({x:r,y:s},{x:t,y:e}),d=$e.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(u*d),f=c/Math.sin(p/2),g=(r+h-2*t)/2,m=(s+l-2*e)/2,y=$e.distancePP({x:g,y:m},{x:0,y:0}),v=t+f*g/y,b=h+f*m/y,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/u,a=e+x*(s-e)/u,mo(n,r,s,o,a),r=t+x*(h-t)/d,s=e+x*(l-e)/d;const A=ei({x:v,y:b},{x:o,y:a}),T=ei({x:v,y:b},{x:r,y:s});Qi(n,A,T,v,b,c,c);break}case Di.Z:n&&mo(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function vo(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 bo(t){const e=new Wn;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}function xo(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 Ao=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=xo(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},To=(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),h=Math.abs(o-s),l=xo(a*(s+o)/2,h,e),c=[],u=h/l.length,d=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[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},Bo=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=xo(s*r,r,e),a=[],h=s/o[0],l=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:l*t,outerRadius:l*(t+1),startAngle:i+h*e*c,endAngle:i+h*(e+1)*c});return a},wo=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&xe(t.x)&&xe(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,h=t[e].y,l=t[e+1].x,c=t[e+1].y;for(;i<1&&o<r;)n.push({x:a+(l-a)*i,y:h+(c-h)*i}),i+=s,o+=1}return n},So=(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&&xe(t.x)&&xe(t.y)));if(!a.length)return[];const h=[];a.forEach((t=>{h.push({x:t.x,y:t.y})}));for(let t=a.length-1;t>=0;t--){const e=a[t];h.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const l=[];return Mo(s,e,l),l},_o=(t,e)=>{const i=t.attribute,n=i.points;if(n)return wo(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 wo(t,e)}return[]};const Co=t=>t.map((t=>({x:t.x,y:t.y}))),Po=(t,e,i)=>{const n=t.length,r=[];for(let a=0;a<n;a++){const h=t[a],l=a===n-1?t[0]:t[a+1],c=Si([e.x,e.y],[i.x,i.y],[h.x,h.y],[l.x,l.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[Co(t),Co(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],h=r[r.length-1];a.edgeIndex>h.edgeIndex&&([a,h]=[h,a]);const l=a.point,c=h.point,u=[{x:l.x,y:l.y}];for(let e=a.edgeIndex+1;e<=h.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=h.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:l.x,y:l.y}),[u,d]},Eo=t=>{const e=new Je;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 Po(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Po(t,{x:e.x1,y:r},{x:e.x2,y:r})},Mo=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Eo(t);Mo(r[0],n,i),Mo(r[1],e-n,i)}},ko=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Co(i)}];const n=[];return Mo(i,e,n),n},Ro=(t,e)=>{const i=yo(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:bo(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]});Mo(e,t===n-1?o:s,r),o-=s}return r},{Color:Oo}=Bi;var Do;t.ColorType=void 0,(Do=t.ColorType||(t.ColorType={}))[Do.Color255=0]="Color255",Do[Do.Color1=1]="Color1";class Io{static Get(e,i=t.ColorType.Color1,n=[0,0,0,1]){if(i===t.ColorType.Color1){const t=Io.store1[e];if(t)return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n;const i=Oo.parseColorString(e);if(i){const t=[i.r/255,i.g/255,i.b/255,i.opacity];Io.store1[e]=t,Io.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=Io.store255[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;const s=Oo.parseColorString(e);return s&&(Io.store1[e]=[s.r/255,s.g/255,s.b/255,s.opacity],Io.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(Io.store1[e])return;Io.store1[e]=n,Io.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Io.store255[e])return;Io.store255[e]=n,Io.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Lo(t,e=!1){return Array.isArray(t)?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 Uo(e,i,n,r,s){if(!e||!i)return e&&Lo(e)||i&&Lo(i)||!1;let o,a,h=!1,l=!1;if(Array.isArray(e)?o=e:"string"==typeof e?o=Io.Get(e,t.ColorType.Color255):h=!0,Array.isArray(i)?a=i:"string"==typeof i?a=Io.Get(i,t.ColorType.Color255):l=!0,h!==l){const t=h?e:i,o=h?i:e,a=Object.assign(Object.assign({},t),{stops:t.stops.map((t=>Object.assign(Object.assign({},t),{color:Lo(o)})))});return h?Uo(t,a,n,r,s):Uo(a,t,n,r,s)}if(h){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 No(t,r,n);if("radial"===t.gradient)return Wo(t,r,n);if("conical"===t.gradient)return Fo(t,r,n)}return!1}s&&s(o,a);return Lo(jo(o,a,n),r)}function No(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:Ho(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Wo(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:Ho(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Fo(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:Ho(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function jo(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]}Io.store255={},Io.store1={};const zo=[0,0,0,0],Go=[0,0,0,0];function Ho(e,i,n){return Io.Get(e,t.ColorType.Color255,zo),Io.Get(i,t.ColorType.Color255,Go),`rgba(${Math.round(zo[0]+(Go[0]-zo[0])*n)},${Math.round(zo[1]+(Go[1]-zo[1])*n)},${Math.round(zo[2]+(Go[2]-zo[2])*n)},${zo[3]+(Go[3]-zo[3])*n})`}Object.keys(ai).forEach((t=>{}));const Vo=(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=Uo(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},Yo=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,h=o.to,l=o.rotation*i,c=o.fromCp,u=o.toCp,d=Math.sin(l),p=Math.cos(l);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)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=o*p-l*d+r[0],n[t+1]=o*d+l*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],h=n[t+5];f===i&&g===r&&s===a&&o===h?e.lineTo(a,h):e.bezierCurveTo(i,r,s,o,a,h),f=a,g=h}}},Xo=(t,e,i)=>{const n=t?yo(t):[],r=yo(e);i&&n&&(i.fromTransform&&vo(n,i.fromTransform.clone().getInverse()),vo(n,i.toTransfrom));const[s,o]=go(n,r);return t?fo(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},qo=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],Ko=(e,i)=>{if(!e||!i)return null;const n=[];let r=!1;return Object.keys(e).forEach((s=>{if(!qo.includes(s))return;const o=i[s];pe(o)||pe(e[s])||o===e[s]||("fill"===s||"stroke"===s?n.push({from:"string"==typeof e[s]?Io.Get(e[s],t.ColorType.Color255):e[s],to:"string"==typeof o?Io.Get(o,t.ColorType.Color255):o,key:s}):n.push({from:e[s],to:o,key:s}),r=!0)})),r?n:null};class $o extends Ls{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;Yo(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&Vo(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const Zo=(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 h=Xo(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:a,toTransfrom:e.globalTransMatrix}),l=Ko(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 $o({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:zs.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:zs.easing)),c};class Jo extends Ls{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;Yo(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&&Vo(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const Qo=t=>{const e={};return Object.keys(t).forEach((i=>{eo(i)||(e[i]=t[i])})),e},ta=(t,e,i)=>{const n=Qo(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=pr.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},ea=(t,e,i)=>{const n=[],r=i?null:Qo(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Wn).fromCustomPath2D(s)};n.push(pr.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&ta(t,n,e),n},ia=(t,e,i)=>{const n=[],r=i?null:Qo(t.attribute);if("rect"===t.type){Ao(t,e).forEach((t=>{n.push(pr.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){To(t,e).forEach((t=>{n.push(pr.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){Bo(t,e).forEach((t=>{n.push(pr.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=_o(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(pr.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else if("polygon"===t.type){ko(t,e).forEach((t=>{n.push(pr.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){So(t,e).forEach((t=>{n.push(pr.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){Ro(t,e).forEach((t=>{"path"in t?n.push(pr.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(pr.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&ta(t,n,e),n};class na{static GetImage(t,e){var i;let n=na.cache.get(t);n?"fail"===n.loadState?pr.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&pr.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},na.cache.set(t,n),n.dataPromise=pr.global.loadImage(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 GetSvg(t,e){var i;let n=na.cache.get(t);n?"fail"===n.loadState?pr.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&pr.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},na.cache.set(t,n),n.dataPromise=pr.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=na.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"},na.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=pr.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=pr.global.loadBlob(t):"json"===e&&(i.dataPromise=pr.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}na.cache=new Map;const ra=new ii,sa=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],oa=["x","y"],aa=["scaleX","scaleY"],ha=["angle"],la=new Ke,ca={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d: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 ua extends ms{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(ua.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(e={}){super(),this._AABBBounds=new Qe,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background&&this.loadImage(e.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){const{dx:i=t.dx,dy:n=t.dy}=this.attribute;if(e&&this.parent){const t=ps(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;la.x=i+e,la.y=n+r}else la.x=i,la.y=n;return la}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;pr.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),pr.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(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){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(t=!0){return this._transMatrix||(this._transMatrix=new ii),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 Ke(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,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){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):pe(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)}needUpdateTags(t,e=sa){for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t,e=sa){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),this._updateTag=t.UpdateTag.INIT,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,oa,s);o&&(e=o.x,i=o.y,delete o.x,delete o.y,this._setAttributes(o));const a=this.attribute,h=a.postMatrix;return h?pr.transformUtil.fromMatrix(h,h).translate(e,i):(a.x=(null!==(n=a.x)&&void 0!==n?n:Gn.x)+e,a.y=(null!==(r=a.y)&&void 0!==r?r:Gn.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,oa,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,aa,o);a&&(e=a.scaleX,i=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const h=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new ii,h.postMatrix=t),pr.transformUtil.fromMatrix(t,t).scale(e,i,n)}else h.scaleX=(null!==(r=h.scaleX)&&void 0!==r?r:Gn.scaleX)*e,h.scaleY=(null!==(s=h.scaleY)&&void 0!==s?s:Gn.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,aa,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,ha,r);s&&(delete s.angle,this._setAttributes(s,!1,r));const o=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new ii,o.postMatrix=t),pr.transformUtil.fromMatrix(t,t).rotate(e,i)}else o.angle=(null!==(n=o.angle)&&void 0!==n?n:Gn.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,ha,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 Ns(null==t?void 0:t.id).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){pr.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)&&(!!pe(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,h;if(n){const t=Object.keys(e),n=r?t.reduce(((t,i)=>(t[i]=void 0===e[i]?this.getDefaultAttribute(i):e[i],t)),{}):e,l=this.animate();l.stateNames=i,l.to(n,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==o?o:js.duration,null!==(h=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==h?h:js.easing)}else 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}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();_e(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}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)}doUpdateLocalMatrix(){const{x:t=Gn.x,y:e=Gn.y,scaleX:i=Gn.scaleX,scaleY:n=Gn.scaleY,angle:r=Gn.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute,h=[0,0];if(o){if("string"==typeof o[0]){const t=parseFloat(o[0])/100,e=this.AABBBounds;h[0]=e.x1+(e.x2-e.x1)*t}else h[0]=o[0];if("string"==typeof o[1]){const t=parseFloat(o[1])/100,e=this.AABBBounds;h[1]=e.x1+(e.x2-e.x1)*t}else h[1]=o[1]}if(!s||1===i&&1===n)!function(t,e,i,n,r,s,o,a){var h,l,c=e.a,u=e.b,d=e.c,p=e.d,f=e.e,g=e.f,m=We(o),y=ze(o);a?(h=a[0],l=a[1]):(h=i,l=n);var v=h-i,b=l-n,x=c*m+d*y,A=u*m+p*y,T=d*m-c*y,B=p*m-u*y;t.a=r*x,t.b=r*A,t.c=s*T,t.d=s*B,t.e=f+c*h+d*l-x*v-T*b,t.f=g+u*h+p*l-A*v-B*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,o&&h);else{const o=this._transMatrix;o.reset(),o.translate(h[0],h[1]),o.rotate(r),o.translate(-h[0],-h[1]),o.translate(t,e),pr.transformUtil.fromMatrix(o,o).scale(i,n,{x:s[0],y:s[1]})}const l=this.getOffsetXY(Gn);if(this._transMatrix.e+=l.x,this._transMatrix.f+=l.y,a){const t=ra.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),pr.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,h=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,h)}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,h,l){l||(l=Object.keys(o),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=o[s],u=null!==(l=a&&a[s])&&void 0!==l?l:t.getLastPropByName(s,n);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,h,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=h}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=Uo(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=Uo(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=Uo(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 ps(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:pr.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 ye(t,!0)?this.pathProxy=(new Wn).fromString(t):this.pathProxy=new Wn,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){if(t.fill||t.stroke)return!0;return!1}(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",Ae(t)||Be(t)?(na.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(na.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e)}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(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released"}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new As(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)}}}ua.mixin(Ss);class da{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 pa(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function fa(t,e,i,n=">"){const r=function(t,e,i=">"){let n,r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,n);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let h=s,l=!0;-1!==a&&(h=s.substr(0,a).replace(/\s\s*$/,""),s=s.substr(a+1));const c=h;if(i){const t=h.indexOf(":");-1!==t&&(h=h.substr(t+1),l=h!==r.data.substr(t+1))}return{tagName:h,tagExp:s,closeIndex:o,attrExpPresent:l,rawTagName:c}}const ga=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class ma{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,ga),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],i=r[t][4],s=e;e&&(n[s]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new da("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){const e=pa(t,">",s,"Closing Tag is not closed."),o=r.lastIndexOf(".");r=r.substring(0,o),i=this.tagsNodeStack.pop(),n="",s=e}else if("?"===t[s+1]){s=fa(t,s,!1,"?>").closeIndex+1}else if("!--"===t.substr(s+1,3)){s=pa(t,"--\x3e",s+4,"Comment is not closed.")}else{const o=fa(t,s,!1);let a=o.tagName,h=o.tagExp;const l=o.attrExpPresent,c=o.closeIndex;if(a!==e.tagname&&(r+=r?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),h=a):h=h.substr(0,h.length-1);const t=new da(a);a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new da(a);this.tagsNodeStack.push(i),a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(i,t,r),i=t}n="",s=c}else n+=t[s]}return e.child}}function ya(t,e){return va(t)}function va(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],r=ba(n);if(void 0!==r&&n[r]){const t=va(n[r]);Aa(t),n[":@"]&&xa(t,n[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}return i}function ba(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function xa(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]}}}function Aa(t){return 0===Object.keys(t).length}class Ta{constructor(t){this.options=Object.assign({},Ta.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return ya(new ma(this.options).parseXml(t),this.options)}}function Ba(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function wa(t){return t.startsWith("<")}function Sa(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Ta.defaultOptions={};let _a=0;function Ca(){return _a++}var Pa;function Ea(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)Ra(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,(Pa=t.TextDirection||(t.TextDirection={}))[Pa.HORIZONTAL=0]="HORIZONTAL",Pa[Pa.VERTICAL=1]="VERTICAL";const Ma=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ma.set(t,!0)));const ka=new Map;function Ra(t){if(Ma.has(t))return!0;if(ka.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function Oa(t,e){const i=t["@_attribute"];if(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=>ka.set(t,!0)));const Da=Ca(),Ia=Ca(),La=Ca(),Ua=Ca(),Na=Ca(),Wa=Ca(),Fa=Ca(),ja=Ca(),za=Ca(),Ga=Ca(),Ha=Ca(),Va=Ca(),Ya=Ca(),Xa=Ca(),qa=Ca(),Ka=Ca(),$a=Symbol.for("GraphicService"),Za=Symbol.for("GraphicCreator"),Ja={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},Qa=Object.keys(Ja),th={"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"},eh=Object.keys(th);var ih;t.GroupUpdateAABBBoundsMode=void 0,(ih=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[ih.LESS_GROUP=0]="LESS_GROUP",ih[ih.MORE_GROUP=1]="MORE_GROUP";class nh extends ua{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Wa,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 us),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new us)}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 Ke(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;pr.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),pr.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=ps(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=pr.graphicService.updateGroupAABBBounds(t,ps(this).group,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=Xs(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(),pr.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),pr.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){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,pr.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{pr.graphicService.onRemove(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),pr.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(t=!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=pr.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new nh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return nh.NOWORK_ANIMATE_ATTR}}nh.NOWORK_ANIMATE_ATTR=ca;const rh=Symbol.for("LayerHandlerContribution");class sh extends nh{get offscreen(){return this.layerHandler.offscreen}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=Sr.get(rh),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 us,this.background="rgba(0, 0, 0, 0)",this.virtual=!!n.virtual,this.afterDrawCbs=[]}combineSubLayer(t=!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=>{pr.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("暂不支持")}render(t,e){var i;const n=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:n.x,y:n.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this)))}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){}combineTo(t,e){var i,n,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{pr.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i,n,r;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}t.DefaultLayerService=class{constructor(t){this.global=t,this.layerMap=new Map}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}createLayer(t,e={main:!1}){this.tryInit();const i=new sh(t,this.global,t.window,Object.assign(Object.assign({},e),{virtual:0===this.staticLayerCountInEnv})),n=this.layerMap.get(t)||[];return n.push(i),this.layerMap.set(t,n),this.staticLayerCountInEnv--,i}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}},t.DefaultLayerService=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],t.DefaultLayerService);const oh=Symbol.for("VWindow"),ah=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(t){this.global=t,this.hooks={onChange:new ne(["x","y","width","height"])},this._uid=gs.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;Sr.getNamed(ah,t.env).configure(this,t),this.actived=!0,this._handler}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.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._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,e){this._handler.clearViewBox(t,e)}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},X([Kt(),K("design:type",Function),K("design:paramtypes",[]),K("design:returntype",void 0)],t.DefaultWindow.prototype,"postInit",null),t.DefaultWindow=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],t.DefaultWindow);const hh=Symbol.for("TransformUtil"),lh=Symbol.for("GraphicUtil"),ch=Symbol.for("LayerService");var uh=new n((e=>{e(t.DefaultGlobal).toSelf().inSingletonScope(),e(se).toService(t.DefaultGlobal),e(t.DefaultWindow).to(t.DefaultWindow),e(oh).toService(t.DefaultWindow),e(t.DefaultGraphicUtil).toSelf().inSingletonScope(),e(lh).toService(t.DefaultGraphicUtil),e(t.DefaultTransformUtil).toSelf().inSingletonScope(),e(hh).toService(t.DefaultTransformUtil),e(t.DefaultLayerService).toSelf().inSingletonScope(),e(ch).toService(t.DefaultLayerService)}));function dh(t,e){return!(!t&&!e)}function ph(t,e){let i;return i=ve(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function fh(t,e,i){return i&&t*e>0}function gh(t,e,i,n,r){return r&&t*e>0&&i>0&&n>0}function mh(t,e){return t*e>0}function yh(t,e,i,n){return t*e>0&&i>0&&n>0}function vh(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const h=ps(t,null==s?void 0:s.theme)[t.type],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible}=t.attribute,m=fh(u,d,l),y=mh(u,f),v=dh(l),b=ph(c,p);if(!g)return!0;if(!v&&!b)return!0;if(!(m||y||o||a))return!0;e.beginPath();return en(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),v&&(o?o(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function bh(t,e,i,n,r,s,o,a){const h=i-t,l=n-e,c=o-r,u=a-s;let d=u*h-c*l;return d*d<Re?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*h,e+d*l])}function xh(t,e,i,n,r,s,o){const a=t-i,h=e-n,l=(o?s:-s)/Math.sqrt(a*a+h*h),c=l*h,u=-l*a,d=t+c,p=e+u,f=i+c,g=n+u,m=(d+f)/2,y=(p+g)/2,v=f-d,b=g-p,x=v*v+b*b,A=r-s,T=d*g-f*p,B=(b<0?-1:1)*Math.sqrt(Math.max(0,A*A*x-T*T));let w=(T*b-v*B)/x,S=(-T*v-b*B)/x;const _=(T*b+v*B)/x,C=(-T*v+b*B)/x,P=w-m,E=S-y,M=_-m,k=C-y;return P*P+E*E>M*M+k*k&&(w=_,S=C),{cx:w,cy:S,x01:-c,y01:-u,x11:w*(r/A-1),y11:S*(r/A-1)}}function Ah(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=Ue(h-a),c=h>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=Re)e.moveTo(i,n);else if(l>=Le-Re)e.moveTo(i+r*We(a),n+r*ze(a)),e.arc(i,n,r,a,h,!c),s>Re&&(e.moveTo(i+s*We(h),n+s*ze(h)),e.arc(i,n,s,h,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:m,innerEndAngle:y,innerStartAngle:v}=t.getParsePadAngle(a,h),b=d,x=d,A=d,T=d,B=Math.max(x,b),w=Math.max(A,T);let S=B,_=w;const C=r*We(g),P=r*ze(g),E=s*We(y),M=s*ze(y);let k,R,O,D;if((w>Re||B>Re)&&(k=r*We(m),R=r*ze(m),O=s*We(v),D=s*ze(v),l<Oe)){const t=bh(C,P,O,D,k,R,E,M);if(t){const e=C-t[0],i=P-t[1],n=k-t[0],o=R-t[1],a=1/ze(Ve((e*n+i*o)/(Ge(e*e+i*i)*Ge(n*n+o*o)))/2),h=Ge(t[0]*t[0]+t[1]*t[1]);_=je(w,(s-h)/(a-1)),S=je(B,(r-h)/(a+1))}}if(p<.001)o&&(o[3]||o[1])&&e.moveTo(i+C,n+P),u=!0;else if(S>Re){const t=je(b,S),s=je(x,S),a=xh(O,D,C,P,r,t,Number(c)),h=xh(k,R,E,M,r,s,Number(c));S<B&&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,S,Ne(a.y01,a.x01),Ne(h.y01,h.x01),!c)):e.moveTo(i+a.cx+S*We(Ne(h.y01,h.x01)),n+a.cy+S*ze(Ne(h.y01,h.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,Ne(a.y01,a.x01),Ne(a.y11,a.x11),!c),e.arc(i,n,r,Ne(a.cy+a.y11,a.cx+a.x11),Ne(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,Ne(h.y11,h.x11),Ne(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*We(Ne(h.y01,h.x01)),n+h.cy+s*ze(Ne(h.y01,h.x01))):e.moveTo(i+k,n+r*ze(m))}else!o||o[0]?(e.moveTo(i+C,n+P),e.arc(i,n,r,g,m,!c)):e.moveTo(i+r*We(m),n+(null!=R?R:0));if(!(s>Re)||f<.001)!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),u=!0;else if(_>Re){const t=je(T,_),r=je(A,_),a=xh(E,M,k,R,s,-r,Number(c)),h=xh(C,P,O,D,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),_<w&&t===r){const t=Ne(h.y01,h.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,_,Ne(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+We(t),n+a.cy+ze(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,Ne(a.y01,a.x01),Ne(a.y11,a.x11),!c),e.arc(i,n,s,Ne(a.cy+a.y11,a.cx+a.x11),Ne(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,Ne(h.y11,h.x11),Ne(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*We(Ne(h.y01,h.x01)),n+h.cy+t*ze(Ne(h.y01,h.x01))):e.moveTo(i+O,n+D)}else!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),!o||o[2]?e.arc(i,n,s,y,v,c):e.moveTo(i+s*We(v),n+s*ze(v))}return o?o[3]&&e.lineTo(i+r*We(a),n+r*ze(a)):e.closePath(),u}class Th{static GetCanvas(){try{return Th.canvas||(Th.canvas=pr.global.createCanvas({})),Th.canvas}catch(t){return null}}static GetCtx(){if(!Th.ctx){const t=Th.GetCanvas();Th.ctx=t.getContext("2d")}return Th.ctx}}class Bh{constructor(t=[],e=100){const i=Th.GetCanvas(),n=Th.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})`}static GetOrCreate(t=[],e=100){let i="";t.forEach((t=>i+=t.join())),i+=e;let n=Bh.dataMap.get(i);return n||(n=new Bh(t,e),Bh.dataMap.set(i,n)),n}static SetColorInterpolateInstance(t,e){Bh.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return Bh.dataMap.get(t)}}Bh.dataMap=new Map;class wh{static GetSize(t){for(let e=0;e<wh.ImageSize.length;e++)if(wh.ImageSize[e]>=t)return wh.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=wh.GenKey(t,e,i,n,r),h=wh.cache[a];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=o)return h[t].pattern;return null}static Set(t,e,i,n,r,s,o,a){const h=wh.GenKey(t,e,i,n,r);wh.cache[h]?wh.cache[h].push({width:o,height:a,pattern:s}):wh.cache[h]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function Sh(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=Le;for(;i>Le;)i-=Le;if(i<s)return r[0].color;if(i>o)return r[0].color;let a,h,l=(i-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=l){a=r[t-1],h=r[t];break}return l=(l-a.offset)/(h.offset-a.offset),Uo(a.color,h.color,l,!1)}wh.cache={},wh.ImageSize=[20,40,80,160,320,640,1280,2560];const _h=Symbol.for("ArcRenderContribution"),Ch=Symbol.for("AreaRenderContribution"),Ph=Symbol.for("CircleRenderContribution"),Eh=Symbol.for("GroupRenderContribution"),Mh=Symbol.for("ImageRenderContribution"),kh=Symbol.for("PathRenderContribution"),Rh=Symbol.for("PolygonRenderContribution"),Oh=Symbol.for("RectRenderContribution"),Dh=Symbol.for("SymbolRenderContribution"),Ih=Symbol.for("TextRenderContribution"),Lh=Symbol.for("InteractiveSubRenderContribution"),Uh=["radius","startAngle","endAngle",...sa];class Nh extends ua{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Ua}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=ps(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=pr.graphicService.updateCircleAABBBounds(i,ps(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Xs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ps(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,Uh)}needUpdateTag(t){return super.needUpdateTag(t,Uh)}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 Wn;return a.arc(0,0,r,s,o),a}clone(){return new Nh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Nh.NOWORK_ANIMATE_ATTR}}function Wh(t,e={},i){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 Fh(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function jh(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}Nh.NOWORK_ANIMATE_ATTR=ca;class zh{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,h){const l=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);l.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,l,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s,o){t=t.map((t=>t.toString()));const a=[],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),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s).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),a.push({str:i,width:e});h[0]=o}h[1]=a.length*n,h[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const l={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(l,e,i),this.layoutWithBBox(l,a,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 Gh=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak",...sa];class Hh extends ua{get font(){const t=ps(this).text;return this._font||(this._font=Wh(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=ps(this).text;if(Array.isArray(e.text))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(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=ps(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text.toString())}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=Ka,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=ps(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateSingallineAABBBounds(t){const e=ps(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=ps(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,i;const n=ps(this).text,r=pr.graphicUtil.textMeasure;let s,o;const a=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:l=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontFamily:d=n.fontFamily,fontSize:p=n.fontSize,fontWeight:f=n.fontWeight,stroke:g=n.stroke,lineWidth:m=n.lineWidth,wordBreak:y=n.wordBreak,ignoreBuf:v=n.ignoreBuf}=a,b=v?0:Math.max(2,.075*p),{lineHeight:x=(null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||n.fontSize)+b)}=a;if(!this.shouldUpdateShape()&&this.cache){s=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=Fh(c,s),e=jh(u,x,p);return this._AABBBounds.set(t,e,t+s,e+x),g&&this._AABBBounds.expand(m/2),this._AABBBounds}if(Number.isFinite(h)){if(l){const e=!0===l?n.ellipsis:l,i=r.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d},h,e,!1);o=i.str,s=i.width}else{const e=r.clipText(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d},h,!1);o=e.str,s=e.width}this.cache.clipedText=o,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const A=Fh(c,s);let T=x;pr.global&&pr.global.isSafari()&&(T+=.2*p);const B=jh(u,T,p,b);return this._AABBBounds.set(A,B,A+s,B+T),g&&this._AABBBounds.expand(m/2),this._AABBBounds}updateVerticalSinglelineAABBBounds(e){var i;const n=ps(this).text,r=pr.graphicUtil.textMeasure;let s;const o=this.attribute,{ignoreBuf:a=n.ignoreBuf}=o,h=a?0:2,{maxLineWidth:l=n.maxLineWidth,ellipsis:c=n.ellipsis,textAlign:u=n.textAlign,textBaseline:d=n.textBaseline,fontSize:p=n.fontSize,fontWeight:f=n.fontWeight,fontFamily:g=n.fontFamily,stroke:m=n.stroke,lineHeight:y=(null!==(i=o.lineHeight)&&void 0!==i?i:(o.fontSize||n.fontSize)+h),lineWidth:v=n.lineWidth,wordBreak:b=n.wordBreak}=o;if(!this.shouldUpdateShape()&&this.cache){s=this.cache.clipedWidth;const t=Fh(u,s),e=jh(d,y,p);return this._AABBBounds.set(e,t,e+y,t+s),m&&this._AABBBounds.expand(v/2),this._AABBBounds}let x=[Ea(e.toString())];if(Number.isFinite(l)){if(c){const t=!0===c?n.ellipsis:c,e=r.clipTextWithSuffixVertical(x[0],{fontSize:p,fontWeight:f,fontFamily:g},l,t,!1);x=[e.verticalList],s=e.width}else{const t=r.clipTextVertical(x[0],{fontSize:p,fontWeight:f,fontFamily:g},l,!1);x=[t.verticalList],s=t.width}this.cache.verticalList=x,this.cache.clipedWidth=s}else s=0,x[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?p:r.measureTextWidth(e.text,{fontSize:p,fontWeight:f,fontFamily:g});s+=i,e.width=i})),this.cache.verticalList=x,this.cache.clipedWidth=s;this.clearUpdateShapeTag();const A=Fh(u,s),T=jh(d,y,p);return this._AABBBounds.set(T,A,T+y,A+s),m&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const i=ps(this).text,n=this.attribute,{fontFamily:r=i.fontFamily,textAlign:s=i.textAlign,textBaseline:o=i.textBaseline,fontSize:a=i.fontSize,fontWeight:h=i.fontWeight,lineHeight:l=n.lineHeight||n.fontSize||i.fontSize,ellipsis:c=i.ellipsis,maxLineWidth:u,stroke:d=i.stroke,lineWidth:p=i.lineWidth,wordBreak:f=i.wordBreak}=n;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.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 g=pr.graphicUtil.textMeasure,m=new zh(r,{fontSize:a,fontWeight:h,fontFamily:r},g).GetLayoutByLines(t,s,o,l,!0===c?i.ellipsis:c||void 0,!1,u),{bbox:y}=m;return this.cache.layoutData=m,this.clearUpdateShapeTag(),this._AABBBounds.set(y.xOffset,y.yOffset,y.xOffset+y.width,y.yOffset+y.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i;const n=ps(this).text,r=pr.graphicUtil.textMeasure;let s;const o=this.attribute,{ignoreBuf:a=n.ignoreBuf}=o,h=a?0:2,{maxLineWidth:l=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:m=n.stroke,lineHeight:y=(null!==(i=o.lineHeight)&&void 0!==i?i:(o.fontSize||n.fontSize)+h),lineWidth:v=n.lineWidth,wordBreak:b=n.wordBreak}=o;if(s=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=Fe(e,s)}));const t=Fh(u,s),e=this.cache.verticalList.length*y,i=jh(d,e,f);return this._AABBBounds.set(i,t,i+e,t+s),m&&this._AABBBounds.expand(v/2),this._AABBBounds}const x=e.map((t=>Ea(t.toString())));x.forEach(((e,i)=>{if(Number.isFinite(l))if(c){const t=!0===c?n.ellipsis:c,o=r.clipTextWithSuffixVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},l,t,!1);x[i]=o.verticalList,s=o.width}else{const t=r.clipTextVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},l,!1);x[i]=t.verticalList,s=t.width}else s=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?f:r.measureTextWidth(e.text,{fontSize:f,fontWeight:g,fontFamily:p});s+=i,e.width=i}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=Fe(e,s)}));const A=Fh(u,s),T=this.cache.verticalList.length*y,B=jh(d,T,f);return this._AABBBounds.set(B,A,B+T,A+s),m&&this._AABBBounds.expand(v/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ps(this).text[t]}needUpdateTags(t,e=Gh){return super.needUpdateTags(t,e)}needUpdateTag(t,e=Gh){return super.needUpdateTag(t,e)}clone(){return new Hh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Hh.NOWORK_ANIMATE_ATTR}}Hh.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},ca);const Vh=["heightLimit","lineClamp"];class Yh extends Hh{_isValid(){const{text:t}=this.attribute;return ve(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n;const r=ps(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,lineHeight:l=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:p=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:m=r.ignoreBuf,heightLimit:y=0,lineClamp:v}=this.attribute,b=m?0:2;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.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 x=pr.graphicUtil.textMeasure,A=new zh(s,{fontSize:h,fontWeight:g,fontFamily:s},x),T=t.map((t=>t.toString())),B=[],w=[0,0];let S=1/0;if(y>0&&(S=Math.max(Math.floor(y/l),1)),v&&(S=Math.min(S,v)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<T.length;t++){const e=T[t];let r=!0;if(t===S-1){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,u,c,!1);B.push({str:t.str,width:t.width});break}const s=A.textMeasure.clipText(e,A.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,u,c,!1);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(n=t.width)&&void 0!==n?n:0}else s.str="",s.width=0;r=!1}if(B.push({str:s.str,width:s.width}),s.str.length===e.length);else if(r){const i=e.substring(s.str.length);T.splice(t+1,0,i)}}let t=0;B.forEach((e=>{t=Math.max(t,e.width)})),w[0]=t}else{let t,e,i=0;for(let n=0,r=T.length;n<r;n++){if(n===S-1){const t=A.textMeasure.clipTextWithSuffix(T[n],A.textOptions,u,c,!1);B.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=T[n],t=A.textMeasure.measureTextWidth(e,A.textOptions,"break-word"===f),i=Math.max(i,t),B.push({str:e,width:t})}w[0]=i}w[1]=B.length*(l+b);const _={xOffset:0,yOffset:0,width:w[0],height:w[1]};A.LayoutBBox(_,o,a);const C=A.layoutWithBBox(_,B,o,a,l);return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(_.xOffset,_.yOffset,_.xOffset+_.width,_.yOffset+_.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<Vh.length;e++){const i=Vh[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Vh.length;e++){if(t===Vh[e])return!0}return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Yh.NOWORK_ANIMATE_ATTR}}class Xh{bounds(t,e){if(xe(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 qh(t,e,i,n,r){return r?t.arc(i,n,e,0,Ie,!1,r):t.arc(i,n,e,0,Ie),!1}var Kh=new class extends Xh{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 qh(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return qh(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 $h=new class extends Xh{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 Zh(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 Jh=new class extends Xh{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 Zh(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return Zh(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Zh(t,e/2+r,i,n,s)}};function Qh(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var tl=new class extends Xh{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Qh(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Qh(t,e/2+r,i,n)}};class el extends Xh{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 il=new el;var nl=new class extends el{constructor(){super(...arguments),this.type="triangle"}};const rl=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),sl=Math.sin(Ie/10)*rl,ol=-Math.cos(Ie/10)*rl;function al(t,e,i,n){const r=sl*e,s=ol*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=Ie*o/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*r-l*s+i,l*r+h*s+n)}return t.closePath(),!0}var hl=new class extends Xh{constructor(){super(...arguments),this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return al(t,e/2,i,n)}drawOffset(t,e,i,n,r){return al(t,e/2+r,i,n)}};const ll=Ge(3);function cl(t,e,i,n){const r=e,s=r/ll,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 ul=new class extends Xh{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 cl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return cl(t,e/2+r,i,n)}};function dl(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 pl=new class extends Xh{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}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 fl(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var gl=new class extends Xh{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return fl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return fl(t,e/2+r,i,n)}};const ml=-.5,yl=Ge(3)/2,vl=1/Ge(12);function bl(t,e,i,n){const r=e/2,s=e*vl,o=r,a=e*vl+e,h=-o,l=a;return t.moveTo(r+i,s+n),t.lineTo(o+i,a+n),t.lineTo(h+i,l+n),t.lineTo(ml*r-yl*s+i,yl*r+ml*s+n),t.lineTo(ml*o-yl*a+i,yl*o+ml*a+n),t.lineTo(ml*h-yl*l+i,yl*h+ml*l+n),t.lineTo(ml*r+yl*s+i,ml*s-yl*r+n),t.lineTo(ml*o+yl*a+i,ml*a-yl*o+n),t.lineTo(ml*h+yl*l+i,ml*l-yl*h+n),t.closePath(),!1}var xl=new class extends Xh{constructor(){super(...arguments),this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return bl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return bl(t,e/2+r,i,n)}};var Al=new class extends Xh{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 Tl=new class extends Xh{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 Bl=new class extends Xh{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 wl=Ge(3);function Sl(t,e,i,n){const r=e*wl;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var _l=new class extends el{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Sl(t,e/2/wl,i,n)}drawOffset(t,e,i,n,r){return Sl(t,e/2/wl+r,i,n)}};function Cl(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 Pl=new class extends Xh{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 Cl(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Cl(t,e/4+r,i,n)}};function El(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 Ml=new class extends Xh{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 El(t,e/4,i,n)}drawOffset(t,e,i,n,r){return El(t,e/4+r,i,n)}};function kl(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 Rl=new class extends Xh{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 kl(t,e/4,i,n)}drawOffset(t,e,i,n,r){return kl(t,e/4+r,i,n)}};function Ol(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 Dl=new class extends Xh{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 Ol(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Ol(t,e/4+r,i,n)}};function Il(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Ll=new class extends Xh{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return Il(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return Il(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 Ul(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Nl=new class extends Xh{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return Ul(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return Ul(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 Wl(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 Fl=new class extends Xh{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 Wl(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return Wl(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 jl(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}var zl=new class extends Xh{constructor(){super(...arguments),this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return jl(t,xe(e)?[e,e]:e,i,n)}drawOffset(t,e,i,n,r){return jl(t,xe(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],i,n)}};const Gl=new Qe;class Hl{constructor(t,e,i=!1){this.pathStr="",this.type=t,ve(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(),en(r.path.commandList,t,i,n,e,e),o&&o(r.path,r.attribute)})),!1):(en(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(),en(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(en(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((({path:i})=>{Gl.x1=i.bounds.x1*t,Gl.y1=i.bounds.y1*t,Gl.x2=i.bounds.x2*t,Gl.y2=i.bounds.y2*t,e.union(Gl)}))}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 Vl=[Kh,$h,Jh,tl,_l,nl,hl,ul,pl,gl,xl,Al,Tl,il,Bl,Pl,Ml,Rl,Dl,zl,Ll,Nl,Fl],Yl={};Vl.forEach((t=>{Yl[t.type]=t}));const Xl=["symbolType","size",...sa];let ql=class t extends ua{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=qa}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return ve(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=ps(this).symbol,{symbolType:i=e.symbolType}=this.attribute;let n=Yl[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(!0===Ba(i)){const e=new Ta,{svg:n}=e.parse(i);if(!n)return null;const r=ve(n.path)?n.path:[n.path],s=new Qe,o=[];r.forEach((t=>{const e=(new Wn).fromString(t.d),i={fill:"black"};eh.forEach((e=>{t[e]&&(i[th[e]]=t[e])})),o.push({path:e,attribute:i}),s.union(e.bounds)}));const a=s.width(),h=s.height(),l=1/Fe(a,h);return o.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new Hl(i,o,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new Wn).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/Fe(s,o);return r.transform(0,0,a,a),this._parsedPath=new Hl(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=ps(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=pr.graphicService.updateSymbolAABBBounds(i,ps(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Xs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ps(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,Xl)}needUpdateTag(t){return super.needUpdateTag(t,Xl)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=ve(e)?e:[e,e];return t.path?(new Wn).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Wn).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};ql.userSymbolMap={},ql.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},ca);const Kl=["segments","points","curveType",...sa];let $l=class t extends ua{constructor(t={}){super(t),this.type="line",this.numberType=ja}isValid(){return super.isValid()&&this._isValid()}_isValid(){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=Qs(i,n,e))}doUpdateAABBBounds(){const t=ps(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updateLineAABBBounds(e,ps(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ps(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,Kl)}needUpdateTag(t){return super.needUpdateTag(t,Kl)}toCustomPath(){const t=this.attribute,e=new Wn,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}};$l.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},ca);const Zl=["width","height","cornerRadius",...sa];class Jl extends ua{constructor(t){super(t),this.type="rect",this.numberType=Va}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=ps(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updateRectAABBBounds(e,ps(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ps(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,Zl)}needUpdateTag(t){return super.needUpdateTag(t,Zl)}toCustomPath(){const t=this.attribute,e=t.width,i=t.height,n=new Wn;return n.moveTo(0,0),n.rect(0,0,e,i),n}clone(){return new Jl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Jl.NOWORK_ANIMATE_ATTR}}Jl.NOWORK_ANIMATE_ATTR=ca;const Ql=[[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 tc extends Jl{constructor(t){super(t),this.type="rect3d",this.numberType=Ya}findFace(){const t={polygons:[],vertices:[],edges:[]},e=ps(this).rect3d,{width:i=e.width,height:n=e.width,length:r=je(e.width,e.height)}=this.attribute;for(let e=0;e<Ql.length;e++){const s=Ql[e];t.vertices.push([s[0]*i,s[1]*n,s[2]*r])}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 tc.NOWORK_ANIMATE_ATTR}}tc.NOWORK_ANIMATE_ATTR=ca;class ec extends ua{constructor(t){super(t),this.type="glyph",this.numberType=Na,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,e=!1,i){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.setValue(1/0,1/0,-1/0,-1/0);const t=pr.graphicService.updateGlyphAABBBounds(this.attribute,ps(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;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.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new ec(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return ec.NOWORK_ANIMATE_ATTR}}ec.NOWORK_ANIMATE_ATTR=ca;class ic{constructor(t,e,i,n,r,s,o,a,h,l,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=h,this.layoutDirection=l,this.directionKey=fr[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;switch(this.globalAlign){case"left":a=0;break;case"center":a=-r/2;break;case"right":a=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)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]+h)return l;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}else{const i=Math.floor((h-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,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=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,a,s+o,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,a,s+o,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===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}}}}return l}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=this.lines[i].getWidthWithEllips();n>t&&(t=n),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=this.lines[i].getWidthWithEllips();n>t&&(t=n),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=this.lines[i].getWidthWithEllips();n>t&&(t=n),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 nc{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic","number"==typeof i.lineHeight?this.lineHeight=i.lineHeight>this.fontSize?i.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:s,width:o}=Tr(t,i);let a=0,h=0,l=0;this.height>r&&(a=(this.height-r)/2,h=Math.ceil(a),l=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+l),this.length=t.length,this.width=o||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)}updateWidth(){const{width:t}=Tr(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="...",a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=xr(s,("vertical"===a?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+="...","right"===r){const{width:e}=Tr(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||mr;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const i=e&&e.fill||gr;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,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=xr(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=Tr(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const rc=["width","height","image",...sa];class sc extends ua{constructor(t){super(t),this.type="image",this.numberType=Fa,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()}))}doUpdateAABBBounds(){const t=ps(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updateImageAABBBounds(e,ps(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return cr[t]}needUpdateTags(t){return super.needUpdateTags(t,rc)}needUpdateTag(t){return super.needUpdateTag(t,rc)}clone(){return new sc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sc.NOWORK_ANIMATE_ATTR}}sc.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},ca);class oc extends sc{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=Xs(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(ve(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Xs(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=cr.width,height:e=cr.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 ac{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 oc?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=fr[this.direction];const h=this.directionKey;this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof nc){const e=br.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;let c=this.left,u=0;if(this.actualWidth<e&&!a)switch(this.textAlign){case"right":c=e-this.actualWidth;break;case"center":c=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?c=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof oc?(t["_"+h.x]=c,c+=t[h.width]+u,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?l-t.height:(l-t.height)/2):(t[h.left]=c,c+=t[h.width]+u)}))}draw(t,e,i,n,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof oc)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=Tr("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add";break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}}this.paragraphs.map(((e,s)=>{if(e instanceof oc)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof oc)break;const{width:n}=Tr("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}let e=0;return this.paragraphs.map(((t,i)=>{e+=t instanceof oc?t.width:t.getWidthWithEllips(this.direction)})),e}}class hc{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=fr[this.direction]}store(t){if(t instanceof oc){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 ac(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 oc?"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=xr(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 nc(i,t.newLine,t.character),new nc(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const lc=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...sa];class cc extends ua{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Xa}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:lr.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:lr.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:lr.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:lr.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:lr.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:lr.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:lr.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:lr.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=ps(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updateRichTextAABBBounds(e,ps(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return lr[t]}needUpdateTags(t){return super.needUpdateTags(t,lc)}needUpdateTag(t){return super.needUpdateTag(t,lc)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:i,maxHeight:n,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:h,textAlign:l,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const i=e[t],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)p.push(n);else{const t=new oc(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else if(e[t].text.includes("\n")){const i=e[t].text.split("\n");for(let n=0;n<i.length;n++)p.push(new nc(i[n],0!==n,e[t]))}else p.push(new nc(e[t].text,!1,e[t]));const f=new ic(0,0,("number"==typeof i&&(!r||r>i)?i:r)||0,("number"==typeof n&&(!s||s>n)?n:s)||0,o,a,h,l,c,u||"horizontal","number"==typeof i&&(!r||r>i),"number"==typeof n&&(!s||s>n),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new hc(f);for(let t=0;t<p.length;t++)g.deal(p[t]);g.send(),this._frameCache=f}clone(){return new cc(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;e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n)})),r}getNoWorkAnimateAttr(){return cc.NOWORK_ANIMATE_ATTR}}cc.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},ca);const uc=["path","customPath",...sa];class dc extends ua{constructor(t){super(t),this.type="path",this.numberType=za}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=ps(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Wn?e.path:(pe(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Wn?this.cache:t.path)}doUpdateAABBBounds(){const t=ps(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updatePathAABBBounds(e,ps(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;ye(t.path,!0)?this.cache=(new Wn).fromString(t.path):t.customPath&&(this.cache=new Wn,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ps(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,uc)}needUpdateTag(t){return super.needUpdateTag(t,uc)}toCustomPath(){return(new Wn).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new dc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return dc.NOWORK_ANIMATE_ATTR}}dc.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},ca);const pc=["segments","points","curveType",...sa];class fc extends ua{constructor(t){super(t),this.type="area",this.numberType=La}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=ps(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updateAreaAABBBounds(e,ps(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Qs(i,n,e))}getDefaultAttribute(t){return ps(this).area[t]}needUpdateTags(t){return super.needUpdateTags(t,pc)}needUpdateTag(t){return super.needUpdateTag(t,pc)}toCustomPath(){const t=new Wn,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 fc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fc.NOWORK_ANIMATE_ATTR}}fc.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},ca);const gc=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...sa];class mc extends ua{constructor(t){super(t),this.type="arc",this.numberType=Da}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=ps(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:i=t.outerRadius,innerRadius:n=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(i-n);return Math.min(xe(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=ps(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=ti(e),i=e+s,n&&Ue(s)<Le-Re){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));const{outerRadius:a=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute,l=Math.abs(a-h)/2,c=l/a;if(l>Re&&a>Re)return{startAngle:e-r*c*s,endAngle:i+r*c*o,sc:r*c*s,ec:r*c*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=ps(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:s=i.padAngle}=this.attribute,{padRadius:o=Ge(n*n+r*r)}=this.attribute,a=Ue(e-t);let h=t,l=e,c=t,u=e;const d=s/2;let p=a,f=a;if(d>Re&&o>Re){const i=e>t?1:-1;let s=Ye(Number(o)/r*ze(d)),a=Ye(Number(o)/n*ze(d));return(p-=2*s)>Re?(s*=i,c+=s,u-=s):(p=0,c=u=(t+e)/2),(f-=2*a)>Re?(a*=i,h+=a,l-=a):(f=0,h=l=(t+e)/2),{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=ps(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=pr.graphicService.updateArcAABBBounds(i,ps(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Xs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,gc)}needUpdateTag(t){return super.needUpdateTag(t,gc)}getDefaultAttribute(t){return ps(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const s=Ue(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new Wn;if(r<=Re)a.moveTo(0,0);else if(s>=Le-Re)a.moveTo(0+r*We(e),0+r*ze(e)),a.arc(0,0,r,e,i,!o),n>Re&&(a.moveTo(0+n*We(i),0+n*ze(i)),a.arc(0,0,n,i,e,o));else{const t=r*We(e),s=r*ze(e),h=n*We(i),l=n*ze(i);a.moveTo(0+t,0+s),a.arc(0,0,r,e,i,!o),a.lineTo(0+h,0+l),a.arc(0,0,n,i,e,o),a.closePath()}return a}clone(){return new mc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return mc.NOWORK_ANIMATE_ATTR}}mc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},ca);class yc extends mc{constructor(t){super(t),this.type="arc3d",this.numberType=Ia}doUpdateAABBBounds(){const t=ps(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updateArc3dAABBBounds(e,ps(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return yc.NOWORK_ANIMATE_ATTR}}yc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},ca);const vc=["points","cornerRadius",...sa];class bc extends ua{constructor(t){super(t),this.type="polygon",this.numberType=Ga}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=ps(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updatePolygonAABBBounds(e,ps(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Qs(i,n,e))}getDefaultAttribute(t){return ps(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,vc)}needUpdateTag(t){return super.needUpdateTag(t,vc)}toCustomPath(){const t=this.attribute.points,e=new Wn;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 bc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return bc.NOWORK_ANIMATE_ATTR}}bc.NOWORK_ANIMATE_ATTR=ca;class xc extends bc{constructor(t){super(t),this.type="pyramid3d",this.numberType=Ha}doUpdateAABBBounds(){const t=ps(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pr.graphicService.updatePyramid3dAABBBounds(e,ps(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Xs(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=$e.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=Fe(r,e);const o=$e.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=Fe(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 xc.NOWORK_ANIMATE_ATTR}}xc.NOWORK_ANIMATE_ATTR=ca;let Ac=class{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}};Ac=X([U()],Ac);const Tc=Symbol.for("RectBoundsContribution");let Bc=class extends Ac{};Bc=X([U()],Bc);const wc=Symbol.for("SymbolBoundsContribution");let Sc=class extends Ac{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;Sa(i,n+s+a/2,!0,o)}return i}};Sc=X([U()],Sc);const _c=Symbol.for("CircleBoundsContribution");let Cc=class extends Ac{};Cc=X([U()],Cc);const Pc=Symbol.for("ArcBoundsContribution");let Ec=class extends Ac{};Ec=X([U()],Ec);const Mc=Symbol.for("PathBoundsContribution");let kc=class extends Ac{};kc=X([U()],kc);const Rc=Symbol.for("MatrixAllocate"),Oc=Symbol.for("Mat4Allocate");function Dc(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class Ic{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new ii(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 ii(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(...t){this.pools=[]}}class Lc{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 Lc.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(...t){this.pools=[]}}const Uc=new Ic,Nc=new Lc;function Wc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],h=e[7],l=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+l*n,t[5]=o*r+c*n,t[6]=a*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-o*n,t[10]=u*r-a*n,t[11]=d*r-h*n,t}function Fc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=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-l*n,t[1]=o*r-c*n,t[2]=a*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=o*n+c*r,t[10]=a*n+u*r,t[11]=h*n+d*r,t}function jc(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,h,l,c,u,d,p,f,g,m,y;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],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],m=e[10],y=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=m,t[11]=y,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+u*r+g*s+e[13],t[14]=h*n+d*r+m*s+e[14],t[15]=l*n+p*r+y*s+e[15]),t}function zc(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 Gc(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],y=e[14],v=e[15];let b=i[0],x=i[1],A=i[2],T=i[3];return t[0]=b*n+x*a+A*u+T*g,t[1]=b*r+x*h+A*d+T*m,t[2]=b*s+x*l+A*p+T*y,t[3]=b*o+x*c+A*f+T*v,b=i[4],x=i[5],A=i[6],T=i[7],t[4]=b*n+x*a+A*u+T*g,t[5]=b*r+x*h+A*d+T*m,t[6]=b*s+x*l+A*p+T*y,t[7]=b*o+x*c+A*f+T*v,b=i[8],x=i[9],A=i[10],T=i[11],t[8]=b*n+x*a+A*u+T*g,t[9]=b*r+x*h+A*d+T*m,t[10]=b*s+x*l+A*p+T*y,t[11]=b*o+x*c+A*f+T*v,b=i[12],x=i[13],A=i[14],T=i[15],t[12]=b*n+x*a+A*u+T*g,t[13]=b*r+x*h+A*d+T*m,t[14]=b*s+x*l+A*p+T*y,t[15]=b*o+x*c+A*f+T*v,t}function Hc(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:o=i.z,dx:a=i.dx,dy:h=i.dy,dz:l=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:m=e.attribute.anchor,anchor:y}=e.attribute,v=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=m[1];v[2]=null!==(n=m[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),jc(t,t,[r+a,s+h,o+l]),jc(t,t,[v[0],v[1],v[2]]),Wc(t,t,f),Fc(t,t,p),jc(t,t,[-v[0],-v[1],v[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=Nc.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}jc(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],h=e[3],l=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+l*n,t[1]=o*r+c*n,t[2]=a*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-o*n,t[6]=u*r-a*n,t[7]=d*r-h*n}(i,i,g),jc(i,i,[-n[0],-n[1],0]),Gc(t,t,i)}}function Vc(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t,e,i,n,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=i,this.circleBoundsContribitions=n,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new ne(["graphic"]),onSetStage:new ne(["graphic","stage"]),onRemove:new ne(["graphic"]),onAddIncremental:new ne(["graphic","group","stage"]),onClearIncremental:new ne(["graphic","group","stage"]),beforeUpdateAABBBounds:new ne(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new ne(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Qe,this.tempAABBBounds2=new Qe}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)}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 Mi(t);return en(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){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._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),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{width:r,height:s,path:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),a||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateGlyphAABBBounds(t,e,i,n){return n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}updateRichTextAABBBounds(t,e,i,n){if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:h=e.textAlign,textBaseline:l=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:h}=t.getActualSize();let l=r||e||0,c=s||h||0;c="number"==typeof a&&c>a?a:c||0,l="number"==typeof o&&l>o?o:l||0,i.set(0,0,l,c)}let c=0;switch(l){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-i.height()}let u=0;switch(h){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),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){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:h=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(l){Sa(s,l/Math.abs(a+h),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),Ze(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){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||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),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 h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){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){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}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,i,n){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){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||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),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>Le-Re?i.set(-o,-o,o,o):$s(r,s,o,i),i}updateArcAABBBounds(t,e,i,n,r){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||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),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){const{outerRadius:r=e.outerRadius}=t;return i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;if(r<s){const t=r;r=s,s=t}let{endAngle:o=e.endAngle,startAngle:a=e.startAngle}=t;if(a>o){const t=a;a=o,o=t}return r<=Re?i.set(0,0,0,0):Math.abs(o-a)>Le-Re?i.set(-r,-r,r,r):($s(a,o,r,i),$s(a,o,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){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||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),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(ve(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.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.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){const{scaleX:s=i.scaleX,scaleY:o=i.scaleY,stroke:a=i.stroke,shadowBlur:h=i.shadowBlur,lineWidth:l=i.lineWidth,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){Sa(u,l/Math.abs(s+o),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(h){Sa(u,h/Math.abs(s+o),n,c),e.union(u)}this.combindShadowAABBBounds(e,r),Ze(e,e,r.transMatrix)}},t.DefaultGraphicService=X([U(),q(0,I(Za)),q(1,I(Jt)),q(1,N(Tc)),q(2,I(Jt)),q(2,N(wc)),q(3,I(Jt)),q(3,N(_c)),q(4,I(Jt)),q(4,N(Pc)),q(5,I(Jt)),q(5,N(Mc)),K("design:paramtypes",[Object,Object,Object,Object,Object,Object])],t.DefaultGraphicService);class Yc extends nh{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(t=!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 Xc(t){return new mc(t)}function qc(t){return new fc(t)}function Kc(t){return new Nh(t)}function $c(t){return new nh(t)}function Zc(t){return new $l(t)}function Jc(t){return new dc(t)}function Qc(t){return new Jl(t)}function tu(t){return new tc(t)}function eu(t){return new Hh(t)}function iu(t){return new Yh(t)}function nu(t){return new ql(t)}function ru(t){return new sc(t)}function su(t){return new bc(t)}function ou(t){return new Yc(t)}function au(t){return new cc(t)}const hu={arc:Xc,area:qc,circle:Kc,group:$c,image:ru,line:Zc,path:Jc,rect:Qc,rect3d:tu,symbol:nu,text:eu,richtext:au,polygon:su,shadowRoot:ou,wrapText:iu},lu=eu({text:""});const cu=au({});function uu(e,i,n,r,s){var o;const{offsetX:a=0,offsetY:h=0,offsetZ:l=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+h,l),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+h,l)}else c&&(i=!i,e.lineTo(c.x+a,c.y+h,l))}t=n}else t=n}))}else g.forEach((t=>{t.defined?(f&&e.moveTo(t.p0.x+a,t.p0.y+h,l),fu(e,t,1,s),f=!1):f=!0}));return}if(n<=0)return;let m;"x"===r?m=t.Direction.ROW:"y"===r?m=t.Direction.COLUMN:"auto"===r&&(m=i.direction);const y=n*i.tryUpdateLength(m);let v=0,b=!0,x=null;for(let t=0,i=g.length;t<i;t++){const i=g[t],n=i.getLength(m),r=(y-v)/n;if(v+=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+h,l),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+h,l)}else s&&(b=!b,e.lineTo(s.x+a,s.y+h,l))}x=i}else{if(!i.defined){f=!0;continue}f&&e.moveTo(i.p0.x+a,i.p0.y+h,l),fu(e,i,je(r,1),s),f=!1}}}function du(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,h,l;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!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}function fu(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]=hn(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 gu(e,i,n,r){var s;const{drawConnect:o=!1,mode:a="none"}=r||{};if(o&&"none"===a)return;const{top:h,bottom:l}=i;if(n>=1){const t=[],i=[];let n=!0;if(o){let n,s,o=!0;const a=h.curves.length;h.curves.forEach(((h,c)=>{const u=l.curves[a-c-1];let d=h,p=u;if(h.originP1===h.originP2)return n=h,void(s=u);if(n&&n.originP1===n.originP2&&(d=n,p=s),h.defined)o||(t.push(d),i.push(p),mu(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=h;let a,l;n&&!1!==n.defined?(a=d,l=p):n&&!1!==s.defined&&(a=h,l=u),o?(o=!o,t.push(a||h),i.push(l||u)):a&&(o=!o,t.push(a||h),i.push(l||u),mu(e,t,i,r),t.length=0,i.length=0)}n=h})),mu(e,t,i,r)}else{for(let s=0,o=h.curves.length;s<o;s++){const a=h.curves[s];n!==a.defined?(n?(yu(e,t,i,r),t.length=0,i.length=0):(t.push(a),i.push(l.curves[o-s-1])),n=!n):n&&(t.push(a),i.push(l.curves[o-s-1]))}yu(e,t,i,r)}return}if(n<=0)return;let{direction:c}=r||{};const{curves:u}=h,d=null!==(s=u[u.length-1].p3)&&void 0!==s?s:u[u.length-1].p1,p=Ue(d.x-u[0].p0.x),f=Ue(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 m=0,y=!0;const v=[],b=[];let x,A,T=!0;for(let t=0,i=h.curves.length;t<i;t++){const n=h.curves[t],s=n.getLength(c),a=(g-m)/s;if(a<0)break;if(m+=s,o){const s=l.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){x=n,A=s;continue}if(x&&x.originP1===x.originP2&&(o=x,a=A),n.defined)T||(v.push(o),b.push(a),mu(e,v,b,r),v.length=0,b.length=0,T=!T);else{const{originP1:t,originP2:i}=n;let h,l;t&&!1!==t.defined?(h=o,l=a):t&&!1!==i.defined&&(h=n,l=s),T?(T=!T,v.push(h||n),b.push(l||s)):h&&(T=!T,v.push(h||n),b.push(l||s),mu(e,v,b,r),v.length=0,b.length=0)}x=n}else{let s=null,o=null;y!==n.defined?(y?(yu(e,v,b,r),v.length=0,b.length=0):(s=n,o=l.curves[i-t-1]),y=!y):y&&(s=n,o=l.curves[i-t-1]),s&&o&&(a<1&&(s=s.p2&&s.p3?hn(s,a)[0]:cn(s,a)[0],o=o.p2&&o.p3?hn(o,1-a)[1]:cn(o,1-a)[1]),s.defined=y,o.defined=y,v.push(s),b.push(o)),s=null,o=null}}o?mu(e,v,b,r):yu(e,v,b,r)}function mu(t,e,i,n){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=n||{};let h=e[0];t.moveTo(h.p0.x+r,h.p0.y+s,o),h=e[e.length-1];let l=h.p3||h.p1;t.lineTo(l.x+r,l.y+s,o),h=i[i.length-1],t.lineTo(h.p0.x+r,h.p0.y+s,o),h=i[0],l=h.p3||h.p1,t.lineTo(l.x+r,l.y+s,o),t.closePath()}function yu(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),vu(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(a&&t.lineTo(h.p0.x+r,h.p0.y+s,o),vu(t,h,1,n),a=!1):a=!0}t.closePath()}function vu(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]=hn(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 bu(t,e,i){switch(e){case"linear":default:return mn(t,i);case"basis":return An(t,i);case"monotoneX":return En(t,i);case"monotoneY":return kn(t,i);case"step":return On(t,.5,i);case"stepBefore":return On(t,0,i);case"stepAfter":return On(t,1,i);case"linearClosed":return Ln(t,i)}}t.BaseRender=class{init(e){e&&(this.renderContribitions=e,this._renderContribitions=e.getContributions(),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,h,l,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}afterRenderStep(t,e,i,n,r,s,o,a,h,l,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}valid(t,e,i,n){const{fill:r=e.fill,background:s,stroke:o=e.stroke,opacity:a=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:l=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=fh(a,h,r),p=mh(a,c),f=dh(r,s),g=ph(o,l);return!(!t.valid||!u)&&(!(!f&&!g)&&(!!(d||p||i||n||s)&&{fVisible:d,sVisible:p,doFill:f,doStroke:g}))}transform(t,e,i,n=!1){const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:h=e.scaleX,scaleY:l=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,p=i.modelMatrix,f=i.camera,g={x:s,y:o,z:a,lastModelMatrix:p},m=f&&(n||Vc(t));if(m){const n=Nc.allocate(),r=Nc.allocate();Hc(r,t,e),Gc(n,p||n,r),g.x=0,g.y=0,g.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Nc.free(r)}if(d&&!p){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,g.z=a,i.setTransformForCurrent()}else if(m)g.x=0,g.y=0,g.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(f&&i.project){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,this.transformWithoutTranslate(i,g.x,g.y,g.z,h,l,c)}else i.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}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),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+u.y*a.x+(c.y-u.y)*o.x)*d,f=(c.y*h.y+l.y*(a.y-h.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(l.x*(h.x-a.x)-c.x*h.x+u.x*a.x+(c.x-u.x)*o.x)*d,m=-(c.x*h.y+l.x*(a.y-h.y)-u.x*a.y+(u.x-c.x)*o.y)*d,y=(l.x*(u.y*a.x-c.y*h.x)+l.y*(c.x*h.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,v=(l.x*(u.y*a.y-c.y*h.y)+l.y*(c.x*h.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;n.setTransform(p,f,g,m,y,v,!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;s.highPerformanceSave();const o=this.transform(t,e,s,i),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,vh(t,s,a,h,0,r)||(this.drawShape(t,s,a,h,n,r),this.z=0,s.modelMatrix!==c&&Nc.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}},t.BaseRender=X([U()],t.BaseRender),t.DefaultCanvasArcRender=class extends t.BaseRender{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=Da,this.init(t)}drawArcTailCapPath(t,e,i,n,r,s,o,a){const h=a-o,l=t.getParsedAngle(),c=l.startAngle;let u=l.endAngle;u=a;const d=Ue(u-c),p=u>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:m,innerDeltaAngle:y,outerStartAngle:v,outerEndAngle:b,innerEndAngle:x,innerStartAngle:A}=t.getParsePadAngle(c,u),T=g,B=g,w=g,S=g,_=Math.max(B,T),C=Math.max(w,S);let P=_,E=C;const M=r*We(v),k=r*ze(v),R=s*We(x),O=s*ze(x);let D,I,L,U;if((C>Re||_>Re)&&(D=r*We(b),I=r*ze(b),L=s*We(A),U=s*ze(A),d<Oe)){const t=bh(M,k,L,U,D,I,R,O);if(t){const e=M-t[0],i=k-t[1],n=D-t[0],o=I-t[1],a=1/ze(Ve((e*n+i*o)/(Ge(e*e+i*i)*Ge(n*n+o*o)))/2),h=Ge(t[0]*t[0]+t[1]*t[1]);E=je(C,(s-h)/(a-1)),P=je(_,(r-h)/(a+1))}}if(P>Re){const t=je(T,P),s=je(B,P),o=xh(L,U,M,k,r,t,Number(p)),a=xh(D,I,R,O,r,s,Number(p));if(P<_&&t===s)e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,P,Ne(o.y01,o.x01),Ne(a.y01,a.x01),!p);else{const t=u-h-.03,o=Ne(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,Ne(a.y11,a.x11),Ne(a.y01,a.x01),!p)}}else e.moveTo(i+M,n+k);if(!(s>Re)||y<.001)e.lineTo(i+R,n+O),f=!0;else if(E>Re){const t=je(S,E),r=je(w,E),o=xh(R,O,D,I,s,-r,Number(p)),a=xh(M,k,L,U,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),E<C&&t===r){const t=Ne(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,E,Ne(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,Ne(o.y01,o.x01),Ne(o.y11,o.x11),!p);const t=Ne(o.cy+o.y11,o.cx+o.x11),a=u-h-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*We(A),n+s*ze(A));return f}drawShape(t,e,i,n,r,s,o,a){const h=ps(t,null==s?void 0:s.theme).arc,{fill:l=h.fill,stroke:c=h.stroke,x:u=h.x,y:d=h.y}=t.attribute,p=this.valid(t,h,o,a);if(!p)return;const{fVisible:f,sVisible:g,doFill:m,doStroke:y}=p,{outerRadius:v=h.outerRadius,innerRadius:b=h.innerRadius,cap:x=h.cap,forceShowCap:A=h.forceShowCap}=t.attribute;let T=0;const B=(ue(x)&&x||x[0])&&"conical"===l.gradient;if(B){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();Ue(n-i)<Le-Re&&(T=e||0,l.startAngle-=T,l.endAngle-=T)}let w=!1;const{isFullStroke:S,stroke:_}=Vs(c);if((m||S)&&(e.beginPath(),Ah(t,e,i,n,v,b),w=!0,this.beforeRenderStep(t,e,i,n,m,y,f,g,h,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),m&&(o?o(e,t.attribute,h):f&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill())),y&&S&&(a?a(e,t.attribute,h):g&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,h),e.stroke()))),!S&&y&&(e.beginPath(),Ah(t,e,i,n,v,b,_),w||this.beforeRenderStep(t,e,i,n,m,y,f,g,h,r,o,a),a?a(e,t.attribute,h):g&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),(ue(x)&&x||x[1])&&A){const{startAngle:s,endAngle:l}=t.getParsedAngle();if(Ue(l-s)>=Le-Re){e.beginPath();const s=Math.abs(v-b)/2/v,{endAngle:l=h.endAngle,fill:c=h.fill}=t.attribute,u=l;if(this.drawArcTailCapPath(t,e,i,n,v,b,u,u+s),w||this.beforeRenderStep(t,e,i,n,m,y,f,g,h,r,o,a),m){const r=c;if("conical"===r.gradient){const s=Sh(0,0,l,r);o||fh&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=s,e.fill())}}y&&(a||g&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))}}this.afterRenderStep(t,e,i,n,m,y,f,g,h,r,o,a),B&&(l.startAngle+=T,l.endAngle+=T)}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}},t.DefaultCanvasArcRender=X([U(),q(0,I(Jt)),q(0,N(_h)),K("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class extends t.BaseRender{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=Ua,this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=ps(t,null==s?void 0:s.theme).circle,{radius:l=h.radius,startAngle:c=h.startAngle,endAngle:u=h.endAngle,x:d=h.x,y:p=h.y}=t.attribute,f=this.valid(t,h,o,a);if(!f)return;const{fVisible:g,sVisible:m,doFill:y,doStroke:v}=f;e.beginPath(),e.arc(i,n,l,c,u),e.closePath(),this.beforeRenderStep(t,e,i,n,y,v,g,m,h,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),y&&(o?o(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,d-i,p-n,h),e.fill())),v&&(a?a(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,y,v,g,m,h,r,o,a)}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}},t.DefaultCanvasCircleRender=X([U(),q(0,I(Jt)),q(0,N(Ph)),K("design:paramtypes",[Object])],t.DefaultCanvasCircleRender),t.DefaultCanvasLineRender=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=ja}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){var g,m,y,v,b;if(!e)return;t.beginPath();const x=null!==(g=this.z)&&void 0!==g?g:0;uu(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x}),d.cache&&!ve(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,o,a);const{x:A=0,x:T=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,o,A-c,T-u,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,o,A-c,T-u,a),t.stroke()));let{connectedType:B,connectedX:w,connectedY:S,connectedStyle:_}=o;if(ve(a)?(B=null!==(m=null!=B?B:a[0].connectedType)&&void 0!==m?m:a[1].connectedType,w=null!==(y=null!=w?w:a[0].connectedX)&&void 0!==y?y:a[1].connectedX,S=null!==(v=null!=S?S:a[0].connectedY)&&void 0!==v?v:a[1].connectedY,_=null!==(b=null!=_?_:a[0].connectedStyle)&&void 0!==b?b:a[1].connectedStyle):(B=null!=B?B:a.connectedType,w=null!=w?w:a.connectedX,S=null!=S?S:a.connectedY,_=null!=_?_:a.connectedStyle),"connect"!==B&&"zero"!==B&&(B="none"),"none"!==B){t.beginPath(),uu(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x,drawConnect:!0,mode:B,zeroX:w,zeroY:S});const g=[];ve(a)?a.forEach((t=>g.push(t))):g.push(a),g.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,_,A-c,T-u,g),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,_,A-c,T-u,g),t.stroke()))}return!1}drawShape(t,e,i,n,r,s,o,a){const h=ps(t,null==s?void 0:s.theme).line,{fill:l=h.fill,stroke:c=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:d=h.strokeOpacity}=t.attribute;if(!this.valid(t,h,o,a))return;if(t.shouldUpdateShape()){const{points:e,segments:i,closePath:n}=t.attribute;let{curveType:r=h.curveType}=t.attribute;n&&"linear"===r&&(r="linearClosed");const s=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 s=Nn(t.points,r,{startPoint:e});return n=s,s})).filter((t=>!!t)),"linearClosed"===r){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=Nn(s,r)}t.clearUpdateShapeTag()}const{clipRange:p=h.clipRange,clipRangeByDimension:f=h.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===p){let s=!1;t.cache.forEach(((g,m)=>{s||(s=this.drawSegmentItem(e,g,!!l,!!c,u,d,r[m],[h,t.attribute],p,f,i,n,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),g=p*s;let m=0,y=!1;t.cache.forEach(((s,p)=>{if(y)return;const v=s.getLength(),b=(g-m)/v;m+=v,b>0&&(y=this.drawSegmentItem(e,s,!!l,!!c,u,d,r[p],[h,t.attribute],je(b,1),f,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,u,d,t.attribute,h,p,f,i,n,t,o,a)}},t.DefaultCanvasLineRender=X([U()],t.DefaultCanvasLineRender),t.DefaultCanvasAreaRender=class extends t.BaseRender{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=La,this.init(t)}drawShape(t,e,i,n,r,s,o,a){var h,l,c,u,d,p;const f=ps(t,null==s?void 0:s.theme).area,{fillOpacity:g=f.fillOpacity,z:m=f.z,strokeOpacity:y=f.strokeOpacity}=t.attribute,v=this.valid(t,f,o,a);if(!v)return;const{doFill:b,doStroke:x}=v,{clipRange:A=f.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:i,closePath:n}=t.attribute;let{curveType:r=f.curveType}=t.attribute;if(n&&"linear"===r&&(r="linearClosed"),i&&i.length){let e,n;const s=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}),null;1===i?e={x:n.endX,y:n.endY}:i>1&&(e.x=n.endX,e.y=n.endY);const s=bu(t.points,r,{startPoint:e});return n=s,s})).filter((t=>!!t));let o;const a=[];for(let t=i.length-1;t>=0;t--){const e=i[t].points,n=[];for(let t=e.length-1;t>=0;t--)n.push({x:null!==(h=e[t].x1)&&void 0!==h?h:e[t].x,y:null!==(l=e[t].y1)&&void 0!==l?l:e[t].y});if(0!==t){const e=i[t-1].points,r=e[e.length-1];r&&n.push({x:null!==(c=r.x1)&&void 0!==c?c:r.x,y:null!==(u=r.y1)&&void 0!==u?u:r.y})}o=bu(n,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r),a.unshift(o)}t.cacheArea=a.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const i=e,n=[];for(let t=e.length-1;t>=0;t--)n.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const s=bu(i,r),o=bu(n,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r);t.cacheArea={top:s,bottom:o}}}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===A){let h=!1;t.cacheArea.forEach(((l,c)=>{h||(h=this.drawSegmentItem(e,l,b,g,x,y,s[c],[f,t.attribute],A,i,n,m,t,r,o,a))}))}else{const h=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=A*h;let c=0,u=!1;t.cacheArea.forEach(((h,d)=>{if(u)return;const p=h.top.getLength(),v=(l-c)/p;c+=p,v>0&&(u=this.drawSegmentItem(e,h,b,g,x,y,s[d],[f,t.attribute],je(v,1),i,n,m,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,b,g,x,y,t.attribute,f,A,i,n,m,t,r,o,a)}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,g){let m=!1;return m=m||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!1,f,g),m=m||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!0,f,g),m}_drawSegmentItem(e,i,n,r,s,o,a,h,l,c,u,d,p,f,g,m,y){var v,b,x,A;let{connectedType:T,connectedX:B,connectedY:w,connectedStyle:S}=a;const _=[];if(g&&(ve(h)?(T=null!==(v=null!=T?T:h[0].connectedType)&&void 0!==v?v:h[1].connectedType,B=null!==(b=null!=B?B:h[0].connectedX)&&void 0!==b?b:h[1].connectedX,w=null!==(x=null!=w?w:h[0].connectedY)&&void 0!==x?x:h[1].connectedY,S=null!==(A=null!=S?S:h[0].connectedStyle)&&void 0!==A?A:h[1].connectedStyle):(T=null!=T?T:h.connectedType,B=null!=B?B:h.connectedX,w=null!=w?w:h.connectedY,S=null!=S?S:h.connectedStyle),"connect"!==T&&"zero"!==T&&(T="none"),ve(h)?h.forEach((t=>_.push(t))):_.push(h),_.push(a)),g&&"none"===T)return!1;if(!i)return;e.beginPath();const{points:C,segments:P}=p.attribute;let E,M,k=t.Direction.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],E=t.points[t.points.length-1]}else M=C[0],E=C[C.length-1];k=Ue(E.x-M.x)>Ue(E.y-M.y)?t.Direction.ROW:t.Direction.COLUMN,gu(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:u,offsetZ:d,direction:k,drawConnect:g,mode:T,zeroX:B,zeroY:w}),this.beforeRenderStep(p,e,c,u,!!r,!1,n,!1,h,f,m,null,{attribute:a}),e.setShadowStyle&&e.setShadowStyle(p,a,h);const{x:R=0,x:O=0}=a;if(!1!==n&&(m?m(e,a,h):r&&(e.setCommonStyle(p,g?S:a,R-c,O-u,g?_:h),e.fill())),this.afterRenderStep(p,e,c,u,!!r,!1,n,!1,h,f,m,null,{attribute:a}),!1!==s)if(y)y(e,a,h);else{const{stroke:n=h&&h[1]&&h[1].stroke}=a;ve(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),uu(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,k===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d,drawConnect:g,mode:T,zeroX:B,zeroY:w})),e.setStrokeStyle(p,g?S:a,R-c,O-u,g?_:h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=X([U(),q(0,I(Jt)),q(0,N(Ch)),K("design:paramtypes",[Object])],t.DefaultCanvasAreaRender),t.DefaultCanvasPathRender=class extends t.BaseRender{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=za,this.init(t)}drawShape(t,e,i,n,r,s,o,a){var h,l;const c=ps(t,null==s?void 0:s.theme).path,{x:u=c.x,y:d=c.y}=t.attribute,p=null!==(h=this.z)&&void 0!==h?h:0,f=this.valid(t,c,o,a);if(!f)return;const{fVisible:g,sVisible:m,doFill:y,doStroke:v}=f;if(e.beginPath(),t.pathShape)en(t.pathShape.commandList,e,i,n,1,1,p);else{en((null!==(l=t.attribute.path)&&void 0!==l?l:c.path).commandList,e,i,n,1,1,p)}this.beforeRenderStep(t,e,i,n,y,v,g,m,c,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,c),v&&(a?a(e,t.attribute,c):m&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,c),e.stroke())),y&&(o?o(e,t.attribute,c):g&&(e.setCommonStyle(t,t.attribute,u-i,d-n,c),e.fill())),this.afterRenderStep(t,e,i,n,y,v,g,m,c,r,o,a)}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).path;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPathRender=X([U(),q(0,I(Jt)),q(0,N(kh)),K("design:paramtypes",[Object])],t.DefaultCanvasPathRender);const xu=Oe/2;function Au(t,e,i,n,r,s){let o;if(xe(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:o=[0,0,0,0];break;case 1:o=[t[0],t[0],t[0],t[0]];break;case 2:case 3:o=[t[0],t[1],t[0],t[1]];break;default:o=t.slice(0,5)}}else o=[0,0,0,0];if(n<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,i,n,r);const[a,h,l,c]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],u=Math.min(n/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],p=[a[0]+d[0],a[1]],f=[a[0],a[1]+d[0]],g=[h[0]-d[1],h[1]],m=[h[0],h[1]+d[1]],y=[l[0]-d[2],l[1]],v=[l[0],l[1]-d[2]],b=[c[0]+d[3],c[1]],x=[c[0],c[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!Ce(g,m)){const e=g[0],i=g[1]+d[1];t.arc(e,i,d[1],-xu,0,!1)}if(t.lineTo(v[0],v[1]),!Ce(y,v)){const e=v[0]-d[2],i=v[1];t.arc(e,i,d[2],0,xu,!1)}if(t.lineTo(b[0],b[1]),!Ce(b,x)){const e=b[0],i=b[1]-d[3];t.arc(e,i,d[3],xu,Oe,!1)}if(t.lineTo(f[0],f[1]),!Ce(p,f)){const e=p[0],i=p[1]+d[0];t.arc(e,i,d[0],Oe,Oe+xu,!1)}return t.closePath(),t}function Tu(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 Bu(t,e){return Math.sqrt(t*t+e*e)}function wu(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasRectRender=class extends t.BaseRender{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Va,this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=ps(t,null==s?void 0:s.theme).rect,{fill:l=h.fill,background:c,stroke:u=h.stroke,width:d=h.width,height:p=h.height,cornerRadius:f=h.cornerRadius,opacity:g=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:b=h.visible,x:x=h.x,y:A=h.y}=t.attribute,T=gh(g,m,d,p,l),B=yh(g,v,d,p),w=dh(l,c),S=ph(u,y);if(!t.valid||!b)return;if(!w&&!S)return;if(!(T||B||o||a||c))return;0===f||ve(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(i,n,d,p)):(e.beginPath(),Au(e,i,n,d,p,f));const _={doFill:w,doStroke:S};this.beforeRenderStep(t,e,i,n,w,S,T,B,h,r,o,a,_),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),_.doFill&&(o?o(e,t.attribute,h):T&&(e.setCommonStyle(t,t.attribute,x-i,A-n,h),e.fill())),_.doStroke&&(a?a(e,t.attribute,h):B&&(e.setStrokeStyle(t,t.attribute,x-i,A-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,w,S,T,B,h,r,o,a)}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).rect;this._draw(t,r,!1,i,n)}},t.DefaultCanvasRectRender=X([U(),q(0,I(Jt)),q(0,N(Oh)),K("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends t.BaseRender{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=qa,this.init(t)}drawShape(t,e,i,n,r,s,o,a){var h;const l=ps(t,null==s?void 0:s.theme).symbol,{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY}=t.attribute,g=this.valid(t,l,o,a);if(!g)return;const{fVisible:m,sVisible:y,doFill:v,doStroke:b}=g,x=t.getParsedPath();if(!x)return;const{keepDirIn3d:A=l.keepDirIn3d}=t.attribute,T=null!==(h=this.z)&&void 0!==h?h:0;if(e.beginPath(),A&&e.camera&&e.project){const r=e.project(i,n,T),s=e.camera;e.camera=null,!1===x.draw(e,c,r.x,r.y,void 0,((r,s)=>{s.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,s,u-i,d-n),e.fill())),s.stroke&&(a?a(e,t.attribute,l):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f),e.stroke()))}))&&e.closePath(),e.camera=s}else!1===x.draw(e,c,i,n,T,((r,s)=>{s.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,s,u-i,d-n),e.fill())),s.stroke&&(a?a(e,t.attribute,l):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f),e.stroke()))}))&&e.closePath();this.beforeRenderStep(t,e,i,n,v,b,m,y,l,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),v&&!x.isSvg&&(o?o(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill())),b&&!x.isSvg&&(a?a(e,t.attribute,l):y&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(d-n)/f,l),e.stroke())),this.afterRenderStep(t,e,i,n,v,b,m,y,l,r,o,a)}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}},t.DefaultCanvasSymbolRender=X([U(),q(0,I(Jt)),q(0,N(Dh)),K("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender),t.DefaultCanvasTextRender=class extends t.BaseRender{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Ka,this.init(t)}drawShape(t,e,i,n,r,s,o,a){var h;const l=ps(t,null==s?void 0:s.theme).text,{text:c,fill:u=l.fill,stroke:d=l.stroke,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,opacity:g=l.opacity,lineWidth:m=l.lineWidth,visible:y=l.visible,underline:v=l.underline,lineThrough:b=l.lineThrough,keepDirIn3d:x=l.keepDirIn3d,direction:A=l.direction,fontSize:T=l.fontSize,textBaseline:B=l.textBaseline,textAlign:w=l.textAlign,x:S=l.x,y:_=l.y}=t.attribute,C=null!==(h=t.attribute.lineHeight)&&void 0!==h?h:T,P=this.valid(t,l,o,a);if(!P)return;const{fVisible:E,sVisible:M,doFill:k,doStroke:R}=P,O=!x,D=this.z||0;e.beginPath(),this.beforeRenderStep(t,e,i,n,k,R,E,M,l,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),O&&this.transformUseContext2d(t,l,D,e);const I=(r,s,h,c)=>{let u=i+s;const d=n+h;if(c){e.highPerformanceSave(),u+=T;const t=Uc.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),e.transformFromMatrix(t,!0),Uc.free(t)}R&&(a?a(e,t.attribute,l):M&&(e.setStrokeStyle(t,t.attribute,S-i,_-n,l),e.strokeText(r,u,d,D))),k&&(o?o(e,t.attribute,l):E&&(e.setCommonStyle(t,t.attribute,S-i,_-n,l),e.fillText(r,u,d,D),this.drawUnderLine(v,b,t,u,d,D,l,e))),c&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(Array.isArray(c))if(e.setTextStyleWithoutAlignBaseline(t.attribute,l,D),"horizontal"===A){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:h}=r.bbox;R&&(a?a(e,t.attribute,l):M&&(e.setStrokeStyle(t,t.attribute,S-i,_-n,l),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+i,(t.topOffset||0)+h+n,D)})))),k&&(o?o(e,t.attribute,l):E&&(e.setCommonStyle(t,t.attribute,S-i,_-n,l),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+i,(r.topOffset||0)+h+n,D),this.drawMultiUnderLine(v,b,t,(r.leftOffset||0)+i,(r.topOffset||0)+h+n,D,r.width,l,e)}))))}else{const i=t.cache,{verticalList:n}=i;e.textAlign="left",e.textBaseline="top";const r=C*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=Fe(e,s)}));let o=0,a=0;"bottom"===B?a=-r:"middle"===B&&(a=-r/2),"center"===w?o-=s/2:"right"===w&&(o-=s),n.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),n=s-i;let h=o;"center"===w?h+=n/2:"right"===w&&(h+=n),t.forEach((t=>{const{text:i,width:n,direction:s}=t;I(i,r-(e+1)*C+a,h,s),h+=n}))}))}else{const i=t.cache;if("horizontal"===A){e.setTextStyle(t.attribute,l,D);const i=t.clipedText;let n=0;C!==T&&("top"===B?n=(C-T)/2:"middle"===B||"bottom"===B&&(n=-(C-T)/2)),I(i,0,n,0)}else if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,l,D);const{verticalList:n}=i;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===B?o=-C:"middle"===B&&(o=-C/2),"center"===w?r-=s/2:"right"===w&&(r-=s),e.textAlign="left",e.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;I(e,o,r,n),r+=i}))}}O&&this.restoreTransformUseContext2d(t,l,D,e),this.afterRenderStep(t,e,i,n,k,R,E,M,l,r,o,a)}draw(t,e,i,n){const r=ps(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:h=o.textAlign,textBaseline:l=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,f=i.clipedWidth,g=Fh(h,f),m=jh(l,c,c),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){y.lineWidth=t,a.setStrokeStyle(i,y,n,r,o),a.beginPath();const e=r+m+c;a.moveTo(n+g,e,s),a.lineTo(n+g+f,e,s),a.stroke()}if(e){y.lineWidth=e,a.setStrokeStyle(i,y,n,r,o),a.beginPath();const t=r+m+c/2;a.moveTo(n+g,t,s),a.lineTo(n+g+f,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,h){if(e+t<=0)return;const{textAlign:l=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,f=Fh(l,o),g=jh("alphabetic",c,c),m={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let y=-3;if(t){m.lineWidth=t,h.setStrokeStyle(i,m,n,r,a),h.beginPath();const e=r+g+c+y;h.moveTo(n+f,e,s),h.lineTo(n+f+o,e,s),h.stroke()}if(y=-1,e){m.lineWidth=e,h.setStrokeStyle(i,m,n,r,a),h.beginPath();const t=r+g+c/2+y;h.moveTo(n+f,t,s),h.lineTo(n+f+o,t,s),h.stroke()}}},t.DefaultCanvasTextRender=X([U(),q(0,I(Jt)),q(0,N(Ih)),K("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{},t.AbstractGraphicRender=X([U()],t.AbstractGraphicRender),t.DefaultCanvasPolygonRender=class extends t.BaseRender{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=Ga,this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=ps(t,null==s?void 0:s.theme).polygon,{points:l=h.points,cornerRadius:c=h.cornerRadius,x:u=h.x,y:d=h.y,closePath:p=h.closePath}=t.attribute,f=this.valid(t,h,o,a);if(!f)return;const{fVisible:g,sVisible:m,doFill:y,doStroke:v}=f;e.beginPath(),c<=0||ve(c)&&c.every((t=>0===t))?Tu(e.camera?e:e.nativeContext,l,i,n):function(t,e,i,n,r,s=!0){var o;if(e.length<3)return void Tu(t,e,i,n);let a=0,h=e.length-1;s||(a+=1,h-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=a;s<=h;s++){const a=e[0===s?h:(s-1)%e.length],l=e[s%e.length],c=e[(s+1)%e.length],u=l.x-a.x,d=l.y-a.y,p=l.x-c.x,f=l.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,m=Math.abs(Math.tan(g));let y=Array.isArray(r)?null!==(o=r[s%e.length])&&void 0!==o?o:0:r,v=y/m;const b=Bu(u,d),x=Bu(p,f),A=Math.min(b,x);v>A&&(v=A,y=A*m);const T=wu(l,v,b,u,d),B=wu(l,v,x,p,f),w=2*l.x-T.x-B.x,S=2*l.y-T.y-B.y,_=Bu(w,S),C=wu(l,Bu(v,y),_,w,S);let P=Math.atan2(T.y-C.y,T.x-C.x);const E=Math.atan2(B.y-C.y,B.x-C.x);let M=E-P;M<0&&(P=E,M=-M),M>Math.PI&&(M-=Math.PI),0===s?t.moveTo(T.x+i,T.y+n):t.lineTo(T.x+i,T.y+n),M&&t.arcTo(l.x+i,l.y+n,B.x+i,B.y+n,y),t.lineTo(B.x+i,B.y+n)}s||t.lineTo(e[h+1].x+i,e[h+1].y+n)}(e.camera?e:e.nativeContext,l,i,n,c,p),p&&e.closePath(),this.beforeRenderStep(t,e,i,n,y,v,g,m,h,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),y&&(o?o(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill())),v&&(a?a(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,y,v,g,m,h,r,o,a)}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPolygonRender=X([U(),q(0,I(Jt)),q(0,N(Rh)),K("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const Su=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class extends t.BaseRender{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Fa,this.init(t)}drawShape(t,e,i,n,r,s,o){const a=ps(t).image,{width:h=a.width,height:l=a.height,repeatX:c=a.repeatX,repeatY:u=a.repeatY,cornerRadius:d=a.cornerRadius,image:p}=t.attribute,f=this.valid(t,a,o);if(!f)return;const{fVisible:g,sVisible:m,doFill:y,doStroke:v}=f;if(this.beforeRenderStep(t,e,i,n,y,!1,g,!1,a,r,o),e.setShadowStyle&&e.setShadowStyle(t,a),y)if(o)o(e,t.attribute,a);else if(g){if(!p||!t.resources)return;const r=t.resources.get(p);if("success"!==r.state)return;let s=!1;0===d||ve(d)&&d.every((t=>0===t))||(e.beginPath(),Au(e,i,n,h,l,d),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,i,n,a);let o=0;if("repeat"===c&&(o|=1),"repeat"===u&&(o|=2),o){const t=e.createPattern(r.data,Su[o]);e.fillStyle=t,e.fillRect(i,n,h,l)}else e.drawImage(r.data,i,n,h,l);s&&e.restore()}this.afterRenderStep(t,e,i,n,y,!1,g,!1,a,r,o)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;if("success"!==t.resources.get(n).state)return;const{context:r}=e.drawParams;if(!r)return;const s=ps(t).image;this._draw(t,s,!1,i)}},t.DefaultCanvasImageRender=X([U(),q(0,I(Jt)),q(0,N(Mh)),K("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const _u=Symbol.for("IncrementalDrawContribution"),Cu=Symbol.for("ArcRender"),Pu=Symbol.for("Arc3dRender"),Eu=Symbol.for("AreaRender"),Mu=Symbol.for("CircleRender"),ku=Symbol.for("GraphicRender"),Ru=Symbol.for("GroupRender"),Ou=Symbol.for("LineRender"),Du=Symbol.for("PathRender"),Iu=Symbol.for("PolygonRender"),Lu=Symbol.for("RectRender"),Uu=Symbol.for("Rect3DRender"),Nu=Symbol.for("SymbolRender"),Wu=Symbol.for("TextRender"),Fu=Symbol.for("RichTextRender"),ju=Symbol.for("Pyramid3dRender"),zu=Symbol.for("GlyphRender"),Gu=Symbol.for("ImageRender"),Hu=Symbol.for("RenderSelector"),Vu=Symbol.for("DrawContribution");function Yu(t,e,i){let n=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),l=Math.sign(a)*Math.sqrt(o*o+a*a);return h+l===0?0:(n=n/Math.abs(h+l)*2*i,n)}function Xu(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(ve(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o,a,h;const l=i.AABBBounds;if(!l)return;let c=l.x2-l.x1,u=l.y2-l.y1,d=l.x1-n,p=l.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!==(h=e.y1)&&void 0!==h?h: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,n=0,r=0){var s,o;const a=i.AABBBounds;if(!a)return;let h=a.x2-a.x1,l=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;h/=t,l/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*h,u+(null!==(o=e.y)&&void 0!==o?o:0)*l,e.startAngle,e.endAngle);let p;return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(h+c,l+u,p)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i,n=0,r=0){var s,o,a,h,l,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 m=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!==(h=e.x1)&&void 0!==h?h:.5)*d,g+(null!==(l=e.y1)&&void 0!==l?l:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{m.addColorStop(t.offset,t.color)})),m}(t,o,i,n,r)),s||"orange")}const qu=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return Pr(Object.assign({nativeCanvas:pr.global.createCanvas(t)},t));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};return Pr(Object.assign({nativeCanvas:pr.global.createCanvas(e)},e))}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(...t){this.pools=[]}};t.DefaultBaseBackgroundRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{background:p}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=ps(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,h),e.drawImage(r.data,s.x1,s.y1,s.width(),s.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},t.DefaultBaseBackgroundRenderContribution=X([U()],t.DefaultBaseBackgroundRenderContribution),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,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=X([U(),q(0,I(Jt)),q(0,N(Lh)),K("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution),t.DefaultBaseTextureRenderContribution=class{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=qu.allocate({width:t,height:t,dpr:1}),a=o.getContext("2d");if(!a)return null;a.clearRect(0,0,t,t),r(s,a);const h=n.createPattern(o.nativeCanvas,"repeat");return qu.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,Le),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,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:m=h.texturePadding}=t.attribute;if(!p)return;let y=this.textureMap.get(p);if(!y)switch(p){case"circle":y=this.createCirclePattern(g,m,f,e);break;case"diamond":y=this.createDiamondPattern(g,m,f,e);break;case"rect":y=this.createRectPattern(g,m,f,e);break;case"vertical-line":y=this.createVerticalLinePattern(g,m,f,e);break;case"horizontal-line":y=this.createHorizontalLinePattern(g,m,f,e);break;case"bias-lr":y=this.createBiasLRLinePattern(g,m,f,e);break;case"bias-rl":y=this.createBiasRLLinePattern(g,m,f,e);break;case"grid":y=this.createGridPattern(g,m,f,e)}y&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=y,e.fill(),e.highPerformanceRestore())}},t.DefaultBaseTextureRenderContribution=X([U()],t.DefaultBaseTextureRenderContribution),t.DefaultArcRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerRadius:m=h.innerRadius,outerRadius:y=h.outerRadius,startAngle:v=h.startAngle,endAngle:b=h.endAngle,opacity:x=h.opacity,x:A=h.x,y:T=h.y,scaleX:B=h.scaleX,scaleY:w=h.scaleY}=t.attribute,S=!(!d||!d.stroke),_=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=Yu(e,r,e.dpr),o=r/y;if(t.setAttributes({outerRadius:y+s,innerRadius:m-s,startAngle:v-o,endAngle:b+o}),e.beginPath(),Ah(t,e,i,n,y+s,m-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(S){const r=h.outerBorder.opacity;h.outerBorder.opacity=x,e.setStrokeStyle(t,d,(A-i)/B,(T-n)/w,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Yu(e,r,e.dpr),o=r/y;if(t.setAttributes({outerRadius:y-s,innerRadius:m+s,startAngle:v+o,endAngle:b-o}),e.beginPath(),Ah(t,e,i,n,y-s,m+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(_){const r=h.innerBorder.opacity;h.innerBorder.opacity=x,e.setStrokeStyle(t,p,(A-i)/B,(T-n)/w,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:y,innerRadius:m,startAngle:v,endAngle:b})}},t.DefaultArcRenderContribution=X([U()],t.DefaultArcRenderContribution),t.DefaultArcBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultArcBackgroundRenderContribution=X([U()],t.DefaultArcBackgroundRenderContribution),t.DefaultArcTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultArcTextureRenderContribution=X([U()],t.DefaultArcTextureRenderContribution),t.DefaultCircleRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,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:m=h.radius,startAngle:y=h.startAngle,endAngle:v=h.endAngle,opacity:b=h.opacity,x:x=h.x,y:A=h.y,scaleX:T=h.scaleX,scaleY:B=h.scaleY}=t.attribute,w=!(!d||!d.stroke),S=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=Yu(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,m+s,y,v),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(w){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/T,(A-n)/B,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Yu(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,m-s,y,v),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(S){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/T,(A-n)/B,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultCircleRenderContribution=X([U()],t.DefaultCircleRenderContribution),t.DefaultCircleBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultCircleBackgroundRenderContribution=X([U()],t.DefaultCircleBackgroundRenderContribution),t.DefaultCircleTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultCircleTextureRenderContribution=X([U()],t.DefaultCircleTextureRenderContribution),t.DefaultGroupBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{background:d}=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;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}},t.DefaultGroupBackgroundRenderContribution=X([U()],t.DefaultGroupBackgroundRenderContribution),t.DefaultImageBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{background:d,width:p,height:f}=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=ps(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;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(ge(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:h,y:l,width:c,height:u}=function(t){const e=Xs(t.attribute.boundsPadding),i=t.AABBBounds;let n=i.x1,r=i.y1,s=i.width(),o=i.height();xe(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]);return{x:n,y:r,width:s,height:o}}(t);s?Au(e,h-o,l-a,c+2*o,u+2*a,s):e.rect(h-o,l-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()}}},t.DefaultImageBackgroundRenderContribution=X([U()],t.DefaultImageBackgroundRenderContribution),t.DefaultRectRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{width:m=h.width,height:y=h.height,cornerRadius:v=h.cornerRadius,opacity:b=h.opacity,x:x=h.x,y:A=h.y,scaleX:T=h.scaleX,scaleY:B=h.scaleY}=t.attribute,w=!(!d||!d.stroke),S=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=Yu(e,r,e.dpr),o=i-s,a=n-s,l=2*s;if(0===v||ve(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,m+l,y+l)):(e.beginPath(),Au(e,o,a,m+l,y+l,v)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(w){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/T,(A-n)/B,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Yu(e,r,e.dpr),o=i+s,a=n+s,l=2*s;if(0===v||ve(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,m-l,y-l)):(e.beginPath(),Au(e,o,a,m-l,y-l,v)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(S){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/T,(A-n)/B,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultRectRenderContribution=X([U()],t.DefaultRectRenderContribution),t.DefaultRectBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultRectBackgroundRenderContribution=X([U()],t.DefaultRectBackgroundRenderContribution),t.DefaultRectTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultRectTextureRenderContribution=X([U()],t.DefaultRectTextureRenderContribution),t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=X([U()],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,h,l,c,u){const{width:d=h.width,height:p=h.height,stroke:f=h.stroke}=t.attribute;if(Array.isArray(f)&&f.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),e.beginPath(),e.moveTo(i,n),f[0]?e.lineTo(i+d,n):e.moveTo(i+d,n),f[1]?e.lineTo(i+d,n+p):e.moveTo(i+d,n+p),f[2]?e.lineTo(i,n+p):e.moveTo(i,n+p),f[3]){const t=f[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=X([U()],t.SplitRectAfterRenderContribution),t.DefaultSymbolRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,m=f&&!1!==f.visible;if(!g&&!m)return;const{size:y=h.size,opacity:v=h.opacity,x:b=h.x,y:x=h.y,scaleX:A=h.scaleX,scaleY:T=h.scaleY}=t.attribute,B=!(!p||!p.stroke),w=!(!f||!f.stroke);if(g){const{distance:r=h.outerBorder.distance}=p,s=Yu(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,y,i,n,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.outerBorder);else if(B){const r=h.outerBorder.opacity;h.outerBorder.opacity=v,e.setStrokeStyle(t,p,(b-i)/A,(x-n)/T,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=f,s=Yu(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,y,i,n,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,f,h.innerBorder);else if(w){const r=h.innerBorder.opacity;h.innerBorder.opacity=v,e.setStrokeStyle(t,f,(b-i)/A,(x-n)/T,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultSymbolRenderContribution=X([U()],t.DefaultSymbolRenderContribution);class Ku extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}}class $u extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}}const Zu=Symbol.for("RenderService"),Ju=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(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)}},t.DefaultRenderService=X([U(),q(0,I(Vu)),K("design:paramtypes",[Object])],t.DefaultRenderService);var Qu=new n((e=>{e(t.DefaultRenderService).toSelf(),e(Zu).toService(t.DefaultRenderService)}));const td=Symbol.for("GraphicPicker"),ed=Symbol.for("PickerService"),id=Symbol.for("BoundsPicker"),nd=Symbol.for("GlobalPickerService");t.DefaultGlobalPickerService=class{constructor(t){this.global=t,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 ii(1,0,0,1,0,0);let s;for(let o=0;o<t.length&&(t[o].isContainer?n=this.pickGroup(t[o],e,r,i):n.graphic=this.pickItem(t[o],e,r,i),!n.graphic);o++)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 Ke(e.x,e.y);i.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const h=!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 Ke(e.x,e.y);i.transformPoint(s,s),r.graphic=this.pickItem(t,s,i,n)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}},t.DefaultGlobalPickerService=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],t.DefaultGlobalPickerService);const rd=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)}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this._pickItem(t,e,i,n,r)}_pickItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{parentMatrix:s}=r||{};if(!s)return!1;const o=e.pickContext;o.highPerformanceSave();const a=t.shadowRoot,h=Uc.allocateByObj(s),l=new Ke(i.x,i.y);s.transformPoint(l,l);const c=t.transMatrix;h.multiply(c.a,c.b,c.c,c.d,c.e,c.f);const u=e.pickGroup(a,l.clone(),h,n);return o.highPerformanceRestore(),u}},t.ShadowRootPickItemInterceptorContribution=X([U()],t.ShadowRootPickItemInterceptorContribution),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,h=!1;if(t.forEachChildren((t=>(a=t.numberType===Ia,!a))),t.forEachChildren((t=>(h=!!t.findFace,!h))),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+=Le;for(;a<0;)a+=Le;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(h){const a=t.getChildren(),h=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})));h.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),h.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),h.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,o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}},t.Canvas3DPickItemInterceptor=X([U()],t.Canvas3DPickItemInterceptor);var sd=new n((e=>{e(ed).toService(nd),e(t.DefaultGlobalPickerService).toSelf().inSingletonScope(),e(nd).toService(t.DefaultGlobalPickerService),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(rd).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(rd).toService(t.ShadowRootPickItemInterceptorContribution),te(e,rd)})),od=new n((e=>{e(t.DefaultGraphicService).toSelf().inSingletonScope(),e($a).toService(t.DefaultGraphicService),e(Bc).toSelf().inSingletonScope(),e(Tc).toService(Bc),te(e,Tc),e(Sc).toSelf().inSingletonScope(),e(wc).toService(Sc),te(e,wc),e(Cc).toSelf().inSingletonScope(),e(_c).toService(Cc),te(e,_c),e(Ec).toSelf().inSingletonScope(),e(Pc).toService(Ec),te(e,Pc),e(kc).toSelf().inSingletonScope(),e(Mc).toService(kc),te(e,Mc),e(Za).toConstantValue(hu)}));const ad=Symbol.for("AutoEnablePlugins"),hd=Symbol.for("PluginService");let ld=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&&Sr.isBound(ad)&&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))}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};ld=X([U(),q(0,I(Jt)),q(0,N(ad)),K("design:paramtypes",[Object])],ld);var cd=new n((t=>{t(ld).toSelf(),t(hd).toService(ld),ee(t,ad)})),ud=new n((t=>{te(t,re)})),dd=new n((e=>{e(t.DefaultTextMeasureContribution).toSelf().inSingletonScope(),e(wr).toService(t.DefaultTextMeasureContribution),te(e,wr)}));let pd=class{constructor(t){this.global=t,this.offscreen=!1}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,t=i.canvasId?this.global.getElementById(i.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Pr({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,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()}};pd=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],pd);let fd=class{constructor(t){this.global=t,this.offscreen=!0}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const n=Pr({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},e),{x:0,y:0,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,{x:s=0,y:o=0,width:a=this.layer.viewWidth,height:h=this.layer.viewHeight}=i;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,o,a,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,h),n.nativeContext.restore()}merge(t){}};fd=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],fd);var gd=new n((t=>{t(pd).toSelf(),t(fd).toSelf(),t(rh).toService(pd)}));function md(t,e,i,n=!1,r=!1){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],h=s[e];r&&h.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<h.length;t++)if(i(h[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}function yd(t,e,i,n=!1){return $(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function vd(t,e,i,n=!1){const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return o=!0,!0;return!1}),n);let a=null,h=!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(h){o=!0,a=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(a=t,!0):(t._uid===e&&(h=!0),!1)),n);return a}const bd=Symbol.for("DrawItemInterceptor"),xd=new Qe;let Ad=class{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.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){xd.copy(n.dirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e)}return n.renderGroup(t.shadowRoot,i),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(xd),!0}};Ad=X([U()],Ad);let Td=class{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 h=Nc.allocate();zc(h,a);const l=s.modelMatrix;if(l){if(h){const t=Nc.allocate();s.modelMatrix=Gc(t,l,h)}}else s.modelMatrix=h;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===Ia,!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+=Le;for(;a<0;)a+=Le;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",n.renderGroup(t,i),i.hack_pieFace="inside",n.renderGroup(t,i),i.hack_pieFace="top",n.renderGroup(t,i),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,!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)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==l&&Nc.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};Td=X([U()],Td);let Bd=class{constructor(t,e,i,n){this.contributions=t,this.renderSelector=e,this.layerService=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Je,this.backupDirtyBounds=new Je}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))}draw(t,e){e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,x:r=0,y:s=0,width:o,height:a}=e;if(!i)return;const h=this.dirtyBounds.setValue(0,0,o,a);if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(l=h,c=n.dirtyBounds,u=!1,null===l?c:null===c?l:(fi=l.x1,gi=l.x2,mi=l.y1,yi=l.y2,vi=c.x1,bi=c.x2,xi=c.y1,Ai=c.y2,u&&(fi>gi&&(fi=(d=[gi,fi])[0],gi=d[1]),mi>yi&&(mi=(p=[yi,mi])[0],yi=p[1]),vi>bi&&(vi=(f=[bi,vi])[0],bi=f[1]),xi>Ai&&(xi=(g=[Ai,xi])[0],Ai=g[1])),fi>=bi||gi<=vi||mi>=Ai||yi<=xi?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(fi,vi),y1:Math.max(mi,xi),x2:Math.min(gi,bi),y2:Math.min(yi,Ai)}));h.x1=Math.floor(t.x1),h.y1=Math.floor(t.y1),h.x2=Math.ceil(t.x2),h.y2=Math.ceil(t.y2)}var l,c,u,d,p,f,g;this.backupDirtyBounds.copy(h),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);const m=h.width()*i.dpr!==i.canvas.width||h.height()*i.dpr!==i.canvas.height;i.save(),i.translate(r,s,!0),m&&(i.beginPath(),i.rect(h.x1,h.y1,h.width(),h.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:$n.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:$n.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),i.restore(),i.restore(),i.draw(),i.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=vd(e,i,$n.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i){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(!_i(t.AABBBounds,this.dirtyBounds,!1))return;const n=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{var n;i?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):md(t,$n.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(n=e.context)||void 0===n?void 0:n.camera))}}),this.dirtyBounds.copy(n)}_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||Sr.get(_u);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 h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._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:h._uid,break:!1}))}}getRenderContribution(t){let e=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),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;if(!t.isContainer&&!_i(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=r),r?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),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 console.warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){const{clear:n}=i;if(n){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=i,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=Xu(e,n,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}afterDraw(t,e){}};X([I(se),K("design:type",Object)],Bd.prototype,"global",void 0),X([Kt(),K("design:type",Function),K("design:paramtypes",[]),K("design:returntype",void 0)],Bd.prototype,"init",null),Bd=X([U(),q(0,L(ku)),q(1,I(Hu)),q(2,I(ch)),q(3,I(Jt)),q(3,N(bd)),K("design:paramtypes",[Array,Object,Object,Object])],Bd);let wd=class{selector(t){return null}};wd=X([U()],wd);let Sd=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Wa}drawShape(e,i,n,r,s,o,a,h){const l=ps(e,null==o?void 0:o.theme).group,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:m=l.clip,fillOpacity:y=l.fillOpacity,strokeOpacity:v=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:A=l.lineWidth,visible:T=l.visible}=e.attribute,B=gh(p,y,f,g,c),w=yh(p,v,f,g),S=dh(c,u),_=ph(d,A);if(!e.valid||!T)return;if(!m){if(!S&&!_)return;if(!(B||w||a||h||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||ve(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),Au(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const C={doFill:S,doStroke:_};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,S,_,B,w,l,s,a,h,C)})),m&&i.clip(),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),C.doFill&&(a?a(i,e.attribute,l):B&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fill())),C.doStroke&&(h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())),this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,S,_,B,w,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=ps(t,null==n?void 0:n.theme).group,a=r.modelMatrix;if(r.camera){const e=Nc.allocate(),i=Nc.allocate();Hc(i,t,o),Gc(e,a||e,i),r.modelMatrix=e,Nc.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:h=o.scrollX,scrollY:l=o.scrollY}=t.attribute;let c;(h||l)&&r.translate(h,l),n&&n.drawingCb&&(c=n.drawingCb()),r.modelMatrix!==a&&Nc.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};Sd=X([U(),q(0,I(Jt)),q(0,N(Eh)),K("design:paramtypes",[Object])],Sd);let _d=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=ja}drawShape(t,e,i,n,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=ps(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:m=l.visible}=t.attribute,y=fh(d,p,c),v=mh(d,f),b=dh(c),x=ph(u,g);if(!t.valid||!m)return;if(!b&&!x)return;if(!(y||v||o||a))return;const{context:A}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,A,h[r-1],h[r],t.attribute.segments[r],[l,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(),du(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};_d=X([U()],_d);let Cd=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=La}drawShape(t,e,i,n,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const l=ps(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,f=fh(d,u,c),g=dh(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,h[r-1],h[r],t.attribute.segments[r],[l,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.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};var Pd;Cd=X([U()],Cd),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Pd||(Pd={}));let Ed=class extends Bd{constructor(t,e,i,n,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=i,this.areaRender=n,this.layerService=r,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=Pd.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new ne([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return $(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,x:r=0,y:s=0}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r,s,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:$n.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:$n.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 $(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return $(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>$(this,void 0,void 0,(function*(){if(2!==t.count)yield yd(t,$n.zIndex,((i,n)=>{if(this.status===Pd.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 $(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return $(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return $(this,void 0,void 0,(function*(){this.rendering&&(this.status=Pd.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Pd.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 $(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:()=>$(this,void 0,void 0,(function*(){yield yd(t,$n.zIndex,(t=>$(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};X([I(se),K("design:type",Object)],Ed.prototype,"global",void 0),Ed=X([U(),q(0,L(ku)),q(1,I(Hu)),q(2,I(_d)),q(3,I(Cd)),q(4,I(ch)),q(5,I(Jt)),q(5,N(bd)),K("design:paramtypes",[Array,Object,Object,Object,Object,Object])],Ed);let Md=class extends t.BaseRender{constructor(){super(...arguments),this.type="rect3d",this.numberType=Ya}drawShape(t,e,i,n,r,s,o,a){var h;const l=ps(t,null==s?void 0:s.theme).rect3d,{fill:c=l.fill,stroke:u=l.stroke,width:d=l.width,height:p=l.height,opacity:f=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:y=l.strokeOpacity,visible:v=l.visible}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=gh(f,g,d,p,c),A=yh(f,y,d,p),T=dh(c),B=ph(u,m);if(!t.valid||!v)return;if(!T&&!B)return;if(!(x||A||o||a))return;const{light:w,camera:S}=r.stage||{},_=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,_,r,e,w,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,_,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]},h=s[n[1]],l={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,o,a,h){const l=Io.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]],m={x:e+d[0],y:i+d[1],z:n+d[2]},y={x:e+p[0],y:i+p[1],z:n+p[2]},v={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(m.x,m.y,m.z),o.lineTo(y.x,y.y,y.z),o.lineTo(v.x,v.y,v.z),o.lineTo(b.x,b.y,b.z),o.closePath(),h?h(o,null,null):(o.fillStyle=a?a.computeColor(u,l):s,o.fill())}))}draw(t,e,i){const n=ps(t).rect;this._draw(t,n,!1,i)}};Md=X([U()],Md);let kd=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=Xa}drawShape(t,e,i,n,r){const s=ps(t).richtext,{width:o=s.width,height:a=s.height,opacity:h=s.opacity,fillOpacity:l=s.fillOpacity,visible:c=s.visible}=t.attribute;if(!t.valid||!c)return;if(!fh(h,l,!0))return;e.translate(i,n);t.getFrameCache().draw(e,this.drawIcon)}drawIcon(t,e,i,n,r){var s;const o=ps(t).richtextIcon,{width:a=o.width,height:h=o.height,opacity:l=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:m}=t.attribute,{backgroundWidth:y=a,backgroundHeight:v=h}=t.attribute;if(m&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-a)/2,r=(v-h)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,y,v)):(e.beginPath(),Au(e,i-t,n-r,y,v,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=l,e.drawImage(b.data,i,n,a,h))}draw(t,e,i){const n=ps(t).richtext;this._draw(t,n,!1,i)}};kd=X([U()],kd);let Rd=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=Na}drawShape(t,e,i,n,r,s,o,a){const h=ps(t),l=t.getSubGraphic();l.length&&l.forEach((t=>{r.drawContribution.renderItem(t,r,{theme:h})}))}draw(t,e,i,n){const r=ps(t).glyph;this._draw(t,r,!1,i,n)}};Rd=X([U()],Rd);let Od=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=Ia}drawShape(e,i,n,r,s,o,a,h){var l;const c=ps(e,null==o?void 0:o.theme).arc,{fill:u=c.fill}=e.attribute,d=this.valid(e,c,a,h);if(!d)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:m}=d,y=null!==(l=this.z)&&void 0!==l?l:0,{outerRadius:v=c.outerRadius,innerRadius:b=c.innerRadius,height:x=10}=e.attribute,A=Io.Get(u,t.ColorType.Color255),{light:T}=s.stage||{},B=s.hack_pieFace,w={top:y,bottom:y+x},S={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===B||"top"===B?(i.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=Ue(h-a),c=h>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=Re)e.moveTo(i,n,r);else if(l>=Le-Re)e.moveTo(i+s*We(a),n+s*ze(a),r),e.arc(i,n,s,a,h,!c,r),o>Re&&(e.moveTo(i+o*We(h),n+o*ze(h),r),e.arc(i,n,o,h,a,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:m}=t.getParsePadAngle(a,h),y=s*We(p),v=s*ze(p),b=o*We(g),x=o*ze(g);l<.001?u=!0:(e.moveTo(i+y,n+v,r),e.arc(i,n,s,p,f,!c,r)),!(o>Re)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,m,c,r))}e.closePath()}(e,i,n,r,w[B],v,b),i.setShadowStyle&&i.setShadowStyle(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(S[B],A):u,i.fill())),m&&(h?h(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke()))):"outside"!==B&&"inside"!==B||("inside"===B&&(i.save(),i.beginPath(),i.arc(n,r,b,0,Le,!0,w.top),i.clip()),i.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=Ue(l-h),u=l>h;let d=!1;if(o<=Re)e.moveTo(i,n,r);else if(c>=Le-Re)e.moveTo(i+o*We(h),n+o*ze(h),r),e.arc(i,n,o,h,l,!u,r),e.lineTo(i+o*We(l),n+o*ze(l),s),e.arc(i,n,o,l,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(h,l),f=o*We(c),g=o*ze(c),m=o*We(p),y=o*ze(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!u,r),e.lineTo(i+m,n+y,s),e.arc(i,n,o,p,c,u,s))}e.closePath()}(e,i,n,r,w.top,w.bottom,"outside"===B?v:b,((t,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:h}=e.getParsePadAngle(t,i);return"outside"===B?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:h}})),i.setShadowStyle&&i.setShadowStyle(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(S[B],A):u,i.fill())),m&&(h?h(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())),"inside"===B&&i.restore())}draw(t,e,i,n){const r=ps(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}};Od=X([U()],Od);let Dd=class extends t.BaseRender{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Ha}drawShape(t,e,i,n,r,s,o,a){var h;const l=ps(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(h=this.z)&&void 0!==h?h:0;if(!this.valid(t,l,o,a))return;const{light:f,camera:g}=r.stage||{},m=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,p,m,d,r,e,f,g,t,l,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,p,m,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a=s[n[1]],h={x:t+o[0],y:e+o[1],z:i+o[2]},l={x:t+a[0],y:e+a[1],z:i+a[2]};r.beginPath(),r.moveTo(h.x,h.y,h.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,o,a,h,l,c,u,d){const p=Io.Get(o,t.ColorType.Color255),f=r.vertices,g=f.map((t=>a.view(t[0],t[1],t[2])[2])),m=[];r.polygons.forEach(((t,e)=>{if(!s[e])return;m.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=g[i[0]],o=g[i[1]],a=g[i[2]],h=g[i[3]];t.ave_z=r+o+a+h})),m.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),m.forEach((t=>{const{polygon:r,normal:s}=t.polygon,l=f[r[0]],g=f[r[1]],m=f[r[2]],y=f[r[3]],v={x:e+l[0],y:i+l[1],z:n+l[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]},x={x:e+m[0],y:i+m[1],z:n+m[2]},A={x:e+y[0],y:i+y[1],z:n+y[2]};a.beginPath(),a.moveTo(v.x,v.y,v.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.lineTo(A.x,A.y,A.z),a.closePath(),d?d(a,c.attribute,u):(a.fillStyle=h?h.computeColor(s,p):o,a.fill())}))}draw(t,e,i){const n=ps(t).polygon;this._draw(t,n,!1,i)}};Dd=X([U()],Dd);let Id=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};Id=X([U()],Id);let Ld=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};Ld=X([U()],Ld);let Ud=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};Ud=X([U()],Ud);let Nd=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};Nd=X([U()],Nd);let Wd=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};Wd=X([U()],Wd);let Fd=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){var p,f,g,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:y=t.attribute}=d||{},{texture:v=(null!==(p=t.attribute.texture)&&void 0!==p?p:io(h,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:io(h,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:io(h,"textureSize")),texturePadding:A=(null!==(m=t.attribute.texturePadding)&&void 0!==m?m:io(h,"texturePadding"))}=y;if(!v)return;let T=this.textureMap.get(v);if(!T)switch(v){case"circle":T=this.createCirclePattern(x,A,b,e);break;case"diamond":T=this.createDiamondPattern(x,A,b,e);break;case"rect":T=this.createRectPattern(x,A,b,e);break;case"vertical-line":T=this.createVerticalLinePattern(x,A,b,e);break;case"horizontal-line":T=this.createHorizontalLinePattern(x,A,b,e);break;case"bias-lr":T=this.createBiasLRLinePattern(x,A,b,e);break;case"bias-rl":T=this.createBiasRLLinePattern(x,A,b,e);break;case"grid":T=this.createGridPattern(x,A,b,e)}T&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=T,e.fill(),e.highPerformanceRestore())}};Fd=X([U()],Fd);var jd=new n((e=>{e(Bd).toSelf(),e(Vu).toService(Bd),e(Ed).toSelf(),e(_u).toService(Ed),e(wd).toSelf(),e(Hu).toService(wd),e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(Mu).to(t.DefaultCanvasCircleRender),e(ku).to(t.DefaultCanvasCircleRender),e(t.DefaultCircleRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleTextureRenderContribution).toSelf().inSingletonScope(),e(Ph).toService(t.DefaultCircleRenderContribution),e(Ph).toService(t.DefaultCircleBackgroundRenderContribution),e(Ph).toService(t.DefaultCircleTextureRenderContribution),te(e,Ph),e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(Lu).to(t.DefaultCanvasRectRender),e(ku).to(t.DefaultCanvasRectRender),e(Md).toSelf().inSingletonScope(),e(Uu).toService(Md),e(ku).toService(Uu),e(t.DefaultRectRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectTextureRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectBeforeRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectAfterRenderContribution).toSelf().inSingletonScope(),e(Oh).toService(t.DefaultRectRenderContribution),e(Oh).toService(t.DefaultRectBackgroundRenderContribution),e(Oh).toService(t.DefaultRectTextureRenderContribution),e(Oh).toService(t.SplitRectBeforeRenderContribution),e(Oh).toService(t.SplitRectAfterRenderContribution),te(e,Oh),e(t.DefaultCanvasTextRender).toSelf().inSingletonScope(),e(Wu).to(t.DefaultCanvasTextRender),e(ku).to(t.DefaultCanvasTextRender),te(e,Ih),e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(Du).to(t.DefaultCanvasPathRender),e(ku).to(t.DefaultCanvasPathRender),e(Ud).toSelf().inSingletonScope(),e(Nd).toSelf().inSingletonScope(),e(kh).toService(Ud),e(kh).toService(Nd),te(e,kh),e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(Nu).to(t.DefaultCanvasSymbolRender),e(ku).to(t.DefaultCanvasSymbolRender),e(t.DefaultSymbolRenderContribution).toSelf().inSingletonScope(),e(Ku).toSelf().inSingletonScope(),e($u).toSelf().inSingletonScope(),e(Dh).toService(t.DefaultSymbolRenderContribution),e(Dh).toService(Ku),e(Dh).toService($u),te(e,Dh),e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(Cu).to(t.DefaultCanvasArcRender),e(ku).to(t.DefaultCanvasArcRender),e(Od).toSelf().inSingletonScope(),e(Pu).toService(Od),e(ku).toService(Pu),e(t.DefaultArcRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcTextureRenderContribution).toSelf().inSingletonScope(),e(_h).toService(t.DefaultArcRenderContribution),e(_h).toService(t.DefaultArcBackgroundRenderContribution),e(_h).toService(t.DefaultArcTextureRenderContribution),te(e,_h),e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Ou).to(t.DefaultCanvasLineRender),e(ku).to(t.DefaultCanvasLineRender),e(_d).toSelf().inSingletonScope(),e(Cd).toSelf().inSingletonScope(),e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(Eu).to(t.DefaultCanvasAreaRender),e(ku).to(t.DefaultCanvasAreaRender),e(Wd).toSelf().inSingletonScope(),e(Fd).toSelf().inSingletonScope(),e(Ch).toService(Wd),e(Ch).toService(Fd),te(e,Ch),e(Sd).toSelf().inSingletonScope(),e(Ru).to(Sd),e(ku).to(Sd),e(t.DefaultGroupBackgroundRenderContribution).toSelf().inSingletonScope(),e(Eh).toService(t.DefaultGroupBackgroundRenderContribution),te(e,Eh),e(t.DefaultCanvasPolygonRender).toSelf().inSingletonScope(),e(Iu).to(t.DefaultCanvasPolygonRender),e(ku).to(t.DefaultCanvasPolygonRender),e(Id).toSelf().inSingletonScope(),e(Ld).toSelf().inSingletonScope(),e(Rh).toService(Id),e(Rh).toService(Ld),te(e,Rh),e(Rd).toSelf().inSingletonScope(),e(zu).toService(Rd),e(ku).toService(zu),e(t.DefaultCanvasImageRender).toSelf().inSingletonScope(),e(Gu).toService(t.DefaultCanvasImageRender),e(ku).toService(Gu),e(t.DefaultImageBackgroundRenderContribution).toSelf().inSingletonScope(),e(Mh).toService(t.DefaultImageBackgroundRenderContribution),te(e,Mh),e(kd).toSelf().inSingletonScope(),e(Fu).toService(kd),e(ku).toService(Fu),e(Dd).toSelf().inSingletonScope(),e(ju).toService(Dd),e(ku).toService(ju),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),e(Ih).toService(t.DefaultBaseInteractiveRenderContribution),e(_h).toService(t.DefaultBaseInteractiveRenderContribution),e(kh).toService(t.DefaultBaseInteractiveRenderContribution),e(Dh).toService(t.DefaultBaseInteractiveRenderContribution),e(Oh).toService(t.DefaultBaseInteractiveRenderContribution),e(Mh).toService(t.DefaultBaseInteractiveRenderContribution),e(Ph).toService(t.DefaultBaseInteractiveRenderContribution),e(Ch).toService(t.DefaultBaseInteractiveRenderContribution),e(Rh).toService(t.DefaultBaseInteractiveRenderContribution),te(e,Lh),te(e,ku),e(Ad).toSelf().inSingletonScope(),e(bd).toService(Ad),e(Td).toSelf().inSingletonScope(),e(bd).toService(Td),te(e,bd)}));Sr.load(uh),Sr.load(od),Sr.load(Qu),Sr.load(sd),Sr.load(cd),function(t){t.load(ud),t.load(dd),t.load(gd)}(Sr),function(t){t.load(jd)}(Sr);const zd=Sr.get(se);pr.global=zd;const Gd=Sr.get(lh);pr.graphicUtil=Gd;const Hd=Sr.get(hh);pr.transformUtil=Hd;const Vd=Sr.get($a);pr.graphicService=Vd;const Yd=Sr.get(nd),Xd=Sr.get(ch);pr.layerService=Xd;class qd{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=gs.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,pr.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),pr.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){pr.graphicService.hooks.onAttributeUpdate.taps=pr.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),pr.graphicService.hooks.onSetStage.taps=pr.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class Kd{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=gs.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 $d{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=gs.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,pr.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))})),pr.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){pr.graphicService.hooks.onAddIncremental.taps=pr.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),pr.graphicService.hooks.onClearIncremental.taps=pr.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,pr.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({x:t.x,y:t.y,width:i.viewWidth,height:i.viewHeight,stage:t,layer:i,clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class Zd{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=gs.GenAutoIncrementId(),this.key=this.name+this._uid}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))}drawHTML(t){"browser"===pr.global.env&&t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:$n.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:$n.zIndex)})).forEach((t=>{this.renderGroupHTML(t)}))}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}renderGraphicHTML(t){const{html:e}=t.attribute;if(!e)return void(t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear()));const i=t.stage;if(!i)return;const{dom:n,container:r,width:s,height:o,style:a,anchorType:h="boundsLeftTop"}=e;t.bindDom||(t.bindDom=new Map);const l=t.bindDom.get(n);if(l&&(!r||r===l.container))return;let c,u;t.bindDom.forEach((({wrapGroup:t})=>{pr.global.removeDom(t)})),c="string"==typeof n?(new DOMParser).parseFromString(n,"text/xml").firstChild:n;const d=r||(!0===i.params.enableHtmlAttribute?null:i.params.enableHtmlAttribute);u=d?"string"==typeof d?pr.global.getElementById(d):d:t.stage.window.getContainer();const p=pr.global.createDom({tagName:"div",width:s,height:o,style:a,parent:u});p&&(p.appendChild(c),t.bindDom.set(n,{dom:c,container:r,wrapGroup:p})),p.style.pointerEvents="none",p.style.position||(p.style.position="absolute",u.style.position="relative");let f=0,g=0;if("position"===h){const e=t.transMatrix;f=e.e,g=e.f}else{const e=t.AABBBounds;f=e.x1,g=e.y1}const m=pr.global.getElementTopLeft(u,!1),y=i.window.getTopLeft(!1),v=f+y.left-m.left,b=g+y.top-m.top;p.style.left=`${v}px`,p.style.top=`${b}px`}}const Jd=new Qe;class Qd{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=gs.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()})),pr.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&&(Jd.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(Jd,t.parent&&t.parent.globalTransMatrix)))})),pr.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))})),pr.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){pr.graphicService.hooks.beforeUpdateAABBBounds.taps=pr.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),pr.graphicService.hooks.afterUpdateAABBBounds.taps=pr.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)),pr.graphicService.hooks.onRemove.taps=pr.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}class tp{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=gs.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new Qe}tryLayout(t){const e=t.parent;if(!e||!t.needUpdateLayout())return;const i=ps(e).group,{display:n=i.display}=e.attribute;if("flex"!==n)return;const{flexDirection:r=i.flexDirection,flexWrap:s=i.flexWrap,justifyContent:o=i.justifyContent,alignItems:a=i.alignItems,alignContent:h=i.alignContent,clip:l=i.clip}=e.attribute;let c=0,u=0,d=0;if(e.forEachChildren((t=>{const e=t.AABBBounds;"column"===r||"column-reverse"===r?(u+=e.height(),c=Math.max(c,e.width())):(c+=e.width(),u=Math.max(u,e.height())),d+=e.x1,d+=e.y1,d+=e.x2,d+=e.y2})),!isFinite(d))return;const p=e.attribute.width||c,f=e.attribute.height||u;e.attribute.width||(e.attribute.width=0),e.attribute.height||(e.attribute.height=0),this.tempBounds.copy(e._AABBBounds);const g={main:{len:p,field:"x"},cross:{len:f,field:"y"},dir:1},m=g.main,y=g.cross;"row-reverse"===r?g.dir=-1:"column"===r?(m.len=f,y.len=p,m.field="y",y.field="x"):"column-reverse"===r&&(m.len=f,y.len=p,m.field="y",y.field="x",g.dir=-1);let v=0,b=0;const x=[];e.forEachChildren((t=>{const e=t.AABBBounds,i="x"===m.field?e.width():e.height(),n="x"===y.field?e.width():e.height();x.push({mainLen:i,crossLen:n}),v+=i,b=Math.max(b,n)}));const A=[];if(v>m.len&&"wrap"===s){let t=0,e=0;x.forEach((({mainLen:i,crossLen:n},r)=>{t+i>m.len?0===t?(A.push({idx:r,mainLen:t+i,crossLen:n}),t=0,e=0):(A.push({idx:r-1,mainLen:t,crossLen:n}),t=i,e=n):(t+=i,e=Math.max(e,n))})),A.push({idx:x.length-1,mainLen:t,crossLen:e})}else A.push({idx:x.length-1,mainLen:v,crossLen:b});const T=e.getChildren();let B=0;if(A.forEach((t=>{this.layoutMain(e,T,o,m,x,B,t),B=t.idx+1})),b=A.reduce(((t,e)=>t+e.crossLen),0),1===A.length)if("flex-end"===a){const t=y.len;this.layoutCross(T,a,y,t,x,A[0],0)}else if("center"===a){const t=y.len/2;this.layoutCross(T,a,y,t,x,A[0],0)}else T.forEach((t=>{t.attribute[y.field]=ep(t,y.field)}));else if("flex-start"===h){B=0;let t=0;A.forEach(((e,i)=>{this.layoutCross(T,"flex-start",y,t,x,A[i],B),B=e.idx+1,t+=e.crossLen}))}else if("center"===h){B=0;let t=Math.max(0,(y.len-b)/2);A.forEach(((e,i)=>{this.layoutCross(T,"center",y,t+e.crossLen/2,x,A[i],B),B=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){B=0;const t=Math.max(0,(y.len-b)/A.length/2);let e=t;A.forEach(((i,n)=>{this.layoutCross(T,"flex-start",y,e,x,A[n],B),B=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){B=0;const t=Math.max(0,(y.len-b)/(2*A.length-2));let e=0;A.forEach(((i,n)=>{this.layoutCross(T,"flex-start",y,e,x,A[n],B),B=i.idx+1,e+=i.crossLen+2*t}))}T.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),e.addUpdateLayoutTag(),l||this.tempBounds.equals(e.AABBBounds)||this.tryLayout(e)}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+ep(e[i],n.field),t+=r[i].mainLen}else if("flex-end"===i){let t=n.len;for(let i=s;i<=o.idx;i++)t-=r[i].mainLen,e[i].attribute[n.field]=t+ep(e[i],n.field)}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+ep(e[i],n.field),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++)e[t].attribute[n.field]=a+ep(e[t],n.field),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++)e[i].attribute[n.field]=t+ep(e[i],n.field),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++)e[t].attribute[n.field]=a+ep(e[t],n.field),a+=r[t].mainLen+2*i}}layoutCross(t,e,i,n,r,s,o){if("flex-end"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen+ep(t[e],i.field);else if("center"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen/2+ep(t[e],i.field);else for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n+ep(t[e],i.field)}activate(t){this.pluginService=t,Vd.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)})),Vd.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)}))}deactivate(t){Vd.hooks.onAttributeUpdate.taps=Vd.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),Vd.hooks.onSetStage.taps=Vd.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}function ep(t,e){if(!t.attribute.boundsPadding)return 0;if("number"==typeof(i=t.attribute.boundsPadding)&&Number.isFinite(i))return t.attribute.boundsPadding;if(ve(t.attribute.boundsPadding)&&1===t.attribute.boundsPadding.length)return t.attribute.boundsPadding[0];var i;const n=Xs(t.attribute.boundsPadding);return"x"===e?n[3]:"y"===e?n[0]:0}const ip=new Rs;ip.addTimeline(Is);ip.setFPS(60);class np{constructor(e,i,n=.8){this.dir=e,this.color=i,this.colorRgb=Io.Get(i,t.ColorType.Color1),this.ambient=n;const r=Ge(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=je(Fe((e[0]*n[0]+e[1]*n[1]+e[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=ye(i)?Io.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 rp(t,e,i,n){let r,s,o,a,h,l,c,u,d,p;const f=e[0],g=e[1],m=e[2],y=n[0],v=n[1],b=n[2],x=i[0],A=i[1],T=i[2];return Math.abs(f-x)<Re&&Math.abs(g-A)<Re&&Math.abs(m-T)<Re?Lc.identity(t):(c=f-x,u=g-A,d=m-T,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=v*d-b*u,s=b*c-y*d,o=y*u-v*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,h=d*r-c*o,l=c*s-u*r,p=Math.hypot(a,h,l),p?(p=1/p,a*=p,h*=p,l*=p):(a=0,h=0,l=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+o*m),t[13]=-(a*f+h*g+l*m),t[14]=-(c*f+u*g+d*m),t[15]=1,t)}function sp(t,e,i,n,r,s,o){const a=1/(e-i),h=1/(n-r),l=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*h,t[14]=(o+s)*l,t[15]=1,t}function op(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],y=e[14],v=e[15];let b=i[0],x=i[1],A=i[2],T=i[3];return t[0]=b*n+x*a+A*u+T*g,t[1]=b*r+x*h+A*d+T*m,t[2]=b*s+x*l+A*p+T*y,t[3]=b*o+x*c+A*f+T*v,b=i[4],x=i[5],A=i[6],T=i[7],t[4]=b*n+x*a+A*u+T*g,t[5]=b*r+x*h+A*d+T*m,t[6]=b*s+x*l+A*p+T*y,t[7]=b*o+x*c+A*f+T*v,b=i[8],x=i[9],A=i[10],T=i[11],t[8]=b*n+x*a+A*u+T*g,t[9]=b*r+x*h+A*d+T*m,t[10]=b*s+x*l+A*p+T*y,t[11]=b*o+x*c+A*f+T*v,b=i[12],x=i[13],A=i[14],T=i[15],t[12]=b*n+x*a+A*u+T*g,t[13]=b*r+x*h+A*d+T*m,t[14]=b*s+x*l+A*p+T*y,t[15]=b*o+x*c+A*f+T*v,t}function ap(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 hp{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=Nc.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Nc.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return rp(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Nc.allocate()),this._vp=op(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Nc.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Nc.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return sp(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=Nc.allocate()),this._vp=op(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 ap(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;ap(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]}}}const lp="white";class cp extends nh{set viewBox(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}get viewBox(){return this._viewBox}get x(){return this._viewBox.x1}set x(t){this._viewBox.translate(t-this._viewBox.x1,0)}get y(){return this._viewBox.y1}set y(t){this._viewBox.translate(0,t-this._viewBox.y1)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this._viewBox.width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this._viewBox.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:lp}set background(t){this._background=t}get defaultLayer(){return this.at(0)}constructor(t){var e;super({}),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 us,this.hooks={beforeRender:new ne(["stage"]),afterRender:new ne(["stage"])},this.global=Sr.get(se),this.window=Sr.get(oh),this.renderService=Sr.get(Zu),this.pickerService=Sr.get(ed),this.pluginService=Sr.get(hd),this.layerService=Sr.get(ch),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this._viewBox=new Qe,t.viewBox?this._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):this._viewBox.setValue(0,0,this.width,this.height),this.renderCount=0,this._subView=!(this._viewBox.width()===this.width&&this._viewBox.height()===this.height),this._background=null!==(e=t.background)&&void 0!==e?e:lp,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,this.global.supportEvent&&(this.eventSystem=new Cs({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,viewport:{viewBox:this._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}})),t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),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||ip,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Ds,this.ticker.addTimeline(this.timeline),this.timeline.pause(),this.optmize(t.optimize)}optmize(t){this.optmizeRender(null==t?void 0:t.skipRenderWithOutRange)}optmizeRender(t=!0){t&&(this._skipRender=this.window.isVisible()?0:1,this.window.onVisibleChange((t=>{t?(this.dirtyBounds&&this.dirtyBounds.setValue(0,0,this._viewBox.width(),this._viewBox.height()),this._skipRender>1&&this.renderNextFrame(),this._skipRender=0):this._skipRender=1})))}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:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=a,{dir:g=[1,1,-1],color:m="white",ambient:y}=h,v=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[v,b,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(o=l.dz)&&void 0!==o?o:0)];let A=0,T=0,B=0;c||(A=Math.sin(u)+v,T=Math.sin(d)+b,B=Math.cos(u)*Math.cos(d)*1),this.light=new np(g,m,y);const w={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[A,T,B],center:x,up:[0,1,0]}};this.camera?this.camera.params=w:this.camera=new hp(w),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 Kd))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new qd))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new $d))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Je;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new Qd,this.pluginService.register(t)),t.activate(this.pluginService)}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new tp))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new Zd))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{t.deactivate(this.pluginService)})))}tryUpdateAABBBounds(){const t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t){const e=this.layerService.createLayer(this,{main:!1,canvasId:t});return this.appendChild(e),e}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(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.timeline.resume(),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),(t||this).forEach(((t,i)=>{t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},Object.assign({renderStyle:this.renderStyle},e))})),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)),this._skipRender&&this._skipRender++}combineLayersToWindow(){this.forEach(((t,e)=>{t.combineTo(this.window,{clear:0===e,x:this.x,y:this.y,width:this.viewWidth,height:this.viewHeight,renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds})}))}renderNextFrame(t){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(){this.timeline.resume(),this.ticker.start(),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this.forEach((t=>{this.nextFrameRenderLayerSet.has(t)&&t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},Object.assign({renderStyle:this.renderStyle},this.lastRenderparams||{}))})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear()),this._skipRender&&this._skipRender++}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){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,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){const i=this.pickerService.pick(this.children,new Ke(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.eventSystem&&this.eventSystem.release(),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){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,e){this.forEachChildren(((i,n)=>{i.drawTo(t,Object.assign(Object.assign({},e),{renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!!this.dirtyBounds}))}))}renderToNewWindow(t=!0,e){const i=Sr.get(oh);if(t)i.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""});else{const t=e?e.width():Math.min(this.viewWidth,this.window.width-this.x),n=e?e.height():Math.min(this.viewHeight,this.window.height-this.y);i.create({width:t,height:n,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""})}const n=e?-e.x1:0,r=e?-e.y1:0;return this.renderTo(i,{x:n,y:r,width:e?e.x2:i.width,height:e?e.y2:i.height}),i}toCanvas(t=!0,e){const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t)}getCursor(){return this._cursor}}var up;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(up||(up={}));const dp=new ii(1,0,0,1,0,0),pp={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new ii(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new ii(1,0,0,1,0,0),this.path=new Wn}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Uc.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(Uc.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Uc.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){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,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){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,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=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(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,o=!0){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,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){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},pp),function(t,e,i){return ns(t,0,!1,e,i)}(this.path.commandList,pp.x,pp.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},pp);const i=Yu(this,this.lineWidth,this.dpr);return function(t,e,i,n){return ns(t,e,!0,i,n)}(this.path.commandList,i,pp.x,pp.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(t=!0,e=this.dpr){this.setTransformFromMatrix(dp,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Uc.free(t))),this.stack.length=0}},t.EmptyContext2d=X([U(),K("design:paramtypes",[Object,Number])],t.EmptyContext2d);const fp={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){const{nativeCanvas:e,width:i=fp.WIDTH,height:n=fp.HEIGHT,dpr:r=fp.DPR,x:s,y:o,canvasControled:a=!0}=t;this._x=null!=s?s:0,this._y=null!=o?o:0,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=a,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._id=e.id,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(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BaseCanvas.env="browser",t.BaseCanvas=X([U(),K("design:paramtypes",[Object])],t.BaseCanvas),t.BaseEnvContribution=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Qe}removeDom(t){return!1}createDom(t){return null}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=X([U()],t.BaseEnvContribution),t.BaseWindowHandlerContribution=class{constructor(){this._uid=gs.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}},t.BaseWindowHandlerContribution=X([U(),K("design:paramtypes",[])],t.BaseWindowHandlerContribution),t.DefaultPickService=class{constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e,this.type="default"}_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;let r=0,s=0;if(i&&i.bounds){if(!i.bounds.contains(e.x,e.y))return n;r=i.bounds.x1,s=i.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new ii(1,0,0,1,r,s);let a;for(let r=t.length-1;r>=0&&(t[r].isContainer?n=this.pickGroup(t[r],e,o,i):n.graphic=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){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=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=Nc.allocate();if(zc(i,e),o){if(i){const t=Nc.allocate();s.modelMatrix=Gc(t,o,i),Nc.free(i)}}else zc(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&&Nc.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,h=Uc.allocateByObj(i),l=new Ke(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,l.clone(),i,n);u&&(r.graphic=u);const d=!1!==t.attribute.pickable&&c;return h.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u||md(t,$n.zIndex,(s=>{if(s.isContainer){const i=new Ke(e.x,e.y),o=ps(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;i.x-=a,i.y-=l,r=this.pickGroup(s,i,h,n)}else{const o=new Ke(e.x,e.y);h.transformPoint(o,o);const a=ps(t).group,{scrollX:l=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=l,o.y-=c;const u=this.pickItem(s,o,i,n);r.graphic=u}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&Nc.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),Uc.free(h),r}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=X([U(),q(0,I(se)),q(1,I(Jt)),q(1,N(rd)),K("design:paramtypes",[Object,Object])],t.DefaultPickService),t.ACustomAnimate=Ls,t.ARC3D_NUMBER_TYPE=Ia,t.ARC_NUMBER_TYPE=Da,t.AREA_NUMBER_TYPE=La,t.Animate=Ns,t.AnimateGroup=class extends Ls{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?Os[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Ls{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?Os[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Application=dr,t.Arc=mc,t.Arc3d=yc,t.Arc3dRender=Pu,t.ArcRender=Cu,t.ArcRenderContribution=_h,t.Area=fc,t.AreaRender=Eu,t.AreaRenderContribution=Ch,t.AttributeAnimate=class extends Ls{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=ad,t.Basis=bn,t.BeforeRenderConstribution=Ju,t.BoundsContext=Mi,t.BoundsPicker=id,t.CIRCLE_NUMBER_TYPE=Ua,t.CanvasFactory=_r,t.CanvasTextLayout=zh,t.CbAnimate=Us,t.Circle=Nh,t.CircleRender=Mu,t.CircleRenderContribution=Ph,t.ClipAngleAnimate=class extends oo{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g,m;const y=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},v=null!==(a=y.width)&&void 0!==a?a:0,b=null!==(h=y.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",A=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,T=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let B=0,w=0;"anticlockwise"===T?(w="in"===x?A+2*Math.PI:A,w=A+2*Math.PI):(B=A,w="out"===x?A+2*Math.PI:A);const S=pr.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:v/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!==(m=null==r?void 0:r.radius)&&void 0!==m?m:(v+b)/2,innerRadius:0,startAngle:B,endAngle:w,fill:!0});let _,C;"anticlockwise"===T?(_={startAngle:A+2*Math.PI},C={startAngle:A}):(_={endAngle:A},C={endAngle:A+2*Math.PI}),super("in"===x?_:C,"in"===x?C:_,i,n,{group:null==r?void 0:r.group,clipGraphic:S})}},t.ClipDirectionAnimate=class extends oo{constructor(t,e,i,n,r){var s,o,a,h,l,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!==(h=null!==(a=null==r?void 0:r.width)&&void 0!==a?a:f.width)&&void 0!==h?h:0,m=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:f.height)&&void 0!==c?c:0,y=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",v=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=pr.graphicService.creator.rect({x:0,y:0,width:"in"===y&&"x"===v?0:g,height:"in"===y&&"y"===v?0:m,fill:!0});let A={},T={};"y"===v?"negative"===b?(A={y:m,height:0},T={y:0,height:m}):(A={height:0},T={height:m}):"negative"===b?(A={x:g,width:0},T={x:0,width:g}):(A={width:0},T={width:g}),super("in"===y?A:T,"in"===y?T:A,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=oo,t.ClipRadiusAnimate=class extends oo{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g;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,v=null!==(h=m.height)&&void 0!==h?h:0,b=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,A=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((y/2)**2+(v/2)**2),T=pr.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:v/2,outerRadius:"out"===b?A:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),B={outerRadius:x},w={outerRadius:A};super("in"===b?B:w,"in"===b?w:B,i,n,{group:null==r?void 0:r.group,clipGraphic:T})}},t.ColorInterpolate=Bh,t.ColorStore=Io,t.Container=qt,t.ContainerModule=n,t.Context2dFactory=Cr,t.ContributionProvider=Jt,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 un(new Ke(this._lastX,this._lastY),new Ke(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new ln(new Ke(this._lastX,this._lastY),new Ke(t,e),new Ke(i,n),new Ke(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=As,t.CustomPath2D=Wn,t.CustomSymbolClass=Hl,t.DefaultArcAttribute=Zn,t.DefaultAreaAttribute=Jn,t.DefaultAttribute=$n,t.DefaultCircleAttribute=Qn,t.DefaultConnectAttribute=Kn,t.DefaultFillStyle=Hn,t.DefaultGlyphAttribute=er,t.DefaultGroupAttribute=tr,t.DefaultImageAttribute=cr,t.DefaultLayout=zn,t.DefaultLineAttribute=ir,t.DefaultMat4Allocate=Lc,t.DefaultMatrixAllocate=Ic,t.DefaultMorphingAnimateConfig=zs,t.DefaultPathAttribute=nr,t.DefaultPolygonAttribute=rr,t.DefaultRect3dAttribute=or,t.DefaultRectAttribute=sr,t.DefaultRichTextAttribute=lr,t.DefaultRichTextIconAttribute=ur,t.DefaultStateAnimateConfig=js,t.DefaultStrokeStyle=Yn,t.DefaultStyle=qn,t.DefaultSymbolAttribute=ar,t.DefaultSymbolBackgroundRenderContribution=Ku,t.DefaultSymbolTextureRenderContribution=$u,t.DefaultTextAttribute=hr,t.DefaultTextStyle=Xn,t.DefaultTicker=Rs,t.DefaultTimeline=Ds,t.DefaultTransform=Gn,t.DrawContribution=Vu,t.EnvContribution=re,t.EventManager=ws,t.EventSystem=Cs,t.EventTarget=Ss,t.FadeInPlus=class extends Ls{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=so.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 so.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case so.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case so.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case so.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=ys,t.FederatedMouseEvent=vs,t.FederatedPointerEvent=bs,t.FederatedWheelEvent=xs,t.GLYPH_NUMBER_TYPE=Na,t.GRAPHIC_UPDATE_TAG_KEY=sa,t.GROUP_NUMBER_TYPE=Wa,t.Generator=gs,t.GlobalPickerService=nd,t.Glyph=ec,t.GlyphRender=zu,t.Graphic=ua,t.GraphicAnimate=class extends Ls{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=Za,t.GraphicPicker=td,t.GraphicRender=ku,t.GraphicService=$a,t.GraphicUtil=lh,t.Group=nh,t.GroupFadeIn=class extends Ls{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 Ls{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=Ru,t.GroupRenderContribution=Eh,t.IMAGE_NUMBER_TYPE=Fa,t.Image=sc,t.ImageRender=Gu,t.ImageRenderContribution=Mh,t.IncreaseCount=class extends Ls{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;this.fromNumber=xe(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=xe(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)}onEnd(){}onUpdate(t,e,i){var n,r;!1!==this.valid&&(i.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(null!==(r=null===(n=this.params)||void 0===n?void 0:n.fixed)&&void 0!==r?r:0))}},t.IncrementalDrawContribution=_u,t.InputText=class extends Ls{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||ve(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=pr.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),h=this.target.clipedWidth+2;a.setAttribute("x",h)}},t.InteractiveSubRenderContribution=Lh,t.LINE_NUMBER_TYPE=ja,t.Layer=sh,t.LayerHandlerContribution=rh,t.LayerService=ch,t.Line=$l,t.LineRender=Ou,t.Linear=gn,t.LinearClosed=In,t.ManualTickHandler=Ps,t.ManualTicker=class extends Rs{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Ps;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=Oc,t.MatrixAllocate=Rc,t.Meteor=class extends Ls{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 Ke(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=_n,t.MonotoneY=Cn,t.MorphingPath=$o,t.MotionPath=class extends Ls{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=Jo,t.NOWORK_ANIMATE_ATTR=ca,t.Node=ms,t.PATH_NUMBER_TYPE=za,t.POLYGON_NUMBER_TYPE=Ga,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=Ha,t.Path=dc,t.PathRender=Du,t.PathRenderContribution=kh,t.PickItemInterceptor=rd,t.PickerService=ed,t.PluginService=hd,t.Polygon=bc,t.PolygonRender=Iu,t.PolygonRenderContribution=Rh,t.Pyramid3d=xc,t.Pyramid3dRender=ju,t.RAFTickHandler=Ms,t.RECT3D_NUMBER_TYPE=Ya,t.RECT_NUMBER_TYPE=Va,t.RICHTEXT_NUMBER_TYPE=Xa,t.RafBasedSTO=no,t.Rect=Jl,t.Rect3DRender=Uu,t.Rect3d=tc,t.RectRender=Lu,t.RectRenderContribution=Oh,t.ReflectSegContext=pn,t.RenderSelector=Hu,t.RenderService=Zu,t.ResourceLoader=na,t.RichText=cc,t.RichTextRender=Fu,t.RotateBySphereAnimate=class extends Ls{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=Le-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}="function"==typeof this.params?this.params():this.params,s=2*Math.PI*e,o=this.theta+s,a=this.phi,h=r*Math.sin(a)*Math.cos(o)+n.x,l=r*Math.cos(a)+n.y,c=r*Math.sin(a)*Math.sin(o)+n.z;for(i.x=h,i.y=l,i.z=c,i.alpha=o+Oe/2;i.alpha>Le;)i.alpha-=Le;i.alpha=Le-i.alpha,i.zIndex=-1e4*i.z}},t.SVG_ATTRIBUTE_MAP=Ja,t.SVG_ATTRIBUTE_MAP_KEYS=Qa,t.SVG_PARSE_ATTRIBUTE_MAP=th,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=eh,t.SYMBOL_NUMBER_TYPE=qa,t.SegContext=dn,t.Stage=cp,t.Step=Rn,t.StreamLight=class extends Ls{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){var t;const e=this.target.attachShadow(),i=this.target.AABBBounds.height(),n=pr.graphicService.creator.rect(Object.assign(Object.assign({height:i,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(t=this.params)||void 0===t?void 0:t.attribute),{x:0,y:0,width:0}));this.rect=n,e.add(n)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(e,i,n){var r,s,o,a,h,l;const c=null!==(r=this.target.attribute.width)&&void 0!==r?r:250,u=null!==(o=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==o?o:c,d=null!==(l=null===(h=null===(a=this.params)||void 0===a?void 0:a.attribute)||void 0===h?void 0:h.width)&&void 0!==l?l:60,p=-d,f=p+(u-p)*i,g=Math.max(f,0),m=Math.min(Math.min(f+d,d),u-f),y=m+g>c?Math.max(c-g,0):m;this.rect.setAttributes({x:g,width:y},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}},t.SubAnimate=Ws,t.Symbol=ql,t.SymbolRender=Nu,t.SymbolRenderContribution=Dh,t.TEXT_NUMBER_TYPE=Ka,t.TagPointsUpdate=class extends Ls{constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===(null==r?void 0:r.newPointAnimateType)?"appear":"grow"}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,h=-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)){h=t,o=r.get(this.toPoints[t].context);break}let l=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=r.get(t.context);return i?(l=i,[i,t]):"appear"===this.newPointAnimateType?[t,t]:e<a&&s?[s,t]:e>h&&o?[o,t]:[l,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new Ke(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=Js(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=Hh,t.TextMeasureContribution=wr,t.TextRender=Wu,t.TextRenderContribution=Ih,t.Theme=us,t.TimeOutTickHandler=Es,t.TransformUtil=hh,t.VGlobal=se,t.VWindow=oh,t.WILDCARD="*",t.WindowHandlerContribution=ah,t.WrapText=Yh,t.XMLParser=Ta,t.addArcToBezierPath=Qi,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=go,t.alignSubpath=ho,t.application=pr,t.applyTransformOnBezierCurves=vo,t.bezier=Zi,t.bezierCurversToPath=bo,t.binarySplitPolygon=Eo,t.bindContributionProvider=te,t.bindContributionProviderNoSingletonScope=ee,t.boundStroke=Sa,t.builtinSymbols=Vl,t.builtinSymbolsMap=Yl,t.calcLineCache=Nn,t.centroidOfSubpath=uo,t.circleBounds=$s,t.clock=Ts,t.cloneGraphic=ea,t.colorEqual=function(t,e){const i=Oo.parseColorString(t),n=Oo.parseColorString(e);return!(!i||!n)&&(i.r===n.r&&i.g===n.g&&i.b===n.b&&i.opacity===n.opacity)},t.colorStringInterpolationToStr=Ho,t.container=Sr,t.cornerTangents=xh,t.createArc=Xc,t.createArc3d=function(t){return new yc(t)},t.createArea=qc,t.createCircle=Kc,t.createColor=Xu,t.createConicalGradient=function(t,e,i,n,r,s,o,a,h){const l=Math.floor(180*r/Math.PI),c=Th.GetCanvas(),u=Th.GetCtx();if(!u)return null;const d=wh.GetSize(a),p=wh.GetSize(h);let f=wh.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)))),m=l+1,y=r/Math.max(1,m-1),v=Bh.GetOrCreate(e,m),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=m-1;t<e&&!(s+t*y>o);t++){const e=v.getColor(t);u.beginPath(),u.rotate(y),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&&wh.Set(e,i,n,s,o,f,d,p),f},t.createGlyph=function(t){return new ec(t)},t.createGroup=$c,t.createImage=ru,t.createLine=Zc,t.createMat4=Dc,t.createPath=Jc,t.createPolygon=su,t.createPyramid3d=function(t){return new xc(t)},t.createRect=Qc,t.createRect3d=tu,t.createRectPath=Au,t.createRichText=au,t.createShadowRoot=ou,t.createStage=function(t){return new cp(t)},t.createSymbol=nu,t.createText=eu,t.createWrapText=iu,t.cubicCalc=on,t.cubicLength=sn,t.cubicPointAt=an,t.cubicSubdivide=ao,t.defaultTicker=ip,t.defaultTimeline=Is,t.drawArc=Ji,t.drawArcPath=Ah,t.drawAreaSegments=gu,t.drawIncrementalAreaSegments=pu,t.drawIncrementalSegments=du,t.drawPathProxy=vh,t.drawSegments=uu,t.enumCommandMap=Di,t.fillVisible=fh,t.findBestMorphingRotation=fo,t.findNextGraphic=vd,t.foreach=md,t.foreachAsync=yd,t.genBasisSegments=An,t.genBasisTypeSegments=xn,t.genLinearClosedSegments=Ln,t.genLinearClosedTypeSegments=Un,t.genLinearSegments=mn,t.genLinearTypeSegments=yn,t.genMonotoneXSegments=En,t.genMonotoneYSegments=kn,t.genMonotpneXTypeSegments=Pn,t.genMonotpneYTypeSegments=Mn,t.genNumberType=Ca,t.genStepSegments=On,t.genStepTypeSegments=Dn,t.getAttributeFromDefaultAttrList=io,t.getConicGradientAt=Sh,t.getContextFont=Wh,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]+=Fh(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=Nc.allocate();return jc(a,a,[o[0],o[1],0]),r&&Wc(a,a,r),n&&Fc(a,a,n),jc(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=Hc,t.getRichTextBounds=function(t){return cu.setAttributes(t),cu.AABBBounds},t.getScaledStroke=Yu,t.getTextBounds=function(t){return lu.setAttributes(t),lu.AABBBounds},t.getTheme=ps,t.getThemeFromGroup=fs,t.globalTheme=ds,t.graphicCreator=hu,t.graphicService=Vd,t.graphicUtil=Gd,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.inject=I,t.injectable=U,t.interpolateColor=Uo,t.interpolateGradientConicalColor=Fo,t.interpolateGradientLinearColor=No,t.interpolateGradientRadialColor=Wo,t.interpolatePureColorArray=jo,t.intersect=bh,t.isSvg=Ba,t.isTransformKey=eo,t.isXML=wa,t.layerService=Xd,t.lookAt=rp,t.mat3Tomat4=zc,t.mat4Allocate=Nc,t.matrixAllocate=Uc,t.morphPath=Zo,t.multiInject=L,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 h=("clone"===(null==n?void 0:n.splitPath)?ea:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:ia)(i,a.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=a.map(((t,e)=>Xo(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=a.map(((t,e)=>Ko(t.attribute,l)));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())};h.forEach(((t,i)=>{var r,s,h;const l=(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(l),d.play(new $o({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:zs.duration,null!==(h=n.easing)&&void 0!==h?h:zs.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 Jo({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:zs.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:zs.easing))}},t.multiply=op,t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],y=e[14],v=e[15];let b=i.a,x=i.b,A=0,T=0;return t[0]=b*n+x*a+A*u+T*g,t[1]=b*r+x*h+A*d+T*m,t[2]=b*s+x*l+A*p+T*y,t[3]=b*o+x*c+A*f+T*v,b=i.c,x=i.d,A=0,T=0,t[4]=b*n+x*a+A*u+T*g,t[5]=b*r+x*h+A*d+T*m,t[6]=b*s+x*l+A*p+T*y,t[7]=b*o+x*c+A*f+T*v,b=0,x=0,A=1,T=0,t[8]=b*n+x*a+A*u+T*g,t[9]=b*r+x*h+A*d+T*m,t[10]=b*s+x*l+A*p+T*y,t[11]=b*o+x*c+A*f+T*v,b=i.e,x=i.f,A=0,T=1,t[12]=b*n+x*a+A*u+T*g,t[13]=b*r+x*h+A*d+T*m,t[14]=b*s+x*l+A*p+T*y,t[15]=b*o+x*c+A*f+T*v,t},t.multiplyMat4Mat4=Gc,t.named=N,t.newThemeObj=hs,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)?ea:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:ia)(t,r.length,!1),o=null==i?void 0:i.onEnd;let a=r.length;const h=()=>{a--,0===a&&o&&o()};r.forEach(((e,n)=>{var o;const a=s[n],l=(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);Zo(a,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.ortho=sp,t.parsePadding=Xs,t.parseStroke=Vs,t.parseSvgPath=ji,t.pathToBezierCurves=yo,t.pickerService=Yd,t.point=vn,t.pointEqual=Zs,t.pointInterpolation=Js,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=Xe(t.x,t.y,e.x,e.y,i),{x:o,y:a}=Xe(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)=>Zs(t,e[i]))):!Number.isNaN(t.x+t.y)&&Zs(t,e))},t.pointsInterpolation=Qs,t.postConstruct=Kt,t.rafBasedSto=ro,t.rectFillVisible=gh,t.rectStrokeVisible=yh,t.recursiveCallBinarySplit=Mo,t.renderCommandList=en,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.rotateX=Wc,t.rotateY=Fc,t.runFill=dh,t.runStroke=ph,t.segments=$i,t.shouldUseMat4=Vc,t.snapLength=rn,t.splitArc=To,t.splitArea=So,t.splitCircle=Bo,t.splitGraphic=ia,t.splitLine=_o,t.splitPath=Ro,t.splitPolygon=ko,t.splitRect=Ao,t.splitToGrids=xo,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=mh,t.textDrawOffsetX=Fh,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=jh,t.transformKeys=to,t.transformMat4=ap,t.transformUtil=Hd,t.translate=jc,t.verticalLayout=Ea,t.vglobal=zd,t.waitForAllSubLayers=function(t){return $(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{pr.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=Pr,t.wrapContext=function(t,e){return Sr.getNamed(Cr,pr.global.env)(t,e)},t.xul=function(t){const e=ve(t)?t[0]:t,i=[];if(!e)return i;if(!0===wa(e)){const t=(new Ta).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};Oa(t,e);const i=t["#text"];i&&(e.text=i);return e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};Oa(t,e);const i=e.image;i&&(e.image=i.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">"));return 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).VRenderCore={})}(this,(function(t){"use strict";let e=0;function i(){return e++}class n{constructor(t){this.id=i(),this.registry=t}}const r="named",s="name",o="unmanaged",a="optional",h="inject",l="multi_inject",c="inversify:tagged",u="inversify:tagged_props",d="inversify:paramtypes",p="post_construct",f="pre_destroy";const g=[h,l,s,o,r,a],m="Metadata key was used more than once in a parameter:",y="NULL argument",v="Key Not Found",b="Ambiguous match found for serviceIdentifier:",x="No matching bindings found for serviceIdentifier:",A="Missing required @injectable annotation in:",T="Missing required @inject or @multiInject annotation in:",B="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",S=(...t)=>`The number of constructor arguments in the derived class ${t[0]} must be >= than the number of constructor arguments of its base class.`,w=(t,e)=>`@preDestroy error in class ${t}: ${e}`,_=(t,e)=>`onDeactivation() error in class ${t}: ${e}`;class C{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===r?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}let P;var M=function(t){return function(e){const i="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")();let n=r(t);function r(t,e){return function(i,n){"function"!=typeof t[i]&&Object.defineProperty(t,i,{configurable:!0,writable:!0,value:n}),e&&e(i,n)}}void 0===i.Reflect?i.Reflect=t:n=r(i.Reflect,n),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,h={create:s?function(){return W(Object.create(null))}:o?function(){return W({__proto__:null})}:function(){return W({})},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]}},l=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?L():Map;c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?U():Set;const d=new(c||"function"!=typeof WeakMap?N():WeakMap);function p(t,e,i,n){if(!C(i))throw new TypeError;return S(n)||(n=R(n)),T(t,e,i,n)}function f(t,e,i){if(!C(e))throw new TypeError;return S(i)||(i=R(i)),v(t,e,i)}function g(t,e,i){if(!C(e))throw new TypeError;return S(i)||(i=R(i)),b(t,e,i)}function m(t,e,i){if(!C(e))throw new TypeError;return S(i)||(i=R(i)),x(t,e,i)}function y(t,e,i){let n=d.get(t);if(S(n)){if(!i)return;n=new u,d.set(t,n)}let r=n.get(e);if(S(r)){if(!i)return;r=new u,n.set(e,r)}return r}function v(t,e,i){if(b(t,e,i))return!0;const n=I(e);return!w(n)&&v(t,n,i)}function b(t,e,i){const n=y(e,i,!1);return!S(n)&&E(n.has(t))}function x(t,e,i){if(b(t,e,i))return A(t,e,i);const n=I(e);return w(n)?void 0:x(t,n,i)}function A(t,e,i){const n=y(e,i,!1);if(!S(n))return n.get(t)}function T(t,e,i,n){y(i,n,!0).set(t,e)}function B(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function S(t){return void 0===t}function w(t){return null===t}function _(t){return"symbol"==typeof t}function C(t){return"object"==typeof t?null!==t:"function"==typeof t}function P(t,e){switch(B(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=D(t,n);if(void 0!==r){const e=r.call(t,i);if(C(e))throw new TypeError;return e}return M(t,"default"===i?"number":i)}function M(t,e){if("string"===e){const e=t.toString;if(O(e)){const i=e.call(t);if(!C(i))return i}const i=t.valueOf;if(O(i)){const e=i.call(t);if(!C(e))return e}}else{const e=t.valueOf;if(O(e)){const i=e.call(t);if(!C(i))return i}const i=t.toString;if(O(i)){const e=i.call(t);if(!C(e))return e}}throw new TypeError}function E(t){return!!t}function k(t){return""+t}function R(t){const e=P(t,3);return _(e)?e:k(e)}function O(t){return"function"==typeof t}function D(t,e){const i=t[e];if(null!=i){if(!O(i))throw new TypeError;return i}}function I(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)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 L(){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]}}function U(){return function(){function t(){this._map=new u}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()},t}()}function N(){const t=16,i=h.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&&h.has(e,this._key)},t.prototype.get=function(t){const e=s(t,!1);return void 0!==e?h.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@@"+l()}while(h.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:h.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(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t)}function l(){const e=a(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;let i="";for(let n=0;n<t;++n){const t=e[n];4!==n&&6!==n&&8!==n||(i+="-"),t<16&&(i+="0"),i+=t.toString(16).toLowerCase()}return i}}function W(t){return t.__=void 0,delete t.__,t}t("defineMetadata",p),t("hasMetadata",f),t("hasOwnMetadata",g),t("getMetadata",m)}(n)}(),t}(P||(P={}));function E(t,e,i,n){!function(t){if(void 0!==t)throw new Error(B)}(e),R(c,t,i.toString(),n)}function k(t){let e=[];if(Array.isArray(t)){e=t;const i=function(t){const e=new Set;for(const i of t){if(e.has(i))return i;e.add(i)}}(e.map((t=>t.key)));if(void 0!==i)throw new Error(`${m} ${i.toString()}`)}else e=[t];return e}function R(t,e,i,n){const r=k(n);let s={};M.hasOwnMetadata(t,e)&&(s=M.getMetadata(t,e));let o=s[i];if(void 0===o)o=[];else for(const t of o)if(r.some((e=>e.key===t.key)))throw new Error(`${m} ${t.key.toString()}`);o.push(...r),s[i]=o,M.defineMetadata(t,s,e)}function O(t){return(e,i,n)=>{"number"==typeof n?E(e,i,n,t):function(t,e,i){if(void 0!==t.prototype)throw new Error(B);R(u,t.constructor,e,i)}(e,i,t)}}function D(t){return e=>(i,n,r)=>{if(void 0===e){const t="function"==typeof i?i.name:i.constructor.name;throw new Error(`@inject called with undefined this could mean that the class ${t} has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.`)}return O(new C(t,e))(i,n,r)}}const I=D(h),L=D(l);function U(){return function(t){if(M.hasOwnMetadata(d,t))throw new Error("Cannot apply @injectable decorator multiple times.");const e=M.getMetadata("design:paramtypes",t)||[];return M.defineMetadata(d,e,t),t}}function N(t){return O(new C(r,t))}function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(r=n.key,s=void 0,"symbol"==typeof(s=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"))?s:String(s)),n)}var r,s}function z(t,e,i){return e&&j(t.prototype,e),i&&j(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function G(t){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},G(t)}function H(t,e){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},H(t,e)}function V(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=G(t);if(e){var r=G(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return V(this,i)}}function X(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":W(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 q(t,e){return function(i,n){e(i,n,t)}}function K(t,e){if("object"===("undefined"==typeof Reflect?"undefined":W(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function $(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Z={Request:"Request",Singleton:"Singleton",Transient:"Transient"},J={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},Q={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};class tt{constructor(t,e){this.id=i(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=J.Invalid,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}clone(){const t=new tt(this.serviceIdentifier,this.scope);return t.activated=t.scope===Z.Singleton&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.onDeactivation=this.onDeactivation,t.cache=this.cache,t}}class et{getConstructorMetadata(t){return{compilerGeneratedMetadata:M.getMetadata(d,t),userGeneratedMetadata:M.getMetadata(c,t)||{}}}getPropertiesMetadata(t){return M.getMetadata(u,t)||[]}}const it={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function nt(t){if("function"==typeof t){return t.name}if("symbol"==typeof t)return t.toString();return t}function rt(t,e,i){let n="";const r=i(t,e);return 0!==r.length&&(n="\nRegistered bindings:",r.forEach((t=>{let e="Object";null!==t.implementationType&&(e=st(t.implementationType)),n=`${n}\n ${e}`,t.constraint.metaData&&(n=`${n} - ${t.constraint.metaData}`)}))),n}function st(t){if(t.name)return t.name;const e=t.toString(),i=e.match(/^function\s*([^\s(]+)/);return i?i[1]:`Anonymous function: ${e}`}class ot{constructor(t){this.id=i(),this.container=t}addPlan(t){this.plan=t}setCurrentRequest(t){this.currentRequest=t}}class at{constructor(t,e){this.parentContext=t,this.rootRequest=e}}class ht{constructor(t){this._cb=t}unwrap(){return this._cb()}}class lt{constructor(t){this.str=t}startsWith(t){return 0===this.str.indexOf(t)}endsWith(t){let e="";const i=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},i)}contains(t){return-1!==this.str.indexOf(t)}equals(t){return this.str===t}value(){return this.str}}class ct{constructor(t,e,n,s){this.id=i(),this.type=t,this.serviceIdentifier=n;const o="symbol"==typeof e?e.toString().slice(7,-1):e;this.name=new lt(o||""),this.identifier=e,this.metadata=[];let a=null;"string"==typeof s?a=new C(r,s):s instanceof C&&(a=s),null!==a&&this.metadata.push(a)}hasTag(t){for(const e of this.metadata)if(e.key===t)return!0;return!1}isArray(){return this.hasTag(l)}matchesArray(t){return this.matchesTag(l)(t)}isNamed(){return this.hasTag(r)}isTagged(){return this.metadata.some((t=>g.every((e=>t.key!==e))))}isOptional(){return this.matchesTag(a)(!0)}getNamedTag(){return this.isNamed()?this.metadata.filter((t=>t.key===r))[0]:null}getCustomTags(){return this.isTagged()?this.metadata.filter((t=>g.every((e=>t.key!==e)))):null}matchesNamedTag(t){return this.matchesTag(r)(t)}matchesTag(t){return e=>{for(const i of this.metadata)if(i.key===t&&i.value===e)return!0;return!1}}}function ut(t,e,i,n){const r=t.getConstructorMetadata(i),s=r.compilerGeneratedMetadata;if(void 0===s){throw new Error(`${A} ${e}.`)}const o=r.userGeneratedMetadata,a=Object.keys(o),h=0===i.length&&a.length>0,l=a.length>i.length,c=function(t,e,i,n,r){const s=[];for(let o=0;o<r;o++){const r=dt(o,t,e,i,n);null!==r&&s.push(r)}return s}(n,e,s,o,h||l?a.length:i.length);return[...c,...ft(t,i,e)]}function dt(t,e,i,n,r){const s=r[t.toString()]||[],o=mt(s),a=!0!==o.unmanaged;let h=n[t];const l=o.inject||o.multiInject;if(h=l||h,h instanceof ht&&(h=h.unwrap()),a){if(!e&&(h===Object||h===Function||void 0===h)){throw new Error(`${T} argument ${t} in class ${i}.`)}const n=new ct(Q.ConstructorArgument,o.targetName,h);return n.metadata=s,n}return null}function pt(t,e,i,n){const r=t||e;if(void 0===r){const t=`${A} for property ${String(i)} in class ${n}.`;throw new Error(t)}return r}function ft(t,e,i){const n=t.getPropertiesMetadata(e);let r=[];const s=Object.getOwnPropertySymbols(n),o=Object.keys(n).concat(s);for(const t of o){const e=n[t],s=mt(e),o=s.targetName||t,a=pt(s.inject,s.multiInject,t,i),h=new ct(Q.ClassProperty,o,a);h.metadata=e,r.push(h)}const a=Object.getPrototypeOf(e.prototype).constructor;if(a!==Object){const e=ft(t,a,i);r=[...r,...e]}return r}function gt(t,e){const i=Object.getPrototypeOf(e.prototype).constructor;if(i!==Object){const e=ut(t,st(i),i,!0),n=e.map((t=>t.metadata.filter((t=>t.key===o)))),r=[].concat.apply([],n).length,s=e.length-r;return s>0?s:gt(t,i)}return 0}function mt(t){const e={};return t.forEach((t=>{e[t.key.toString()]=t.value})),{inject:e[h],multiInject:e[l],targetName:e[s],unmanaged:e[o]}}class yt{constructor(t,e,n,r,s){this.id=i(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=s,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}addChildRequest(t,e,i){const n=new yt(t,this.parentContext,this,e,i);return this.childRequests.push(n),n}}function vt(t){return t._bindingDictionary}function bt(t,e,i,n,r){let s=At(i.container,r.serviceIdentifier),o=[];return s.length===it.NoBindingsAvailable&&i.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(r.serviceIdentifier).toSelf(),s=At(i.container,r.serviceIdentifier)),o=e?s:s.filter((t=>{const e=new yt(t.serviceIdentifier,i,n,t,r);return t.constraint(e)})),function(t,e,i,n){switch(e.length){case it.NoBindingsAvailable:if(i.isOptional())return e;const r=nt(t);let s=x;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){let i="";const n=e.getNamedTag(),r=e.getCustomTags();return null!==n&&(i+=n.toString()+"\n"),null!==r&&r.forEach((t=>{i+=t.toString()+"\n"})),` ${t}\n ${t} - ${i}`}return` ${t}`}(r,i),s+=rt(n,r,At),new Error(s);case it.OnlyOneBindingAvailable:return e;case it.MultipleBindingsAvailable:default:if(i.isArray())return e;{const e=nt(t);let i=`${b} ${e}`;throw i+=rt(n,e,At),new Error(i)}}}(r.serviceIdentifier,o,r,i.container),o}function xt(t,e,i,n,r,s){let o,a;if(null===r){o=bt(t,e,n,null,s),a=new yt(i,n,null,o,s);const r=new at(n,a);n.addPlan(r)}else o=bt(t,e,n,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((e=>{let i=null;if(s.isArray())i=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;i=a}if(e.type===J.Instance&&null!==e.implementationType){const r=function(t,e){return ut(t,st(e),e,!1)}(t,e.implementationType);if(!n.container.options.skipBaseClassChecks){const i=gt(t,e.implementationType);if(r.length<i){const t=S(st(e.implementationType));throw new Error(t)}}r.forEach((e=>{xt(t,!1,e.serviceIdentifier,n,i,e)}))}}))}function At(t,e){let i=[];const n=vt(t);return n.hasKey(e)?i=n.get(e):null!==t.parent&&(i=At(t.parent,e)),i}function Tt(t,e,i,n,r,s,o,a=!1){const c=new ot(e),u=function(t,e,i,n,r,s){const o=new C(t?l:h,i),a=new ct(e,n,i,o);if(void 0!==r){const t=new C(r,s);a.metadata.push(t)}return a}(i,n,r,"",s,o);return xt(t,a,r,c,null,u),c}function Bt(t){return("object"==typeof t&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function St(t){return!!Bt(t)||Array.isArray(t)&&t.some(Bt)}const wt=(t,e,i)=>{t.has(e.id)||t.set(e.id,i)},_t=(t,e)=>{t.cache=e,t.activated=!0,Bt(e)&&Ct(t,e)},Ct=(t,e)=>$(void 0,void 0,void 0,(function*(){try{const i=yield e;t.cache=i}catch(e){throw t.cache=null,t.activated=!1,e}}));var Pt;!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(Pt||(Pt={}));function Mt(t,e,i){let n;if(e.length>0){const r=function(t,e){return t.reduce(((t,i)=>{const n=e(i);return i.target.type===Q.ConstructorArgument?t.constructorInjections.push(n):(t.propertyRequests.push(i),t.propertyInjections.push(n)),t.isAsync||(t.isAsync=St(n)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,i),s=Object.assign(Object.assign({},r),{constr:t});n=r.isAsync?function(t){return $(this,void 0,void 0,(function*(){const e=yield kt(t.constructorInjections),i=yield kt(t.propertyInjections);return Et(Object.assign(Object.assign({},t),{constructorInjections:e,propertyInjections:i}))}))}(s):Et(s)}else n=new t;return n}function Et(t){const e=new t.constr(...t.constructorInjections);return t.propertyRequests.forEach(((i,n)=>{const r=i.target.identifier,s=t.propertyInjections[n];e[r]=s})),e}function kt(t){return $(this,void 0,void 0,(function*(){const e=[];for(const i of t)Array.isArray(i)?e.push(Promise.all(i)):e.push(i);return Promise.all(e)}))}function Rt(t,e){const i=function(t,e){var i,n;if(M.hasMetadata(p,t)){return null===(n=(i=e)[M.getMetadata(p,t).value])||void 0===n?void 0:n.call(i)}}(t,e);return Bt(i)?i.then((()=>e)):e}function Ot(t,e){t.scope!==Z.Singleton&&function(t,e){const i=`Class cannot be instantiated in ${t.scope===Z.Request?"request":"transient"} scope.`;if("function"==typeof t.onDeactivation)throw new Error(_(e.name,i));if(M.hasMetadata(f,e))throw new Error(w(e.name,i))}(t,e)}const Dt=t=>e=>{e.parentContext.setCurrentRequest(e);const i=e.bindings,n=e.childRequests,r=e.target&&e.target.isArray(),s=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(r&&s)return n.map((e=>Dt(t)(e)));if(e.target.isOptional()&&0===i.length)return;const o=i[0];return Nt(t,e,o)},It=(t,e)=>{const i=(t=>{switch(t.type){case J.Factory:return{factory:t.factory,factoryType:Pt.Factory};case J.Provider:return{factory:t.provider,factoryType:Pt.Provider};case J.DynamicValue:return{factory:t.dynamicValue,factoryType:Pt.DynamicValue};default:throw new Error(`Unexpected factory type ${t.type}`)}})(t);return(()=>i.factory.bind(t)(e))()},Lt=(t,e,i)=>{let n;const r=e.childRequests;switch((t=>{let e=null;switch(t.type){case J.ConstantValue:case J.Function:e=t.cache;break;case J.Constructor:case J.Instance:e=t.implementationType;break;case J.DynamicValue:e=t.dynamicValue;break;case J.Provider:e=t.provider;break;case J.Factory:e=t.factory}if(null===e){const e=nt(t.serviceIdentifier);throw new Error(`Invalid binding type: ${e}`)}})(i),i.type){case J.ConstantValue:case J.Function:n=i.cache;break;case J.Constructor:n=i.implementationType;break;case J.Instance:n=function(t,e,i,n){Ot(t,e);const r=Mt(e,i,n);return Bt(r)?r.then((t=>Rt(e,t))):Rt(e,r)}(i,i.implementationType,r,Dt(t));break;default:n=It(i,e.parentContext)}return n},Ut=(t,e,i)=>{let n=((t,e)=>e.scope===Z.Singleton&&e.activated?e.cache:e.scope===Z.Request&&t.has(e.id)?t.get(e.id):null)(t,e);return null!==n||(n=i(),((t,e,i)=>{e.scope===Z.Singleton&&_t(e,i),e.scope===Z.Request&&wt(t,e,i)})(t,e,n)),n},Nt=(t,e,i)=>Ut(t,i,(()=>Lt(t,e,i)));class Wt{constructor(t){this._binding=t}}const Ft=(jt=r,t=>{const e=e=>null!==e&&null!==e.target&&e.target.matchesTag(jt)(t);return e.metaData=new C(jt,t),e});var jt;class zt{constructor(t){this._binding=t}whenTargetNamed(t){return this._binding.constraint=Ft(t),new Wt(this._binding)}}class Gt{constructor(t){this._binding=t,this._bindingWhenSyntax=new zt(this._binding)}whenTargetNamed(t){return this._bindingWhenSyntax.whenTargetNamed(t)}}class Ht{constructor(t){this._binding=t}inRequestScope(){return this._binding.scope=Z.Request,new Gt(this._binding)}inSingletonScope(){return this._binding.scope=Z.Singleton,new Gt(this._binding)}inTransientScope(){return this._binding.scope=Z.Transient,new Gt(this._binding)}}class Vt{constructor(t){this._binding=t,this._bindingWhenSyntax=new zt(this._binding),this._bindingInSyntax=new Ht(t)}inRequestScope(){return this._bindingInSyntax.inRequestScope()}inSingletonScope(){return this._bindingInSyntax.inSingletonScope()}inTransientScope(){return this._bindingInSyntax.inTransientScope()}whenTargetNamed(t){return this._bindingWhenSyntax.whenTargetNamed(t)}}class Yt{constructor(t){this._binding=t}to(t){return this._binding.type=J.Instance,this._binding.implementationType=t,new Vt(this._binding)}toSelf(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");const t=this._binding.serviceIdentifier;return this.to(t)}toConstantValue(t){return this._binding.type=J.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Z.Singleton,new Gt(this._binding)}toDynamicValue(t){return this._binding.type=J.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Vt(this._binding)}toConstructor(t){return this._binding.type=J.Constructor,this._binding.implementationType=t,this._binding.scope=Z.Singleton,new Gt(this._binding)}toFactory(t){return this._binding.type=J.Factory,this._binding.factory=t,this._binding.scope=Z.Singleton,new Gt(this._binding)}toFunction(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");const e=this.toConstantValue(t);return this._binding.type=J.Function,this._binding.scope=Z.Singleton,e}toAutoFactory(t){return this._binding.type=J.Factory,this._binding.factory=e=>()=>e.container.get(t),this._binding.scope=Z.Singleton,new Gt(this._binding)}toAutoNamedFactory(t){return this._binding.type=J.Factory,this._binding.factory=e=>i=>e.container.getNamed(t,i),new Gt(this._binding)}toProvider(t){return this._binding.type=J.Provider,this._binding.provider=t,this._binding.scope=Z.Singleton,new Gt(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}class Xt{constructor(){this._map=new Map}getMap(){return this._map}add(t,e){if(null==t)throw new Error(y);if(null==e)throw new Error(y);const i=this._map.get(t);void 0!==i?i.push(e):this._map.set(t,[e])}get(t){if(null==t)throw new Error(y);const e=this._map.get(t);if(void 0!==e)return e;throw new Error(v)}remove(t){if(null==t)throw new Error(y);if(!this._map.delete(t))throw new Error(v)}removeIntersection(t){this.traverse(((e,i)=>{const n=t.hasKey(e)?t.get(e):void 0;if(void 0!==n){const t=i.filter((t=>!n.some((e=>t===e))));this._setValue(e,t)}}))}removeByCondition(t){const e=[];return this._map.forEach(((i,n)=>{const r=[];for(const n of i){t(n)?e.push(n):r.push(n)}this._setValue(n,r)})),e}hasKey(t){if(null==t)throw new Error(y);return this._map.has(t)}clone(){const t=new Xt;return this._map.forEach(((e,i)=>{e.forEach((e=>{return t.add(i,"object"==typeof(n=e)&&null!==n&&"clone"in n&&"function"==typeof n.clone?e.clone():e);var n}))})),t}traverse(t){this._map.forEach(((e,i)=>{t(i,e)}))}_setValue(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)}}class qt{static merge(t,e,...i){const n=new qt,r=[t,e,...i].map((t=>vt(t))),s=vt(n);return r.forEach((t=>{var e;e=s,t.traverse(((t,i)=>{i.forEach((t=>{e.add(t.serviceIdentifier,t.clone())}))}))})),n}constructor(t){const e=t||{};if("object"!=typeof e)throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=Z.Transient;else if(e.defaultScope!==Z.Singleton&&e.defaultScope!==Z.Transient&&e.defaultScope!==Z.Request)throw new Error('Invalid Container option. Default scope must be a string ("singleton" or "transient").');if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=i(),this._bindingDictionary=new Xt,this.parent=null,this._metadataReader=new et}load(...t){const e=this._getContainerModuleHelpersFactory();for(const i of t){const t=e(i.id);i.registry(t.bindFunction,t.unbindFunction,t.isboundFunction,t.rebindFunction)}}unload(...t){t.forEach((t=>{const e=this._removeModuleBindings(t.id);this._deactivateSingletons(e)}))}bind(t){const e=this.options.defaultScope||Z.Transient,i=new tt(t,e);return this._bindingDictionary.add(t,i),new Yt(i)}rebind(t){return this.unbind(t),this.bind(t)}unbind(t){if(this._bindingDictionary.hasKey(t)){const e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)}unbindAll(){this._bindingDictionary.traverse(((t,e)=>{this._deactivateSingletons(e)})),this._bindingDictionary=new Xt}isBound(t){let e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e}isCurrentBound(t){return this._bindingDictionary.hasKey(t)}isBoundNamed(t,e){return this.isBoundTagged(t,r,e)}isBoundTagged(t,e,i){let n=!1;if(this._bindingDictionary.hasKey(t)){const r=this._bindingDictionary.get(t),s=function(t,e,i,n){const r=new ct(Q.Variable,"",e,new C(i,n)),s=new ot(t);return new yt(e,s,null,[],r)}(this,t,e,i);n=r.some((t=>t.constraint(s)))}return!n&&this.parent&&(n=this.parent.isBoundTagged(t,e,i)),n}applyCustomMetadataReader(t){this._metadataReader=t}get(t){const e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)}getAsync(t){return $(this,void 0,void 0,(function*(){const e=this._getNotAllArgs(t,!1);return this._get(e)}))}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._getButThrowIfAsync(n)}getNamed(t,e){return this.getTagged(t,r,e)}getAll(t){const e=this._getAllArgs(t);return this._getButThrowIfAsync(e)}getAllTagged(t,e,i){const n=this._getNotAllArgs(t,!0,e,i);return this._getButThrowIfAsync(n)}getAllNamed(t,e){return this.getAllTagged(t,r,e)}resolve(t){const e=this.isBound(t);e||this.bind(t).toSelf();const i=this.get(t);return e||this.unbind(t),i}_preDestroy(t,e){var i,n;if(M.hasMetadata(f,t)){return null===(n=(i=e)[M.getMetadata(f,t).value])||void 0===n?void 0:n.call(i)}}_removeModuleBindings(t){return this._bindingDictionary.removeByCondition((e=>e.moduleId===t))}_deactivate(t,e){const i=Object.getPrototypeOf(e).constructor;try{const n=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i);if(Bt(n))return this._handleDeactivationError(n,i)}catch(t){if(t instanceof Error)throw new Error(_(i.name,t.message))}}_handleDeactivationError(t,e){return $(this,void 0,void 0,(function*(){try{yield t}catch(t){if(t instanceof Error)throw new Error(_(e.name,t.message))}}))}_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})}_get(t){const e=Object.assign(Object.assign({},t),{contextInterceptor:t=>t,targetType:Q.Variable});return this._planAndResolve()(e)}_getButThrowIfAsync(t){const e=this._get(t);if(St(e))throw new Error((t=>`You are attempting to construct '${t}' in a synchronous way\n but it has asynchronous dependencies.`)(t.serviceIdentifier));return e}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_planAndResolve(){return t=>{let e=Tt(this._metadataReader,this,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints);e=t.contextInterceptor(e);const i=function(t){return Dt(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(e);return i}}_deactivateIfSingleton(t){if(t.activated)return Bt(t.cache)?t.cache.then((e=>this._deactivate(t,e))):this._deactivate(t,t.cache)}_deactivateSingletons(t){for(const e of t){if(Bt(this._deactivateIfSingleton(e)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}}_propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,i)}_removeServiceFromDictionary(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(`Could not unbind serviceIdentifier: ${nt(t)}`)}}_bindingDeactivationAndPreDestroy(t,e,i){if("function"==typeof t.onDeactivation){const n=t.onDeactivation(e);if(Bt(n))return n.then((()=>this._preDestroy(i,e)))}return this._preDestroy(i,e)}_bindingDeactivationAndPreDestroyAsync(t,e,i){return $(this,void 0,void 0,(function*(){"function"==typeof t.onDeactivation&&(yield t.onDeactivation(e)),yield this._preDestroy(i,e)}))}}const Kt=($t=p,Zt="Cannot apply @postConstruct decorator multiple times in the same class",()=>(t,e)=>{const i=new C($t,e);if(M.hasOwnMetadata($t,t.constructor))throw new Error(Zt);M.defineMetadata($t,i,t.constructor)});var $t,Zt;const Jt=Symbol("ContributionProvider");class Qt{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 te(t,e){t(Jt).toDynamicValue((({container:t})=>new Qt(e,t))).inSingletonScope().whenTargetNamed(e)}function ee(t,e){t(Jt).toDynamicValue((({container:t})=>new Qt(e,t))).whenTargetNamed(e)}class ie{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 ne extends ie{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const re=Symbol.for("EnvContribution"),se=Symbol.for("VGlobal"),oe="browser";function ae(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(oe),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(oe),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv(oe),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv(oe),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv(oe),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv(oe),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new ne(["lastEnv","env","global"])},this.measureTextMethod="native"}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(oe),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(oe),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(oe),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(oe),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(oe),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(oe),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(oe),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(oe),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(oe),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(oe),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(oe),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(oe),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(oe),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(oe),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 this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}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)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=X([U(),q(0,I(Jt)),q(0,N(re)),K("design:paramtypes",[Object])],t.DefaultGlobal);var he={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),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=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 h,l,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(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}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 h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||r&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l: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}(he);var le=ae(he.exports),ce=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},ue=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||ce(t,"Boolean")},de=function(t){return"function"==typeof t},pe=function(t){return null==t},fe=function(t){return null!=t},ge=function(t){var e=W(t);return null!==t&&"object"===e||"function"===e},me=function(t){return void 0===t},ye=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=W(t);return e?"string"===i:"string"===i||ce(t,"String")},ve=function(t){return Array.isArray?Array.isArray(t):ce(t,"Array")},be=function(t){return ce(t,"Date")},xe=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=W(t);return e?"number"===i:"number"===i||ce(t,"Number")},Ae=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},Te=function(t){return ce(t,"RegExp")},Be=function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)},Se=function(t,e,i){for(var n=ye(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},we=Object.prototype.hasOwnProperty,_e=function(t,e){return null!=t&&we.call(t,e)};function Ce(t,e){if(!ve(t)||!ve(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var Pe=1e-10,Me=1e-10;function Ee(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pe,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Me)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var ke=function(t,e,i){return t<e?e:t>i?i:t},Re=1e-12,Oe=Math.PI,De=Oe/2,Ie=2*Oe,Le=2*Math.PI,Ue=Math.abs,Ne=Math.atan2,We=Math.cos,Fe=Math.max,je=Math.min,ze=Math.sin,Ge=Math.sqrt,He=Math.pow;function Ve(t){return t>1?0:t<-1?Oe:Math.acos(t)}function Ye(t){return t>=1?De:t<=-1?-De:Math.asin(t)}function Xe(t,e,i,n,r){var s,o;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 qe(t,e){return t[0]*e[1]-t[1]*e[0]}var Ke=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;F(this,t),this.x=0,this.y=0,this.x=e,this.y=i,this.x1=n,this.y1=r}return z(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(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}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return xe(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return xe(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}]),t}(),$e=function(){function t(){F(this,t)}return z(t,null,[{key:"distancePP",value:function(t,e){return Ge(He(t.x-e.x,2)+He(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return Ge(He(t-i,2)+He(e-n,2))}},{key:"distancePN",value:function(t,e,i){return Ge(He(e-t.x,2)+He(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new Ke((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}]),t}();function Ze(t,e,i){var n=e.x1,r=e.y1,s=e.x2,o=e.y2;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)}var Je=function(){function t(e){F(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return z(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var 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}},{key:"set",value:function(){var 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}},{key:"add",value:function(){var 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}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return ve(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}},{key:"round",value:function(){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}},{key:"translate",value:function(){var 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}},{key:"rotate",value:function(){var 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=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])}},{key:"scale",value:function(){var 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,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(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}},{key:"intersect",value:function(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}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var 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)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return Ze(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,s=this.x2,o=this.y2,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*r+l,h*n+a*r+c,a*n-h*o+l,h*n+a*o+c,a*s-h*r+l,h*s+a*r+c,a*s-h*o+l,h*s+a*o+c]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}]),t}(),Qe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&H(t,e)}(i,t);var e=Y(i);function i(){return F(this,i),e.apply(this,arguments)}return z(i)}(Je);var ti=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Ie;)t+=Ie;else if(t>0)for(;t>Ie;)t-=Ie;return t};function ei(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var ii=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;F(this,t),this.a=e,this.b=i,this.c=n,this.d=r,this.e=s,this.f=o}return z(t,[{key:"equalToMatrix",value:function(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)}},{key:"equalTo",value:function(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)}},{key:"setValue",value:function(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}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.e,o=this.f,a=new t,h=e*r-i*n;return a.a=r/h,a.b=-i/h,a.c=-n/h,a.d=e/h,a.e=(n*o-r*s)/h,a.f=-(e*o-i*s)/h,a}},{key:"rotate",value:function(t){var 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}},{key:"rotateByCenter",value:function(t,e,i){var 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,h=r*this.a+n*this.b,l=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=h,this.c=l,this.d=c,this.e=u,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}},{key:"multiply",value:function(t,e,i,n,r,s){var o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,u=a*t+l*e,d=o*i+h*n,p=a*i+l*n,f=o*r+h*s+this.e,g=a*r+l*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}},{key:"interpolate",value:function(e,i){var n=new t;return n.a=this.a+(e.a-this.a)*i,n.b=this.b+(e.b-this.b)*i,n.c=this.c+(e.c-this.c)*i,n.d=this.d+(e.d-this.d)*i,n.e=this.e+(e.e-this.e)*i,n.f=this.f+(e.f-this.f)*i,n}},{key:"transformPoint",value:function(t,e){var i=this.a,n=this.b,r=this.c,s=this.d,o=this.e,a=this.f,h=i*s-n*r,l=s/h,c=-n/h,u=-r/h,d=i/h,p=(r*a-s*o)/h,f=-(i*a-n*o)/h,g=t.x,m=t.y;e.x=g*l+m*u+p,e.y=g*c+m*d+f}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var 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){var 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){var a=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}]),t}();function ni(t,e,i){e/=100,i/=100;var n=(1-Math.abs(2*i-1))*e,r=n*(1-Math.abs(t/60%2-1)),s=i-n/2,o=0,a=0,h=0;return 0<=t&&t<60?(o=n,a=r,h=0):60<=t&&t<120?(o=r,a=n,h=0):120<=t&&t<180?(o=0,a=n,h=r):180<=t&&t<240?(o=0,a=r,h=n):240<=t&&t<300?(o=r,a=0,h=n):300<=t&&t<360&&(o=n,a=0,h=r),{r:o=Math.round(255*(o+s)),g:a=Math.round(255*(a+s)),b:h=Math.round(255*(h+s))}}function ri(t,e,i){t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),s=r-n,o=0,a=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))<0&&(o+=360),a=(r+n)/2,{h:o,s:+(100*(0===s?0:s/(1-Math.abs(2*a-1)))).toFixed(1),l:a=+(100*a).toFixed(1)}}var si=/^#([0-9a-f]{3,8})$/,oi={transparent:4294967040},ai={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 hi(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function li(t){return xe(t)?new pi(t>>16,t>>8&255,255&t,1):ve(t)?new pi(t[0],t[1],t[2]):new pi(255,255,255)}function ci(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ui(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var di=function(){function t(e){F(this,t);var i=t.parseColorString(e);i?this.color=i:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new pi(255,255,255))}return z(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"brighter",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}},{key:"add",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r+=Math.min(255,i+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,r+t.color.b),this}},{key:"sub",value:function(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}},{key:"multiply",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(i*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t.color.b))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){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)}},{key:"setHsl",value:function(t,e,i){var n=this.color.opacity,r=ri(this.color.r,this.color.g,this.color.b),s=ni(pe(t)?r.h:ke(t,0,360),pe(e)?r.s:e>=0&&e<=1?100*e:e,pe(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new pi(s.r,s.g,s.b,n),this}},{key:"setRGB",value:function(t,e,i){return!pe(t)&&(this.color.r=t),!pe(e)&&(this.color.g=e),!pe(i)&&(this.color.b=i),this}},{key:"setHex",value:function(t){var e="".concat(t).trim().toLowerCase(),i=si.exec(e),n=parseInt(i[1],16),r=i[1].length;return 3===r?new pi((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):6===r?li(n):8===r?new pi(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):this}},{key:"setColorName",value:function(t){var e=ai[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"setScalar",value:function(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}},{key:"clone",value:function(){return new t(this.color.toString())}},{key:"copyGammaToLinear",value:function(t){var 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}},{key:"copyLinearToGamma",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,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}},{key:"convertGammaToLinear",value:function(t){return this.copyGammaToLinear(this,t),this}},{key:"convertLinearToGamma",value:function(t){return this.copyLinearToGamma(this,t),this}},{key:"copySRGBToLinear",value:function(t){return this.color.r=ci(t.color.r),this.color.g=ci(t.color.g),this.color.b=ci(t.color.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.color.r=ui(t.color.r),this.color.g=ui(t.color.g),this.color.b=ui(t.color.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}}],[{key:"Brighter",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===i?e:new t(e).brighter(i).toRGBA()}},{key:"SetOpacity",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===i?e:new t(e).setOpacity(i).toRGBA()}},{key:"getColorBrightness",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",n=e instanceof t?e:new t(e);switch(i){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3()}}},{key:"parseColorString",value:function(t){if(fe(oi[t]))return function(t){return xe(t)?new pi(t>>>24,t>>>16&255,t>>>8&255,255&t):ve(t)?new pi(t[0],t[1],t[2],t[3]):new pi(255,255,255,1)}(oi[t]);if(fe(ai[t]))return li(ai[t]);var e="".concat(t).trim().toLowerCase(),i=si.exec(e);if(i){var n=parseInt(i[1],16),r=i[1].length;return 3===r?new pi((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):6===r?li(n):8===r?new pi(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var s=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new pi(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10),parseFloat(s[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var o=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),a=ni(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10));return new pi(a.r,a.g,a.b,parseFloat(o[3]))}}}]),t}(),pi=function(){function t(e,i,n,r){F(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),fe(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}return z(t,[{key:"formatHex",value:function(){return"#".concat(hi(this.r)+hi(this.g)+hi(this.b)+(1===this.opacity?"":hi(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=ri(this.r,this.g,this.b),i=e.h,n=e.s,r=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(i,",").concat(n,"%,").concat(r,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}]),t}();var fi,gi,mi,yi,vi,bi,xi,Ai,Ti,Bi=Object.freeze({__proto__:null,Color:di,DEFAULT_COLORS:ai,RGB:pi,hexToRgb:function(t){for(var e="",i="",n="",r="#"===t[0]?1:0,s=r;s<t.length;s++)"#"!==t[s]&&(s<r+2?e+=t[s]:s<r+4?i+=t[s]:s<r+6&&(n+=t[s]));return[parseInt(e,16),parseInt(i,16),parseInt(n,16)]},hslToRgb:ni,interpolateRgb:function(t,e){var i=t.r,n=e.r,r=t.g,s=e.g,o=t.b,a=e.b,h=t.opacity,l=e.opacity;return function(t){var e=Math.round(i*(1-t)+n*t),c=Math.round(r*(1-t)+s*t),u=Math.round(o*(1-t)+a*t);return new pi(e,c,u,h*(1-t)+l*t)}},rgbToHex:function(t,e,i){return Number((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},rgbToHsl:ri});function Si(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function wi(t,e,i,n){if(!function(t,e,i,n){var r,s=t[0],o=e[0],a=i[0],h=n[0];return o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),!(o<a||h<s||(s=t[1],o=e[1],a=i[1],h=n[1],o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),o<a||h<s))}(t,e,i,n))return!1;var r,s,o=[0,0],a=[0,0],h=[0,0];if(Si(o,e,t),Si(a,n,i),Ue((r=o)[0]-(s=a)[0])+Ue(r[1]-s[1])<1e-12)return!0;Si(h,i,t);var l=qe(h,a)/qe(o,a);return l>=0&&l<=1&&[t[0]+o[0]*l,t[1]+o[1]*l]}function _i(t,e,i){var n,r,s,o;return!(t&&e&&(i?(fi=t.x1,gi=t.x2,mi=t.y1,yi=t.y2,vi=e.x1,bi=e.x2,xi=e.y1,Ai=e.y2,fi>gi&&(n=[gi,fi],fi=n[0],gi=n[1]),mi>yi&&(r=[yi,mi],mi=r[0],yi=r[1]),vi>bi&&(s=[bi,vi],vi=s[0],bi=s[1]),xi>Ai&&(o=[Ai,xi],xi=o[0],Ai=o[1]),fi>bi||gi<vi||mi>Ai||yi<xi):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"}(Ti||(Ti={}));var Ci=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),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"};var Pi=function(){function t(e,i){F(this,t),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=e,this._userSpec=null!=i?i:{},this.textSpec=this._initSpec(),fe(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=fe(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return z(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(pe(this._canvas)&&(fe(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),pe(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&fe(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),pe(this._context)&&fe(this._canvas)){var t=this._canvas.getContext("2d");fe(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.fontStyle,n=void 0===i?e.fontStyle:i,r=t.fontVariant,s=void 0===r?e.fontVariant:r,o=t.fontWeight,a=void 0===o?e.fontWeight:o,h=t.fontSize,l=void 0===h?e.fontSize:h,c=t.fontFamily;return(n?n+" ":"")+(s?s+" ":"")+(a?a+" ":"")+l+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!pe(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,s=this._userSpec,o=s.fontStyle,a=void 0===o?r.fontStyle:o,h=s.fontVariant,l=void 0===h?r.fontVariant:h,c=s.fontWeight,u=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,d=s.fontSize,p=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,f=s.fontFamily,g=void 0===f?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":f,m=s.align,y=s.textAlign,v=void 0===y?null!=m?m:"center":y,b=s.baseline,x=s.textBaseline,A=void 0===x?null!=b?b:"middle":x,T=s.ellipsis,B=s.limit,S=s.lineHeight;return{fontStyle:a,fontVariant:l,fontFamily:g,fontSize:p,fontWeight:u,textAlign:v,textBaseline:A,ellipsis:T,limit:B,lineHeight:void 0===S?p:S}}},{key:"measure",value:function(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)}}},{key:"fullMeasure",value:function(t){if(pe(t))return{width:0,height:0};if(pe(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,s=i.fontWeight,o=i.textAlign,a=i.textBaseline,h=i.ellipsis,l=i.limit,c=i.lineHeight;try{var u=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:s,textAlign:o,textBaseline:a,ellipsis:!!h,maxLineWidth:l||1/0,lineHeight:c});e={width:u.width(),height:u.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),i=this.textSpec,n=i.fontSize,r=i.lineHeight;return{width:e.width,height:null!=r?r:n}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],s=this._measureSpecialChar(r);pe(s)&&t.NUMBERS_CHAR_SET.includes(r)&&(s=this._measureNumberChar()),pe(s)&&["F","W"].includes(Ci(r))&&(s=this._measureFullSizeChar()),pe(s)&&(s=this._measureLetterChar()),i.width+=s.width,i.height=Math.max(i.height,s.height)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},i=this.textSpec,n=i.fontSize,r=i.lineHeight,s=0;s<t.length;s++){var o=t[s],a=["F","W"].includes(Ci(o))?1:.53;e.width+=a*n}return e.height=null!=r?r:n,e}},{key:"_measureReduce",value:function(t,e){var i=this.textSpec,n=i.fontSize,r=i.lineHeight,s={width:0,height:0};if(pe(t))return s;if(ve(t)){var o=t.filter(fe).map((function(t){return t.toString()}));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:o.length*((null!=r?r:n)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(pe(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return pe(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(pe(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return fe(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){fe(this._canvas)&&(this._canvas=null),fe(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();Pi.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Pi.NUMBERS_CHAR_SET="0123456789",Pi.FULL_SIZE_CHAR="字";const Mi=Ie-1e-8;class Ei{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Mi)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=Ie)<0&&(n+=Ie),(r%=Ie)<0&&(r+=Ie),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=Ie,o=n-n%De,a=0;a<4&&o>r;++a,o-=De)f(o);else for(o=n-n%De+De,a=0;a<4&&o<r;++a,o+=De)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(...t){}}class ki{constructor(){this.curves=[],this.bounds=new Qe}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Ri=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Oi={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},Di={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Ii,Li,Ui,Ni,Wi,Fi;function ji(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(Ii=e[t],Li=Ii.slice(1),Ui=Ii[0],i=[Ui],n=Li.match(Ri),null!==n){for(let t=0,e=n.length;t<e;t++)Ni=n[t],Wi=parseFloat(Ni),Number.isNaN(Wi)||i.push(Wi);if(Fi=Oi[Ui],i.length-1>Fi){let t;for(let e=1,n=i.length;e<n;e+=Fi){t=[Ui];for(let n=e,r=e+Fi;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var zi,Gi,Hi,Vi,Yi,Xi,qi,Ki;function $i(t,e,i,n,r,s,o,a,h){const l=o*(Math.PI/180);const c=Math.sin(l),u=Math.cos(l),d=u*(a-t)*.5+c*(h-e)*.5,p=u*(h-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,m=c/i,y=-c/n,v=u/n,b=g*a+m*h,x=y*a+v*h,A=g*t+m*e,T=y*t+v*e;let B=1/((A-b)*(A-b)+(T-x)*(T-x))-.25;B<0&&(B=0);let S=Math.sqrt(B);s===r&&(S=-S);const w=.5*(b+A)-S*(T-x),_=.5*(x+T)+S*(A-b),C=Math.atan2(x-_,b-w);let P=Math.atan2(T-_,A-w)-C;P<0&&1===s?P+=Ie:P>0&&0===s&&(P-=Ie);const M=Math.ceil(Math.abs(P/(De+.001))),E=[];for(let t=0;t<M;++t){const e=C+t*P/M,r=C+(t+1)*P/M;E[t]=[w,_,e,r,i,n,c,u]}return E}function Zi(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=h*s,c=-a*o,u=a*s,d=h*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),m=Math.sin(r),y=.5*(r-n),v=Math.sin(.5*y),b=8/3*v*v/Math.sin(y),x=e+p-b*f,A=i+f+b*p,T=e+g,B=i+m,S=T+b*m,w=B-b*g;return[l*x+c*A,u*x+d*A,l*S+c*w,u*S+d*w,l*T+c*B,u*T+d*B]}function Ji(t,e,i,n){const r=$i(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=Zi(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(zi=t.UpdateTag||(t.UpdateTag={}))[zi.NONE=0]="NONE",zi[zi.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",zi[zi.UPDATE_SHAPE=2]="UPDATE_SHAPE",zi[zi.CLEAR_SHAPE=253]="CLEAR_SHAPE",zi[zi.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",zi[zi.INIT=179]="INIT",zi[zi.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",zi[zi.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",zi[zi.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",zi[zi.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",zi[zi.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",zi[zi.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",zi[zi.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",zi[zi.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(Gi=t.IContainPointMode||(t.IContainPointMode={}))[Gi.GLOBAL=1]="GLOBAL",Gi[Gi.LOCAL=16]="LOCAL",Gi[Gi.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Gi[Gi.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Hi=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Hi.INIT=0]="INIT",Hi[Hi.DEFAULT=1]="DEFAULT",Hi[Hi.STATE=2]="STATE",Hi[Hi.ANIMATE_BIND=10]="ANIMATE_BIND",Hi[Hi.ANIMATE_PLAY=11]="ANIMATE_PLAY",Hi[Hi.ANIMATE_START=12]="ANIMATE_START",Hi[Hi.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Hi[Hi.ANIMATE_END=14]="ANIMATE_END",Hi[Hi.TRANSLATE=20]="TRANSLATE",Hi[Hi.TRANSLATE_TO=21]="TRANSLATE_TO",Hi[Hi.SCALE=22]="SCALE",Hi[Hi.SCALE_TO=23]="SCALE_TO",Hi[Hi.ROTATE=24]="ROTATE",Hi[Hi.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Vi=t.AnimateStatus||(t.AnimateStatus={}))[Vi.INITIAL=0]="INITIAL",Vi[Vi.RUNNING=1]="RUNNING",Vi[Vi.PAUSED=2]="PAUSED",Vi[Vi.END=3]="END",t.AnimateMode=void 0,(Yi=t.AnimateMode||(t.AnimateMode={}))[Yi.NORMAL=0]="NORMAL",Yi[Yi.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Xi=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Xi.from="from",Xi.to="to",Xi.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,(qi=t.CurveTypeEnum||(t.CurveTypeEnum={}))[qi.CubicBezierCurve=0]="CubicBezierCurve",qi[qi.QuadraticBezierCurve=1]="QuadraticBezierCurve",qi[qi.ArcCurve=2]="ArcCurve",qi[qi.LineCurve=3]="LineCurve",qi[qi.EllipseCurve=4]="EllipseCurve",qi[qi.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Ki=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Ki.beforeFillStroke=0]="beforeFillStroke",Ki[Ki.afterFillStroke=1]="afterFillStroke";const Qi=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),h=4*Math.tan(a/4)/3,l=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,m=d*s+n,y=p*o+r,v=s*h*l,b=o*h*l;t.push(f-v*u,g+b*c,m+v*p,y-b*d,m,y)},tn=[(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 en(t,e,i=0,n=0,r=1,s=1,o){for(let a=0;a<t.length;a++){const h=t[a];tn[h[0]](h,e,i,n,r,s,o)}}class nn{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function rn(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],h=e[(r+1)%n];i+=$e.distanceNN(s,o,a,h)}return i/2}function sn(t,e,i,n,r){return rn([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function on(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 an(t,e,i,n,r){const s=on(t.x,e.x,i.x,n.x,r),o=on(t.y,e.y,i.y,n.y,r);return new Ke(s,o)}function hn(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=an(i,n,r,s,e),a=$e.pointAtPP(i,n,e),h=$e.pointAtPP(n,r,e),l=$e.pointAtPP(r,s,e),c=$e.pointAtPP(a,h,e),u=$e.pointAtPP(h,l,e);return[new ln(i,a,c,o),new ln(o,u,l,s)]}class ln extends nn{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 an(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?sn(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Ue(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Ue(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Fe(t-.01,0),i=je(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return Ne(r.y-n.y,r.x-n.x)}}function cn(t,e){const{p0:i,p1:n}=t,r=$e.pointAtPP(i,n,e);return[new un(i,r),new un(r,n)]}class un extends nn{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return $e.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=Ne(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()?$e.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Ue(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Ue(this.p0.y-this.p1.y):0}}class dn{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 h=new ln(new Ke(this._lastX,this._lastY),new Ke(t,e),new Ke(i,n),new Ke(r,s));h.originP1=this._lastOriginP,h.originP2=a,h.defined=o,this.curves.push(h),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 un(new Ke(this._lastX,this._lastY),new Ke(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 Ue(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 Ue(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class pn extends dn{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 fn(t,e,i=1){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}class gn{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 mn(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new dn("linear",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return yn(new gn(s,r),e),s}function yn(t,e){return fn(t,e,1)}function vn(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 bn{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(){if(2===this._point)vn(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:vn(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 xn(t,e){return fn(t,e,2)}function An(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mn(e,i);const s=new dn("basis",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return xn(new bn(s,r),e),s}function Tn(t){return t<0?-1:1}function Bn(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(Tn(s)+Tn(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Sn(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function wn(t,e,i,n,r){const s=t._x0,o=t._y0,a=t._x1,h=t._y1,l=(a-s)/3;t.context.bezierCurveTo(s+l,o+l*e,a-l,h-l*i,a,h,n,t.lastPoint1)}class _n{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._lastDefined2,this.lastPoint1);break;case 3:wn(this,this._t0,Sn(this,this._t0),!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;if(i!==this._x1||n!==this._y1){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,wn(this,Sn(this,e=Bn(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:wn(this,this._t0,e=Bn(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 Cn extends _n{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Pn(t,e){return fn(t,e,2)}function Mn(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mn(e,i);const s=new dn("monotoneX",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Pn(new _n(s,r),e),s}function En(t,e){return fn(t,e,2)}function kn(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mn(e,i);const s=new pn("monotoneY",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return En(new Cn(s,r),e),s}let Rn=class{constructor(t,e=.5,i){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 On(e,i,n={}){const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new dn("step",null!=r?r:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Dn(new Rn(o,i,s),e),o}function Dn(t,e){return fn(t,e,1)}class In{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.context.closePath()}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 Ln(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new dn("linear",null!=n?n:Ue(e[e.length-1].x-e[0].x)>Ue(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Un(new In(s,r),e),s}function Un(t,e){return fn(t,e,1)}function Nn(t,e,i){switch(e){case"linear":default:return mn(t,i);case"basis":return An(t,i);case"monotoneX":return Mn(t,i);case"monotoneY":return kn(t,i);case"step":return On(t,.5,i);case"stepBefore":return On(t,0,i);case"stepAfter":return On(t,1,i);case"linearClosed":return Ln(t,i)}}class Wn extends ki{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Ei(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Di.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Di.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Di.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([Di.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([Di.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([Di.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([Di.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([Di.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Di.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}toString(){if(!this.toStringCbList){const t=[];t[Di.M]=t=>`M${t[1]} ${t[2]}`,t[Di.L]=t=>`L${t[1]} ${t[2]}`,t[Di.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Di.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Di.A]=t=>{const e=[];Qi(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[Di.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=ji(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=Nn(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[Di.M]=this.moveToTransform,t[Di.L]=this.lineToTransform,t[Di.Q]=this.quadraticCurveToTransform,t[Di.C]=this.bezierCurveToTransform,t[Di.AT]=this.arcToTransform,t[Di.E]=this.ellipseTransform,t[Di.R]=this.rectTransform,t[Di.A]=this.arcTransform,t[Di.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,e=0,i=0,n=1,r=1){let s,o,a,h,l,c=null,u=0,d=0,p=0,f=0;for(let g=0,m=t.length;g<m;++g){switch(s=t[g],1===n&&1===r||(s=jn(s,n,r)),s[0]){case"l":u+=s[1],d+=s[2],this.lineTo(u+e,d+i);break;case"L":u=s[1],d=s[2],this.lineTo(u+e,d+i);break;case"h":u+=s[1],this.lineTo(u+e,d+i);break;case"H":u=s[1],this.lineTo(u+e,d+i);break;case"v":d+=s[1],this.lineTo(u+e,d+i);break;case"V":d=s[1],this.lineTo(u+e,d+i);break;case"m":u+=s[1],d+=s[2],this.moveTo(u+e,d+i);break;case"M":u=s[1],d=s[2],this.moveTo(u+e,d+i);break;case"c":o=u+s[5],a=d+s[6],p=u+s[3],f=d+s[4],this.bezierCurveTo(u+s[1]+e,d+s[2]+i,p+e,f+i,o+e,a+i),u=o,d=a;break;case"C":u=s[5],d=s[6],p=s[3],f=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,p+e,f+i,u+e,d+i);break;case"s":o=u+s[3],a=d+s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,u+s[1]+e,d+s[2]+i,o+e,a+i),p=u+s[1],f=d+s[2],u=o,d=a;break;case"S":o=s[3],a=s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"q":o=u+s[3],a=d+s[4],p=u+s[1],f=d+s[2],this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"Q":o=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"t":o=u+s[1],a=d+s[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-h,f=2*d-l):"q"===c[0]&&(p=2*u-p,f=2*d-f),h=p,l=f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a,p=u+s[1],f=d+s[2];break;case"T":o=s[1],a=s[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"a":Ji(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+e,s[7]+d+i]),u+=s[6],d+=s[7];break;case"A":Ji(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),u=s[6],d=s[7];break;case"z":case"Z":this.closePath()}c=s}}_runCommandList(t,e=0,i=0,n=1,r=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 Di.L:this.lineToTransform(o,e,i,n,r);break;case Di.M:this.moveToTransform(o,e,i,n,r);break;case Di.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Di.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Di.A:this.arcToTransform(o,e,i,n,r);break;case Di.E:this.ellipseTransform(o,e,i,n,r);break;case Di.R:this.rectTransform(o,e,i,n,r);break;case Di.AT:this.arcToTransform(o,e,i,n,r);break;case Di.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),en(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 Ue(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 Ue(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 Fn=["l",0,0,0,0,0,0,0];function jn(t,e,i){const n=Fn[0]=t[0];if("a"===n||"A"===n)Fn[1]=e*t[1],Fn[2]=i*t[2],Fn[3]=t[3],Fn[4]=t[4],Fn[5]=t[5],Fn[6]=e*t[6],Fn[7]=i*t[7];else if("h"===n||"H"===n)Fn[1]=e*t[1];else if("v"===n||"V"===n)Fn[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)Fn[n]=(n%2==1?e:i)*t[n];return Fn}const zn={alignSelf:"auto"},Gn={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 ii},Hn={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Vn={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Yn=Object.assign({outerBorder:Object.assign(Object.assign({},Vn),{distance:0}),innerBorder:Object.assign(Object.assign({},Vn),{distance:0})},Vn),Xn={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},qn=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,html:null},Hn),Yn),zn),Kn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},$n={_debug_bounds:!1},Zn=Object.assign(Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,interactive:!1},$n),qn),Gn);const Jn=Object.assign(Object.assign({},Zn),{startAngle:0,endAngle:Le,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Qn=Object.assign(Object.assign(Object.assign({},Zn),Kn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),tr=Object.assign(Object.assign({},Zn),{radius:1,startAngle:0,endAngle:Le}),er=Object.assign(Object.assign({},Zn),{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"}),ir=Object.assign(Object.assign({},Zn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),nr=Object.assign(Object.assign(Object.assign({},Zn),Kn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),rr=Object.assign(Object.assign({},Zn),{path:new Wn,customPath:()=>{console.warn("空函数")}}),sr=Object.assign(Object.assign({},Zn),{points:[],cornerRadius:0,closePath:!0}),or=Object.assign(Object.assign({},Zn),{width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0}),ar=Object.assign(Object.assign({},Zn),{width:0,height:0,cornerRadius:0,length:0}),hr=Object.assign(Object.assign({},Zn),{symbolType:"circle",size:10,keepDirIn3d:!0}),lr=Object.assign(Object.assign(Object.assign({},Zn),Xn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),cr=Object.assign(Object.assign({},Zn),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),ur=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Zn),{fill:!0,cornerRadius:0}),dr=Object.assign(Object.assign({},ur),{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 pr{}const fr=new pr,gr={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"}},mr=!0,yr=!1,vr=/\w|\(|\)|-/,br=/[.?!,;:/,。?!、;:]/,xr=/\S/;function Ar(t,e,i,n,r){if(!e||e<=0)return 0;const s=fr.graphicUtil.textMeasure;let o=n,a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width);for(;h>e||c<=e;){if(h>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width)}return r&&(o=Tr(t,o)),o}function Tr(t,e){let i=e;for(;vr.test(t[i-1])&&vr.test(t[i])||br.test(t[i]);)if(i--,i<=0)return e;return i}function Br(t,e){const i=fr.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}let Sr=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){if(!this.context)return this.estimate(t,e).width;this.context.setTextStyleWithoutAlignBaseline(e);return this.context.measureText(t).width}estimate(t,{fontSize:e=lr.fontSize}){let i=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:n++;return{width:~~(.8*i*e+n*e),height:e}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Xn.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:Xn.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);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=Tr(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);if(n&&s.str!==t){const i=Tr(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){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipText(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 h=this.measureTextWidth(n,e),h>=i?{str:o,width:a}:this._clipText(t,e,i,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,i,n,r){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,i,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const o=this.measureTextWidth(n,e);if(o>i)return s;i-=o;const a=this.clipTextVertical(t,e,i,r);return a.width+=o,a.verticalList.push({text:n,direction:1,width:o}),a}clipTextWithSuffix(t,e,i,n,r){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};const o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;const a=this._clipText(t,e,i,0,t.length-1);if(r&&a.str!==t){const i=Tr(t,a.str.length);i!==a.str.length&&(a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a.str+=n,a.width+=o,a}};Sr=X([U()],Sr);const wr=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=class extends Sr{},t.DefaultTextMeasureContribution=X([U()],t.DefaultTextMeasureContribution);const _r=new qt,Cr=Symbol.for("CanvasFactory"),Pr=Symbol.for("Context2dFactory");function Mr(t){return _r.getNamed(Cr,fr.global.env)(t)}const Er=1e-4,kr=Math.sqrt(3),Rr=1/3;function Or(t){return t>-Xr&&t<Xr}function Dr(t){return t>Xr||t<-Xr}const Ir=[0,0],Lr=[0,0],Ur=[0,0];function Nr(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Wr(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Fr(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 jr(t){return(t%=Le)<0&&(t+=Le),t}function zr(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 h=o*(i-t)+t;return h===r?1/0:h>r?a:0}function Gr(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;if(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||a>t+l&&a>i+l&&a>r+l||a<t-l&&a<i-l&&a<r-l)return!1;const c=function(t,e,i,n,r,s,o,a,h){let l=0,c=.005,u=1/0;Ir[0]=o,Ir[1]=a;for(let o=0;o<1;o+=.05){Lr[0]=Wr(t,i,r,o),Lr[1]=Wr(e,n,s,o);const a=Nr(Ir,Lr);a<u&&(l=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<Er);o++){const o=l-c,a=l+c;Lr[0]=Wr(t,i,r,o),Lr[1]=Wr(e,n,s,o);const h=Nr(Lr,Ir);if(o>=0&&h<u)l=o,u=h;else{Ur[0]=Wr(t,i,r,a),Ur[1]=Wr(e,n,s,a);const o=Nr(Ur,Ir);a<=1&&o<u?(l=a,u=o):c*=.5}}return h&&(h[0]=Wr(t,i,r,l),h[1]=Wr(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,a,h,null);return c<=l/2}function Hr(t,e,i,n,r,s,o,a,h,l,c){if(0===h)return!1;const u=h;if(c>e+u&&c>n+u&&c>s+u&&c>a+u||c<e-u&&c<n-u&&c<s-u&&c<a-u||l>t+u&&l>i+u&&l>r+u&&l>o+u||l<t-u&&l<i-u&&l<r-u&&l<o-u)return!1;const d=function(t,e,i,n,r,s,o,a,h,l,c){let u,d,p,f,g=0,m=.005,y=1/0;Ir[0]=h,Ir[1]=l;for(let h=0;h<1;h+=.05)Lr[0]=Fr(t,i,r,o,h),Lr[1]=Fr(e,n,s,a,h),p=Nr(Ir,Lr),p<y&&(g=h,y=p);y=1/0;for(let h=0;h<32&&!(m<Er);h++)u=g-m,d=g+m,Lr[0]=Fr(t,i,r,o,u),Lr[1]=Fr(e,n,s,a,u),p=Nr(Lr,Ir),u>=0&&p<y?(g=u,y=p):(Ur[0]=Fr(t,i,r,o,d),Ur[1]=Fr(e,n,s,a,d),f=Nr(Ur,Ir),d<=1&&f<y?(g=d,y=f):m*=.5);return c&&(c[0]=Fr(t,i,r,o,g),c[1]=Fr(e,n,s,a,g)),Math.sqrt(y)}(t,e,i,n,r,s,o,a,l,c,null);return d<=u/2}function Vr(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;a-=t,h-=e;const c=Math.sqrt(a*a+h*h);if(c-l>i||c+l<i)return!1;if(Math.abs(n-r)%Le<1e-4)return!0;if(s){const t=n;n=jr(r),r=jr(t)}else n=jr(n),r=jr(r);n>r&&(r+=Le);let u=Math.atan2(h,a);return u<0&&(u+=Le),u>=n&&u<=r||u+Le>=n&&u+Le<=r}function Yr(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,h=r/2;let l=0,c=t;if(o>e+h&&o>n+h||o<e-h&&o<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=a/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-o+c;return u*u/(l*l+1)<=a/2*a/2}const Xr=1e-4;function qr(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 h=0;if(Or(o)){if(Dr(s)){const t=-a/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*o*a;if(Or(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[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const Kr=[-1,-1,-1],$r=[-1,-1];function Zr(){const t=$r[0];$r[0]=$r[1],$r[1]=t}function Jr(t,e,i,n,r,s,o,a,h,l){if(l>e&&l>n&&l>s&&l>a||l<e&&l<n&&l<s&&l<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),h=3*(e-t),l=t-r,c=a*a-3*o*h,u=a*h-9*o*l,d=h*h-3*a*l;let p=0;if(Or(c)&&Or(u))if(Or(a))s[0]=0;else{const t=-h/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Or(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,Rr):Math.pow(i,Rr),n=n<0?-Math.pow(-n,Rr):Math.pow(n,Rr);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),h=(-a+i*(n+kr*Math.sin(e)))/(3*o),l=(-a+i*(n-kr*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),l>=0&&l<=1&&(s[p++]=l)}}return p}(e,n,s,a,l,Kr);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let l=0;l<c;l++){const c=Kr[l],g=0===c||1===c?.5:1;Fr(t,i,r,o,c)<h||(d<0&&(d=qr(e,n,s,a,$r),$r[1]<$r[0]&&d>1&&Zr(),p=Fr(e,n,s,a,$r[0]),d>1&&(f=Fr(e,n,s,a,$r[1]))),2===d?c<$r[0]?u+=p<e?g:-g:c<$r[1]?u+=f<p?g:-g:u+=a<f?g:-g:c<$r[0]?u+=p<e?g:-g:u+=a<p?g:-g)}return u}function Qr(t,e,i,n,r,s,o,a){if(a>e&&a>n&&a>s||a<e&&a<n&&a<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,o=2*(e-t),a=t-n;let h=0;if(Or(s)){if(Dr(o)){const t=-a/o;t>=0&&t<=1&&(r[h++]=t)}}else{const t=o*o-4*s*a;if(Or(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[h++]=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[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,a,Kr);if(0===h)return 0;const l=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(l>=0&&l<=1){let a=0;const c=Wr(e,n,s,l);for(let n=0;n<h;n++){const h=0===Kr[n]||1===Kr[n]?.5:1;Wr(t,i,r,Kr[n])<o||(Kr[n]<l?a+=c<e?h:-h:a+=s<c?h:-h)}return a}const c=0===Kr[0]||1===Kr[0]?.5:1;return Wr(t,i,r,Kr[0])<o?0:s<e?c:-c}function ts(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const h=Math.sqrt(i*i-a*a);Kr[0]=-h,Kr[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=Le-1e-4){n=0,r=Le;const e=s?1:-1;return o>=Kr[0]+t&&o<=Kr[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=Le,r+=Le);let c=0;for(let e=0;e<2;e++){const i=Kr[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=Le+t),(t>=n&&t<=r||t+Le>=n&&t+Le<=r)&&(t>Oe/2&&t<1.5*Oe&&(e=-e),c+=e)}}return c}function es(t){return Math.round(t/Oe*1e8)/1e8%2*Oe}function is(t,e){let i=es(t[0]);i<0&&(i+=Le);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=Le?r=i+Le:e&&i-r>=Le?r=i-Le:!e&&i>r?r=i+(Le-es(i-r)):e&&i<r&&(r=i-(Le-es(r-i))),t[0]=i,t[1]=r}const ns=[0,0];function rs(t,e,i,n,r){const s=t,o=t.length;let a,h,l=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]===Di.M&&t>1&&(i||(l+=zr(c,u,d,p,n,r))),f&&(c=o[1],u=o[2],d=c,p=u);const g=o[0],m=o[1],y=o[2],v=o[3],b=o[4],x=o[5],A=o[6];let T=b,B=x;ns[0]=T,ns[1]=B,is(ns,Boolean(o[6])),T=ns[0],B=ns[1];const S=T,w=B-T,_=!!(1-(o[6]?0:1)),C=(n-m)*v/v+m;switch(g){case Di.M:d=m,p=y,c=d,u=p;break;case Di.L:if(i){if(Yr(c,u,m,y,e,n,r))return!0}else l+=zr(c,u,m,y,n,r)||0;c=m,u=y;break;case Di.C:if(i){if(Hr(c,u,m,y,v,b,x,A,e,n,r))return!0}else l+=Jr(c,u,m,y,v,b,x,A,n,r)||0;c=x,u=A;break;case Di.Q:if(i){if(Gr(c,u,m,y,v,b,e,n,r))return!0}else l+=Qr(c,u,m,y,v,b,n,r)||0;c=v,u=b;break;case Di.A:if(a=Math.cos(S)*v+m,h=Math.sin(S)*v+y,f?(d=a,p=h):l+=zr(c,u,a,h,n,r),i){if(Vr(m,y,v,S,S+w,_,e,C,r))return!0}else l+=ts(m,y,v,S,S+w,_,C,r);c=Math.cos(S+w)*v+m,u=Math.sin(S+w)*v+y;break;case Di.R:if(d=c=m,p=u=y,a=d+v,h=p+b,i){if(Yr(d,p,a,p,e,n,r)||Yr(a,p,a,h,e,n,r)||Yr(a,h,d,h,e,n,r)||Yr(d,h,d,p,e,n,r))return!0}else l+=zr(a,p,a,h,n,r),l+=zr(d,h,d,p,n,r);break;case Di.Z:if(i){if(Yr(c,u,d,p,e,n,r))return!0}else l+=zr(c,u,d,p,n,r);c=d,u=p}}var f,g;return i||(f=u,g=p,Math.abs(f-g)<Xr)||(l+=zr(c,u,d,p,n,r)||0),0!==l}var ss;t.DefaultGraphicUtil=class{constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,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){if(this.configured)return;const i=Mr({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=i,this.context=i.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="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:Xn.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Pi(Object.assign({defaultFontParams:{fontFamily:Xn.fontFamily,fontSize:Xn.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Pi.ALPHABET_CHAR_SET+Pi.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}},t.DefaultGraphicUtil=X([U(),q(0,I(Jt)),q(0,N(wr)),q(1,I(se)),K("design:paramtypes",[Object,Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(ss||(ss={}));const os=new ii;t.DefaultTransformUtil=class{constructor(){this.matrix=new ii}init(t){return this.mode=ss.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=ss.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(os.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(os.a,os.b,os.c,os.d,os.e,os.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(os.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(os.a,os.b,os.c,os.d,os.e,os.f),this}scale(t,e,i){return this.mode===ss.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===ss.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return os.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(os.a,os.b,os.c,os.d,os.e,os.f),this}translate(t,e){return this.mode===ss.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===ss.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=X([U(),K("design:paramtypes",[])],t.DefaultTransformUtil);const as={arc:Jn,area:Qn,circle:tr,line:nr,path:rr,symbol:hr,text:lr,rect:or,rect3d:ar,polygon:sr,richtext:cr,richtextIcon:dr,image:ur,group:er,glyph:ir},hs=Object.keys(as);function ls(){return{arc:Object.assign({},as.arc),area:Object.assign({},as.area),circle:Object.assign({},as.circle),line:Object.assign({},as.line),path:Object.assign({},as.path),symbol:Object.assign({},as.symbol),text:Object.assign({},as.text),rect:Object.assign({},as.rect),rect3d:Object.assign({},as.rect3d),polygon:Object.assign({},as.polygon),richtext:Object.assign({},as.richtext),richtextIcon:Object.assign({},as.richtextIcon),image:Object.assign({},as.image),group:Object.assign({},as.group),glyph:Object.assign({},as.glyph)}}function cs(t,e,i=!0){e&&(i?Object.keys(e).forEach((i=>{t[i]?Object.assign(t[i],e[i]):t[i]=e[i]})):Object.keys(e).forEach((i=>{if(t[i]){const n=t[i],r=e[i];Object.keys(e[i]).forEach((t=>{void 0===n[t]&&(n[t]=r[t])}))}else t[i]=e[i]})))}const us=new Array(60).fill(0).map((()=>ls()));class ds{constructor(){this._defaultTheme=us.pop()||ls(),this.combinedTheme=this._defaultTheme,this.dirty=!1}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,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0),this.userTheme?cs(this.userTheme,t.userTheme,!1):this.userTheme=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=[],s=[];return void 0===e&&(e=!0),void 0===i&&(i=1/0),function t(i,o){if(null===i)return null;if(0===o)return i;var a,h,l;if("object"!=W(i))return i;if(ve(i)?a=[]:Te(i)?(a=new RegExp(i.source,(l="",(h=i).global&&(l+="g"),h.ignoreCase&&(l+="i"),h.multiline&&(l+="m"),l)),i.lastIndex&&(a.lastIndex=i.lastIndex)):a=be(i)?new Date(i.getTime()):void 0===n?Object.create(Object.getPrototypeOf(i)):Object.create(n),e){var c=r.indexOf(i);if(-1!==c)return s[c];r.push(i),s.push(a)}for(var u in i)a[u]=t(i[u],o-1);return a}(t,i)}(t.userTheme),cs(e,t.userTheme)}this.userTheme?this.doCombine(e):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this._defaultTheme,n=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);hs.forEach((r=>{var o,a;e[r]||s||t[r]?n[r]=Object.assign({},i[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):n[r]=i[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}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,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const ps=new ds;function fs(t,e){return t.glyphHost?fs(t.glyphHost):e?(t.isContainer,e):gs(t)||ps.getTheme()}function gs(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)):ps.getTheme()}return null}class ms{static GenAutoIncrementId(){return ms.auto_increment_id++}}ms.auto_increment_id=0;class ys extends le{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=ms.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){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,e=!1){return $(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,e=!0){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,e=!1){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&&console.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(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;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,e=!1){let 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,e=!1){let 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,e=!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=ue(i,!0)&&i||ge(i)&&i.capture,r=ge(i)&&i.once,s=de(e)?void 0:e;return t=n?`${t}capture`:t,e=de(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=ue(i,!0)&&i||ge(i)&&i.capture,r=de(e)?void 0:e;t=n?`${t}capture`:t,e=de(e)?e:e.handleEvent;const s=ge(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 ge(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,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class vs{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=vs.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ke,this.page=new Ke,this.canvas=new Ke,this.viewport=new Ke,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.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class bs extends vs{constructor(){super(...arguments),this.client=new Ke,this.movement=new Ke,this.offset=new Ke,this.global=new Ke,this.screen=new Ke}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,h,l,c,u,d,p,f){throw new Error("Method not implemented.")}}class xs extends bs{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 xs(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],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(),n.type=this.type,n}}class As extends bs{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 As(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],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(),n.type=this.type,n}}As.DOM_DELTA_PIXEL=0,As.DOM_DELTA_LINE=1,As.DOM_DELTA_PAGE=2;class Ts extends vs{constructor(t,e){super(),this.type=t,this.detail=e}}const Bs="object"==typeof performance&&performance.now?performance:Date;function Ss(t){return"mouse"===t||"pen"===t}class ws{constructor(t){this.dispatch=new le,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof xs))return void console.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(Ss(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 xs))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=Ss(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");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==a&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(i)}const h="dispatchEvent";this[h](r,"pointermove"),"touch"===r.pointerType&&this[h](r,"touchmove"),s&&(this[h](r,"mousemove"),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 xs))return void console.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=Ss(s.pointerType);this.dispatchEvent(s,"pointerover"),o&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(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 xs))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=Ss(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.cursor=""},this.onPointerUp=(t,e)=>{if(!(t instanceof xs))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=Bs.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(Ss(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=s;if(s&&!n.composedPath().includes(s)){let e=s;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(Ss(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:i});const s=r.clicksByButton[t.button];s.target===e.target&&i-s.timeStamp<200?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=i,e.detail=s.clickCount,Ss(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this.dispatchEvent(e,"tap"),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof xs))return void console.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"):Ss(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 As))return void console.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.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;if(!this.rootTarget)return;const o=this.mappingTable[t.type];let a;const h=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[h])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[h])||void 0===n?void 0:n.stage.renderCount)===(null===(r=this._prePointTargetCache)||void 0===r?void 0:r.stageRenderCount)?a=this._prePointTargetCache[h]:(a=this.pickTarget(t.canvasX,t.canvasY,t),t.pickParams||(this._prePointTargetCache={[h]:a,stageRenderCount:null!==(s=null==a?void 0:a.stage.renderCount)&&void 0!==s?s:-1})),o)for(let e=0,i=o.length;e<i;e++)o[e].fn(t,a);else console.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){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){const n=this.allocateEvent(xs);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.global.x,n.global.y,n),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(As);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.global.x,i.global.y,i),i}clonePointerEvent(t,e){const i=this.allocateEvent(xs);return 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(),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 xs&&e instanceof xs&&(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 bs&&e instanceof bs&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset),e.viewport.copyFrom(t.viewport))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Bs.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page),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.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:t>=0&&t<=Se(this.rootTarget,"width")&&e>=0&&e<=Se(this.rootTarget,"height")?this.rootTarget:null,i&&(i.pickParams=r.params),n}}const _s={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof vs))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],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 Ts(t,e))}},Cs={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Ps{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);if(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.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.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetElement(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.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.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:o=!1}=t;this.manager=new ws(n),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=o,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new xs,this.rootWheelEvent=new As,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.setTargetElement(null)}setCursor(t="default"){const{applyStyles:e,domElement:i}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&e?i.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&e&&Object.assign(i.style,n):e&&ye(t)&&!_e(this.cursorStyles,t)&&(i.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){const e=this.viewport,{x:i,y:n}=t;return{x:i-e.x,y:n-e.y}}mapToCanvasPoint(t){var e;const i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;const{clientX:n,clientY:r}=t,s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.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];me(n.button)&&(n.button=0),me(n.buttons)&&(n.buttons=1),me(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),me(n.width)&&(n.width=n.radiusX||1),me(n.height)&&(n.height=n.radiusY||1),me(n.tiltX)&&(n.tiltX=0),me(n.tiltY)&&(n.tiltY=0),me(n.pointerType)&&(n.pointerType="touch"),me(n.pointerId)&&(n.pointerId=n.identifier||0),me(n.pressure)&&(n.pressure=n.force||.5),me(n.twist)&&(n.twist=0),me(n.tangentialPressure)&&(n.tangentialPressure=0),me(n.layerX)&&(n.layerX=n.offsetX=n.clientX),me(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))e.push(t);else{const i=t;me(i.isPrimary)&&(i.isPrimary=!0),me(i.width)&&(i.width=1),me(i.height)&&(i.height=1),me(i.tiltX)&&(i.tiltX=0),me(i.tiltY)&&(i.tiltY=0),me(i.pointerType)&&(i.pointerType="mouse"),me(i.pointerId)&&(i.pointerId=1),me(i.pressure)&&(i.pressure=.5),me(i.twist)&&(i.twist=0),me(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}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.copyFrom(e.canvas),e.offset.copyFrom(e.canvas);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.copyFrom(t.canvas),t.offset.copyFrom(t.canvas);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=Cs[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Bs.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}isEventOutsideOfTargetElement(t){let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);return e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}class Ms{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Ms.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 Es{static Avaliable(){return!0}avaliable(){return Es.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 ks{static Avaliable(){return!!fr.global.getRequestAnimationFrame()}avaliable(){return ks.Avaliable()}tick(t,e){fr.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Rs;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Rs||(Rs={}));class Os{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){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===Rs.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=Rs.INITIAL,fr.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),fr.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:ks},{mode:"timeout",cons:Es},{mode:"manual",cons:Ms}];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 ks;break;case"timeout":t=new Es;break;case"manual":t=new Ms;break;default:console.warn("非法的计时器模式"),t=new ks}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!==Rs.INITIAL&&(this.status=Rs.PAUSE,!0)}resume(){return this.status!==Rs.INITIAL&&(this.status=Rs.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(t=!1){if(this.status===Rs.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Rs.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=Rs.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Rs.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Ds{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-Ds.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Ds.bounceIn(2*t):.5*Ds.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/Le*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Le/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/Le*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*Le/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/Le*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Le/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*Le/e)*.5+1}}}Ds.quadIn=Ds.getPowIn(2),Ds.quadOut=Ds.getPowOut(2),Ds.quadInOut=Ds.getPowInOut(2),Ds.cubicIn=Ds.getPowIn(3),Ds.cubicOut=Ds.getPowOut(3),Ds.cubicInOut=Ds.getPowInOut(3),Ds.quartIn=Ds.getPowIn(4),Ds.quartOut=Ds.getPowOut(4),Ds.quartInOut=Ds.getPowInOut(4),Ds.quintIn=Ds.getPowIn(5),Ds.quintOut=Ds.getPowOut(5),Ds.quintInOut=Ds.getPowInOut(5),Ds.backIn=Ds.getBackIn(1.7),Ds.backOut=Ds.getBackOut(1.7),Ds.backInOut=Ds.getBackInOut(1.7),Ds.elasticIn=Ds.getElasticIn(1,.3),Ds.elasticOut=Ds.getElasticOut(1,.3),Ds.elasticInOut=Ds.getElasticInOut(1,.3*1.5);class Is{constructor(){this.id=ms.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,e=!0){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 Ls=new Is;class Us{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(){}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 Ns extends Us{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Ws{constructor(e=ms.GenAutoIncrementId(),i=Ls){this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Fs(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=Fe(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Ws.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.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e,i=Ws.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 Ns((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=Ws.interpolateMap.get(t)||Ws.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 Fs(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()}}Ws.mode=t.AnimateMode.NORMAL,Ws.interpolateMap=new Map;class Fs{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 js(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?Ds[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?Ds[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 js(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])}))),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 h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,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 l=!this.reversed!=!(this.bounce&&s%2);return l&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(a,l),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 console.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 js{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 zs={duration:200,easing:"cubicOut"},Gs={duration:1e3,easing:"quadInOut"};var Hs;t.Edge=void 0,(Hs=t.Edge||(t.Edge={}))[Hs.Top=1]="Top",Hs[Hs.Right=2]="Right",Hs[Hs.Bottom=4]="Bottom",Hs[Hs.Left=8]="Left",Hs[Hs.ALL=15]="ALL";const Vs=[!1,!1,!1,!1],Ys=t=>{var e;let i=!0;if(ue(t,!0)){for(let n=0;n<4;n++)Vs[n]=t,i&&(i=!(null!==(e=Vs[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Vs[e]=!!t[e],i&&(i=!!Vs[e]);else Vs[0]=!1,Vs[1]=!1,Vs[2]=!1,Vs[3]=!1;return{isFullStroke:i,stroke:Vs}},Xs=[0,0,0,0],qs=t=>t?ve(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Xs[0]=t[0],Xs[2]=t[0],Xs[1]=t[1],Xs[3]=t[1],Xs):t:t:0,Ks=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],$s=[1,2,3,0,1,2,3,0];function Zs(t,e,i,n){for(;t>=Le;)t-=Le;for(;t<0;)t+=Le;for(;t>e;)e+=Le;Ks[0].x=i,Ks[1].y=i,Ks[2].x=-i,Ks[3].y=-i;const r=Math.ceil(t/De)%4,s=Math.ceil(e/De)%4;if(n.add(We(t)*i,ze(t)*i),n.add(We(e)*i,ze(e)*i),r!==s||e-t>Oe){let t=!1;for(let e=0;e<$s.length;e++)if(t||r!==$s[e]){if(t&&s===$s[e])break;if(t){const t=Ks[$s[e]];n.add(t.x,t.y)}}else{t=!0;const e=Ks[r];n.add(e.x,e.y)}}}function Js(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function Qs(t,e,i){const{x:n,y:r}=Xe(t.x,t.y,e.x,e.y,i),{x:s,y:o}=Xe(t.x1,t.y1,e.x1,e.y1,i),a=new Ke(n,r,s,o);return a.defined=e.defined,a}function to(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 Ke(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=Qs(t[r],e[r],i)}else{n=e.map((t=>{const e=new Ke(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=Qs(t[r],e[r],i)}return n}const eo=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],io=t=>eo.includes(t);function no(t,e){if(ve(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class ro{constructor(){this.durations=[],this.timeout=ro.TimeOut,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)}}ro.TimeOut=1e3/60;const so=new ro;var oo;!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"}(oo||(oo={}));class ao extends Us{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 ho(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,h=(n-i)*r+i,l=(a-o)*r+o,c=(h-a)*r+a,u=(c-l)*r+l;s[0]=t,s[1]=o,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function lo(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),h=Math.abs(n-i)/6,l=(a-2)/6,c=Math.ceil(h/l),u=[o[0],o[1]];let d=h;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],h=o[t+2],l=o[t+3];const p=o[t+4],f=o[t+5];if(d<=0){u.push(n,a,h,l,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const o=t/g;ho(e,n,h,p,o,r),ho(i,a,l,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],h=r[6],l=s[6]}d-=g-1}return o===t?[u,e]:[t,u]}function co(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 uo(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 po(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],h=t[s],l=t[s+1],c=r*l-h*a;e+=c,i+=(r+h)*c,n+=(a+l)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function fo(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,h=a-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%h+2,a=t[o]-i[0],l=t[o+1]-i[1],u=e[s]-n[0]-a,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,o=l)}return o}function go(t,e,i,n){const r=[];let s;for(let o=0;o<t.length;o++){let a=t[o];const h=e[o],l=po(a),c=po(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],m=a.length;s&&(a=uo(a));const y=6*fo(a,h,l,c),v=m-2;for(let t=0;t<v;t+=2){const e=(y+t)%v+2;u[t+2]=a[e]-l[0],u[t+3]=a[e+1]-l[1]}if(u[0]=a[y]-l[0],u[1]=a[y+1]-l[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=h[e]-c[0],a=h[e+1]-c[1],l=o*i-a*t,d=o*t+a*i;g[e]=l,g[e+1]=d;const p=l-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<m;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function mo(t,e){let i,n;const r=[],s=[];for(let o=0;o<Math.max(t.length,e.length);o++){const a=t[o],h=e[o];let l,c;a?h?([l,c]=lo(a,h),i=l,n=c):(c=co(n,a),l=a):(l=co(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const yo=(t,e,i,n,r)=>{Ee(e,n)&&Ee(i,r)||t.push(e,i,n,r,n,r)};function vo(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,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],[Di.L,Di.C,Di.Q].includes(i[0])&&(n=[o,a])),i[0]){case Di.M:r=o=i[1],s=a=i[2],h(o,a);break;case Di.L:l=i[1],c=i[2],yo(n,r,s,l,c),r=l,s=c;break;case Di.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Di.Q:l=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),u+2/3*(l-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Di.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],m=!!i[6];l=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(o=l,a=c,h(o,a)):yo(n,r,s,l,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const y=(m?-1:1)*Math.PI/2;for(let i=f;m?i>g:i<g;i+=y){const r=m?Math.max(i+y,g):Math.min(i+y,g);Qi(n,i,r,t,e,u,d)}break}case Di.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],m=i[7]+g,y=!!i[8],v=!Ee(f,0),b=Math.cos(f),x=Math.sin(f);let A=Math.cos(g)*u,T=Math.sin(g)*d;v?(l=A*b-T*x+t,c=A*x+T*b+e):(l=A+t,c=T+e),p?(o=l,a=c,h(o,a)):yo(n,r,s,l,c),A=Math.cos(m)*u,T=Math.sin(m)*d,v?(r=A*b-T*x+t,s=A*x+T*b+e):(r=A+t,s=T+e);const B=(y?-1:1)*Math.PI/2;for(let i=g;y?i>m:i<m;i+=B){const r=y?Math.max(i+B,m):Math.min(i+B,m);if(Qi(n,i,r,t,e,u,d),v){const i=n.length;for(let r=i-6;r<=i-1;r+=2)A=n[r],T=n[r+1],n[r]=(A-t)*b-(T-e)*x+t,n[r+1]=(A-t)*x+(T-e)*b+e}}break}case Di.R:o=r=i[1],a=s=i[2],l=o+i[3],c=a+i[4],h(l,a),yo(n,l,a,l,c),yo(n,l,c,o,c),yo(n,o,c,o,a),yo(n,o,a,l,a);break;case Di.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],u=$e.distancePP({x:r,y:s},{x:t,y:e}),d=$e.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(u*d),f=c/Math.sin(p/2),g=(r+h-2*t)/2,m=(s+l-2*e)/2,y=$e.distancePP({x:g,y:m},{x:0,y:0}),v=t+f*g/y,b=h+f*m/y,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/u,a=e+x*(s-e)/u,yo(n,r,s,o,a),r=t+x*(h-t)/d,s=e+x*(l-e)/d;const A=ei({x:v,y:b},{x:o,y:a}),T=ei({x:v,y:b},{x:r,y:s});Qi(n,A,T,v,b,c,c);break}case Di.Z:n&&yo(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function bo(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 xo(t){const e=new Wn;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}function Ao(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 To=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=Ao(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},Bo=(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),h=Math.abs(o-s),l=Ao(a*(s+o)/2,h,e),c=[],u=h/l.length,d=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[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},So=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=Ao(s*r,r,e),a=[],h=s/o[0],l=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:l*t,outerRadius:l*(t+1),startAngle:i+h*e*c,endAngle:i+h*(e+1)*c});return a},wo=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&xe(t.x)&&xe(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,h=t[e].y,l=t[e+1].x,c=t[e+1].y;for(;i<1&&o<r;)n.push({x:a+(l-a)*i,y:h+(c-h)*i}),i+=s,o+=1}return n},_o=(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&&xe(t.x)&&xe(t.y)));if(!a.length)return[];const h=[];a.forEach((t=>{h.push({x:t.x,y:t.y})}));for(let t=a.length-1;t>=0;t--){const e=a[t];h.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const l=[];return ko(s,e,l),l},Co=(t,e)=>{const i=t.attribute,n=i.points;if(n)return wo(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 wo(t,e)}return[]};const Po=t=>t.map((t=>({x:t.x,y:t.y}))),Mo=(t,e,i)=>{const n=t.length,r=[];for(let a=0;a<n;a++){const h=t[a],l=a===n-1?t[0]:t[a+1],c=wi([e.x,e.y],[i.x,i.y],[h.x,h.y],[l.x,l.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[Po(t),Po(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],h=r[r.length-1];a.edgeIndex>h.edgeIndex&&([a,h]=[h,a]);const l=a.point,c=h.point,u=[{x:l.x,y:l.y}];for(let e=a.edgeIndex+1;e<=h.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=h.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:l.x,y:l.y}),[u,d]},Eo=t=>{const e=new Je;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 Mo(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Mo(t,{x:e.x1,y:r},{x:e.x2,y:r})},ko=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Eo(t);ko(r[0],n,i),ko(r[1],e-n,i)}},Ro=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Po(i)}];const n=[];return ko(i,e,n),n},Oo=(t,e)=>{const i=vo(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:xo(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]});ko(e,t===n-1?o:s,r),o-=s}return r},{Color:Do}=Bi;var Io;t.ColorType=void 0,(Io=t.ColorType||(t.ColorType={}))[Io.Color255=0]="Color255",Io[Io.Color1=1]="Color1";class Lo{static Get(e,i=t.ColorType.Color1,n=[0,0,0,1]){if(i===t.ColorType.Color1){const t=Lo.store1[e];if(t)return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n;const i=Do.parseColorString(e);if(i){const t=[i.r/255,i.g/255,i.b/255,i.opacity];Lo.store1[e]=t,Lo.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=Lo.store255[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;const s=Do.parseColorString(e);return s&&(Lo.store1[e]=[s.r/255,s.g/255,s.b/255,s.opacity],Lo.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(Lo.store1[e])return;Lo.store1[e]=n,Lo.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Lo.store255[e])return;Lo.store255[e]=n,Lo.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Uo(t,e=!1){return Array.isArray(t)?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 No(e,i,n,r,s){if(!e||!i)return e&&Uo(e)||i&&Uo(i)||!1;let o,a,h=!1,l=!1;if(Array.isArray(e)?o=e:"string"==typeof e?o=Lo.Get(e,t.ColorType.Color255):h=!0,Array.isArray(i)?a=i:"string"==typeof i?a=Lo.Get(i,t.ColorType.Color255):l=!0,h!==l){const t=h?e:i,o=h?i:e,a=Object.assign(Object.assign({},t),{stops:t.stops.map((t=>Object.assign(Object.assign({},t),{color:Uo(o)})))});return h?No(t,a,n,r,s):No(a,t,n,r,s)}if(h){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 Wo(t,r,n);if("radial"===t.gradient)return Fo(t,r,n);if("conical"===t.gradient)return jo(t,r,n)}return!1}s&&s(o,a);return Uo(zo(o,a,n),r)}function Wo(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:Vo(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Fo(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:Vo(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function jo(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:Vo(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function zo(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]}Lo.store255={},Lo.store1={};const Go=[0,0,0,0],Ho=[0,0,0,0];function Vo(e,i,n){return Lo.Get(e,t.ColorType.Color255,Go),Lo.Get(i,t.ColorType.Color255,Ho),`rgba(${Math.round(Go[0]+(Ho[0]-Go[0])*n)},${Math.round(Go[1]+(Ho[1]-Go[1])*n)},${Math.round(Go[2]+(Ho[2]-Go[2])*n)},${Go[3]+(Ho[3]-Go[3])*n})`}Object.keys(ai).forEach((t=>{}));const Yo=(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=No(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},Xo=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,h=o.to,l=o.rotation*i,c=o.fromCp,u=o.toCp,d=Math.sin(l),p=Math.cos(l);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)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=o*p-l*d+r[0],n[t+1]=o*d+l*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],h=n[t+5];f===i&&g===r&&s===a&&o===h?e.lineTo(a,h):e.bezierCurveTo(i,r,s,o,a,h),f=a,g=h}}},qo=(t,e,i)=>{const n=t?vo(t):[],r=vo(e);i&&n&&(i.fromTransform&&bo(n,i.fromTransform.clone().getInverse()),bo(n,i.toTransfrom));const[s,o]=mo(n,r);return t?go(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},Ko=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],$o=(e,i)=>{if(!e||!i)return null;const n=[];let r=!1;return Object.keys(e).forEach((s=>{if(!Ko.includes(s))return;const o=i[s];pe(o)||pe(e[s])||o===e[s]||("fill"===s||"stroke"===s?n.push({from:"string"==typeof e[s]?Lo.Get(e[s],t.ColorType.Color255):e[s],to:"string"==typeof o?Lo.Get(o,t.ColorType.Color255):o,key:s}):n.push({from:e[s],to:o,key:s}),r=!0)})),r?n:null};class Zo extends Us{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;Xo(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&Yo(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const Jo=(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 h=qo(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:a,toTransfrom:e.globalTransMatrix}),l=$o(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 Zo({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:Gs.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:Gs.easing)),c};class Qo extends Us{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;Xo(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&&Yo(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const ta=t=>{const e={};return Object.keys(t).forEach((i=>{io(i)||(e[i]=t[i])})),e},ea=(t,e,i)=>{const n=ta(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=fr.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},ia=(t,e,i)=>{const n=[],r=i?null:ta(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Wn).fromCustomPath2D(s)};n.push(fr.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&ea(t,n,e),n},na=(t,e,i)=>{const n=[],r=i?null:ta(t.attribute);if("rect"===t.type){To(t,e).forEach((t=>{n.push(fr.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){Bo(t,e).forEach((t=>{n.push(fr.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){So(t,e).forEach((t=>{n.push(fr.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=Co(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(fr.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else if("polygon"===t.type){Ro(t,e).forEach((t=>{n.push(fr.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){_o(t,e).forEach((t=>{n.push(fr.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){Oo(t,e).forEach((t=>{"path"in t?n.push(fr.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(fr.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&ea(t,n,e),n};class ra{static GetImage(t,e){var i;let n=ra.cache.get(t);n?"fail"===n.loadState?fr.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&fr.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},ra.cache.set(t,n),n.dataPromise=fr.global.loadImage(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 GetSvg(t,e){var i;let n=ra.cache.get(t);n?"fail"===n.loadState?fr.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&fr.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},ra.cache.set(t,n),n.dataPromise=fr.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=ra.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"},ra.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=fr.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=fr.global.loadBlob(t):"json"===e&&(i.dataPromise=fr.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}ra.cache=new Map;const sa=new ii,oa=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],aa=["x","y"],ha=["scaleX","scaleY"],la=["angle"],ca=new Ke,ua={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d: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 da extends ys{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(da.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(e={}){super(),this._AABBBounds=new Qe,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background&&this.loadImage(e.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){const{dx:i=t.dx,dy:n=t.dy}=this.attribute;if(e&&this.parent){const t=fs(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;ca.x=i+e,ca.y=n+r}else ca.x=i,ca.y=n;return ca}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;fr.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),fr.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(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){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(t=!0){return this._transMatrix||(this._transMatrix=new ii),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 Ke(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,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){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):pe(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)}needUpdateTags(t,e=oa){for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t,e=oa){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),this._updateTag=t.UpdateTag.INIT,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,aa,s);o&&(e=o.x,i=o.y,delete o.x,delete o.y,this._setAttributes(o));const a=this.attribute,h=a.postMatrix;return h?fr.transformUtil.fromMatrix(h,h).translate(e,i):(a.x=(null!==(n=a.x)&&void 0!==n?n:Gn.x)+e,a.y=(null!==(r=a.y)&&void 0!==r?r:Gn.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,aa,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,ha,o);a&&(e=a.scaleX,i=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const h=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new ii,h.postMatrix=t),fr.transformUtil.fromMatrix(t,t).scale(e,i,n)}else h.scaleX=(null!==(r=h.scaleX)&&void 0!==r?r:Gn.scaleX)*e,h.scaleY=(null!==(s=h.scaleY)&&void 0!==s?s:Gn.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,ha,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,la,r);s&&(delete s.angle,this._setAttributes(s,!1,r));const o=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new ii,o.postMatrix=t),fr.transformUtil.fromMatrix(t,t).rotate(e,i)}else o.angle=(null!==(n=o.angle)&&void 0!==n?n:Gn.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,la,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 Ws(null==t?void 0:t.id).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||(fr.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)&&(!!pe(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,h;if(n){const t=Object.keys(e),n=r?t.reduce(((t,i)=>(t[i]=void 0===e[i]?this.getDefaultAttribute(i):e[i],t)),{}):e,l=this.animate();l.stateNames=i,l.to(n,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==o?o:zs.duration,null!==(h=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==h?h:zs.easing)}else 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}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();_e(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}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)}doUpdateLocalMatrix(){const{x:t=Gn.x,y:e=Gn.y,scaleX:i=Gn.scaleX,scaleY:n=Gn.scaleY,angle:r=Gn.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute,h=[0,0];if(o){if("string"==typeof o[0]){const t=parseFloat(o[0])/100,e=this.AABBBounds;h[0]=e.x1+(e.x2-e.x1)*t}else h[0]=o[0];if("string"==typeof o[1]){const t=parseFloat(o[1])/100,e=this.AABBBounds;h[1]=e.x1+(e.x2-e.x1)*t}else h[1]=o[1]}if(!s||1===i&&1===n)!function(t,e,i,n,r,s,o,a){var h,l,c=e.a,u=e.b,d=e.c,p=e.d,f=e.e,g=e.f,m=We(o),y=ze(o);a?(h=a[0],l=a[1]):(h=i,l=n);var v=h-i,b=l-n,x=c*m+d*y,A=u*m+p*y,T=d*m-c*y,B=p*m-u*y;t.a=r*x,t.b=r*A,t.c=s*T,t.d=s*B,t.e=f+c*h+d*l-x*v-T*b,t.f=g+u*h+p*l-A*v-B*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,o&&h);else{const o=this._transMatrix;o.reset(),o.translate(h[0],h[1]),o.rotate(r),o.translate(-h[0],-h[1]),o.translate(t,e),fr.transformUtil.fromMatrix(o,o).scale(i,n,{x:s[0],y:s[1]})}const l=this.getOffsetXY(Gn);if(this._transMatrix.e+=l.x,this._transMatrix.f+=l.y,a){const t=sa.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),fr.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,h=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,h)}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,h,l){l||(l=Object.keys(o),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=o[s],u=null!==(l=a&&a[s])&&void 0!==l?l:t.getLastPropByName(s,n);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,h,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=h}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=No(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=No(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=No(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 fs(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:fr.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 ye(t,!0)?this.pathProxy=(new Wn).fromString(t):this.pathProxy=new Wn,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){if(t.fill||t.stroke)return!0;return!1}(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",Ae(t)||Be(t)?(ra.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(ra.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e)}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(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",fr.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Ts(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)}}}da.mixin(_s);class pa{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 fa(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function ga(t,e,i,n=">"){const r=function(t,e,i=">"){let n,r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,n);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let h=s,l=!0;-1!==a&&(h=s.substr(0,a).replace(/\s\s*$/,""),s=s.substr(a+1));const c=h;if(i){const t=h.indexOf(":");-1!==t&&(h=h.substr(t+1),l=h!==r.data.substr(t+1))}return{tagName:h,tagExp:s,closeIndex:o,attrExpPresent:l,rawTagName:c}}const ma=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class ya{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,ma),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],i=r[t][4],s=e;e&&(n[s]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new pa("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){const e=fa(t,">",s,"Closing Tag is not closed."),o=r.lastIndexOf(".");r=r.substring(0,o),i=this.tagsNodeStack.pop(),n="",s=e}else if("?"===t[s+1]){s=ga(t,s,!1,"?>").closeIndex+1}else if("!--"===t.substr(s+1,3)){s=fa(t,"--\x3e",s+4,"Comment is not closed.")}else{const o=ga(t,s,!1);let a=o.tagName,h=o.tagExp;const l=o.attrExpPresent,c=o.closeIndex;if(a!==e.tagname&&(r+=r?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),h=a):h=h.substr(0,h.length-1);const t=new pa(a);a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new pa(a);this.tagsNodeStack.push(i),a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(i,t,r),i=t}n="",s=c}else n+=t[s]}return e.child}}function va(t,e){return ba(t)}function ba(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],r=xa(n);if(void 0!==r&&n[r]){const t=ba(n[r]);Ta(t),n[":@"]&&Aa(t,n[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}return i}function xa(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Aa(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]}}}function Ta(t){return 0===Object.keys(t).length}class Ba{constructor(t){this.options=Object.assign({},Ba.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return va(new ya(this.options).parseXml(t),this.options)}}function Sa(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function wa(t){return t.startsWith("<")}function _a(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Ba.defaultOptions={};let Ca=0;function Pa(){return Ca++}var Ma;function Ea(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)Oa(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,(Ma=t.TextDirection||(t.TextDirection={}))[Ma.HORIZONTAL=0]="HORIZONTAL",Ma[Ma.VERTICAL=1]="VERTICAL";const ka=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>ka.set(t,!0)));const Ra=new Map;function Oa(t){if(ka.has(t))return!0;if(Ra.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function Da(t,e){const i=t["@_attribute"];if(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=>Ra.set(t,!0)));const Ia=Pa(),La=Pa(),Ua=Pa(),Na=Pa(),Wa=Pa(),Fa=Pa(),ja=Pa(),za=Pa(),Ga=Pa(),Ha=Pa(),Va=Pa(),Ya=Pa(),Xa=Pa(),qa=Pa(),Ka=Pa(),$a=Pa(),Za=Symbol.for("GraphicService"),Ja=Symbol.for("GraphicCreator"),Qa={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},th=Object.keys(Qa),eh={"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"},ih=Object.keys(eh);var nh;t.GroupUpdateAABBBoundsMode=void 0,(nh=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[nh.LESS_GROUP=0]="LESS_GROUP",nh[nh.MORE_GROUP=1]="MORE_GROUP";class rh extends da{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Fa,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 ds),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new ds)}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 Ke(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;fr.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),fr.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=fs(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=fr.graphicService.updateGroupAABBBounds(t,fs(this).group,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=qs(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(),fr.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),fr.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){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,fr.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{fr.graphicService.onRemove(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),fr.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(t=!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=fr.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new rh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return rh.NOWORK_ANIMATE_ATTR}}rh.NOWORK_ANIMATE_ATTR=ua;class sh extends rh{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 ds,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!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=>{fr.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;const n=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:n.x,y:n.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,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){}combineTo(t,e){var i,n,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{fr.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i,n,r;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const oh=Symbol.for("TransformUtil"),ah=Symbol.for("GraphicUtil"),hh=Symbol.for("LayerService"),lh=Symbol.for("StaticLayerHandlerContribution"),ch=Symbol.for("DynamicLayerHandlerContribution"),uh=Symbol.for("VirtualLayerHandlerContribution");t.DefaultLayerService=class{constructor(t){this.global=t,this.layerMap=new Map}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?_r.get(lh):"dynamic"===t?_r.get(ch):_r.get(uh),e}createLayer(t,e={main:!1}){this.tryInit();const i=this.getRecommendedLayerType(e.layerMode),n=this.getLayerHandler(i),r=new sh(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:i,layerHandler:n})),s=this.layerMap.get(t)||[];return s.push(r),this.layerMap.set(t,s),this.staticLayerCountInEnv--,r}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}},t.DefaultLayerService=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],t.DefaultLayerService);const dh=Symbol.for("VWindow"),ph=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(t){this.global=t,this.hooks={onChange:new ne(["x","y","width","height"])},this._uid=ms.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;_r.getNamed(ph,t.env).configure(this,t),this.actived=!0,this._handler}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.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._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,e){this._handler.clearViewBox(t,e)}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},X([Kt(),K("design:type",Function),K("design:paramtypes",[]),K("design:returntype",void 0)],t.DefaultWindow.prototype,"postInit",null),t.DefaultWindow=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],t.DefaultWindow);var fh=new n((e=>{e(t.DefaultGlobal).toSelf().inSingletonScope(),e(se).toService(t.DefaultGlobal),e(t.DefaultWindow).to(t.DefaultWindow),e(dh).toService(t.DefaultWindow),e(t.DefaultGraphicUtil).toSelf().inSingletonScope(),e(ah).toService(t.DefaultGraphicUtil),e(t.DefaultTransformUtil).toSelf().inSingletonScope(),e(oh).toService(t.DefaultTransformUtil),e(t.DefaultLayerService).toSelf().inSingletonScope(),e(hh).toService(t.DefaultLayerService)}));function gh(t,e){return!(!t&&!e)}function mh(t,e){let i;return i=ve(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function yh(t,e,i){return i&&t*e>0}function vh(t,e,i,n,r){return r&&t*e>0&&i>0&&n>0}function bh(t,e){return t*e>0}function xh(t,e,i,n){return t*e>0&&i>0&&n>0}function Ah(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const h=fs(t,null==s?void 0:s.theme)[t.type],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible}=t.attribute,m=yh(u,d,l),y=bh(u,f),v=gh(l),b=mh(c,p);if(!g)return!0;if(!v&&!b)return!0;if(!(m||y||o||a))return!0;e.beginPath();return en(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),v&&(o?o(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function Th(t,e,i,n,r,s,o,a){const h=i-t,l=n-e,c=o-r,u=a-s;let d=u*h-c*l;return d*d<Re?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*h,e+d*l])}function Bh(t,e,i,n,r,s,o){const a=t-i,h=e-n,l=(o?s:-s)/Math.sqrt(a*a+h*h),c=l*h,u=-l*a,d=t+c,p=e+u,f=i+c,g=n+u,m=(d+f)/2,y=(p+g)/2,v=f-d,b=g-p,x=v*v+b*b,A=r-s,T=d*g-f*p,B=(b<0?-1:1)*Math.sqrt(Math.max(0,A*A*x-T*T));let S=(T*b-v*B)/x,w=(-T*v-b*B)/x;const _=(T*b+v*B)/x,C=(-T*v+b*B)/x,P=S-m,M=w-y,E=_-m,k=C-y;return P*P+M*M>E*E+k*k&&(S=_,w=C),{cx:S,cy:w,x01:-c,y01:-u,x11:S*(r/A-1),y11:w*(r/A-1)}}function Sh(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=Ue(h-a),c=h>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=Re)e.moveTo(i,n);else if(l>=Le-Re)e.moveTo(i+r*We(a),n+r*ze(a)),e.arc(i,n,r,a,h,!c),s>Re&&(e.moveTo(i+s*We(h),n+s*ze(h)),e.arc(i,n,s,h,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:m,innerEndAngle:y,innerStartAngle:v}=t.getParsePadAngle(a,h),b=d,x=d,A=d,T=d,B=Math.max(x,b),S=Math.max(A,T);let w=B,_=S;const C=r*We(g),P=r*ze(g),M=s*We(y),E=s*ze(y);let k,R,O,D;if((S>Re||B>Re)&&(k=r*We(m),R=r*ze(m),O=s*We(v),D=s*ze(v),l<Oe)){const t=Th(C,P,O,D,k,R,M,E);if(t){const e=C-t[0],i=P-t[1],n=k-t[0],o=R-t[1],a=1/ze(Ve((e*n+i*o)/(Ge(e*e+i*i)*Ge(n*n+o*o)))/2),h=Ge(t[0]*t[0]+t[1]*t[1]);_=je(S,(s-h)/(a-1)),w=je(B,(r-h)/(a+1))}}if(p<.001)o&&(o[3]||o[1])&&e.moveTo(i+C,n+P),u=!0;else if(w>Re){const t=je(b,w),s=je(x,w),a=Bh(O,D,C,P,r,t,Number(c)),h=Bh(k,R,M,E,r,s,Number(c));w<B&&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,w,Ne(a.y01,a.x01),Ne(h.y01,h.x01),!c)):e.moveTo(i+a.cx+w*We(Ne(h.y01,h.x01)),n+a.cy+w*ze(Ne(h.y01,h.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,Ne(a.y01,a.x01),Ne(a.y11,a.x11),!c),e.arc(i,n,r,Ne(a.cy+a.y11,a.cx+a.x11),Ne(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,Ne(h.y11,h.x11),Ne(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*We(Ne(h.y01,h.x01)),n+h.cy+s*ze(Ne(h.y01,h.x01))):e.moveTo(i+k,n+r*ze(m))}else!o||o[0]?(e.moveTo(i+C,n+P),e.arc(i,n,r,g,m,!c)):e.moveTo(i+r*We(m),n+r*ze(m));if(!(s>Re)||f<.001)!o||o[1]?e.lineTo(i+M,n+E):e.moveTo(i+M,n+E),u=!0;else if(_>Re){const t=je(T,_),r=je(A,_),a=Bh(M,E,k,R,s,-r,Number(c)),h=Bh(C,P,O,D,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),_<S&&t===r){const t=Ne(h.y01,h.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,_,Ne(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+We(t),n+a.cy+ze(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,Ne(a.y01,a.x01),Ne(a.y11,a.x11),!c),e.arc(i,n,s,Ne(a.cy+a.y11,a.cx+a.x11),Ne(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,Ne(h.y11,h.x11),Ne(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*We(Ne(h.y01,h.x01)),n+h.cy+t*ze(Ne(h.y01,h.x01))):e.moveTo(i+O,n+D)}else!o||o[1]?e.lineTo(i+M,n+E):e.moveTo(i+M,n+E),!o||o[2]?e.arc(i,n,s,y,v,c):e.moveTo(i+s*We(v),n+s*ze(v))}return o?o[3]&&e.lineTo(i+r*We(a),n+r*ze(a)):e.closePath(),u}class wh{static GetCanvas(){try{return wh.canvas||(wh.canvas=fr.global.createCanvas({})),wh.canvas}catch(t){return null}}static GetCtx(){if(!wh.ctx){const t=wh.GetCanvas();wh.ctx=t.getContext("2d")}return wh.ctx}}class _h{constructor(t=[],e=100){const i=wh.GetCanvas(),n=wh.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})`}static GetOrCreate(t=[],e=100){let i="";t.forEach((t=>i+=t.join())),i+=e;let n=_h.dataMap.get(i);return n||(n=new _h(t,e),_h.dataMap.set(i,n)),n}static SetColorInterpolateInstance(t,e){_h.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return _h.dataMap.get(t)}}_h.dataMap=new Map;class Ch{static GetSize(t){for(let e=0;e<Ch.ImageSize.length;e++)if(Ch.ImageSize[e]>=t)return Ch.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=Ch.GenKey(t,e,i,n,r),h=Ch.cache[a];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=o)return h[t].pattern;return null}static Set(t,e,i,n,r,s,o,a){const h=Ch.GenKey(t,e,i,n,r);Ch.cache[h]?Ch.cache[h].push({width:o,height:a,pattern:s}):Ch.cache[h]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function Ph(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=Le;for(;i>Le;)i-=Le;if(i<s)return r[0].color;if(i>o)return r[0].color;let a,h,l=(i-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=l){a=r[t-1],h=r[t];break}return l=(l-a.offset)/(h.offset-a.offset),No(a.color,h.color,l,!1)}Ch.cache={},Ch.ImageSize=[20,40,80,160,320,640,1280,2560];const Mh=Symbol.for("ArcRenderContribution"),Eh=Symbol.for("AreaRenderContribution"),kh=Symbol.for("CircleRenderContribution"),Rh=Symbol.for("GroupRenderContribution"),Oh=Symbol.for("ImageRenderContribution"),Dh=Symbol.for("PathRenderContribution"),Ih=Symbol.for("PolygonRenderContribution"),Lh=Symbol.for("RectRenderContribution"),Uh=Symbol.for("SymbolRenderContribution"),Nh=Symbol.for("TextRenderContribution"),Wh=Symbol.for("InteractiveSubRenderContribution"),Fh=["radius","startAngle","endAngle",...oa];class jh extends da{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Na}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=fs(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=fr.graphicService.updateCircleAABBBounds(i,fs(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=qs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fs(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,Fh)}needUpdateTag(t){return super.needUpdateTag(t,Fh)}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 Wn;return a.arc(0,0,r,s,o),a}clone(){return new jh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return jh.NOWORK_ANIMATE_ATTR}}function zh(t,e={},i){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 Gh(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Hh(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}jh.NOWORK_ANIMATE_ATTR=ua;class Vh{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,h){const l=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);l.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,l,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s,o){t=t.map((t=>t.toString()));const a=[],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),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s).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),a.push({str:i,width:e});h[0]=o}h[1]=a.length*n,h[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const l={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(l,e,i),this.layoutWithBBox(l,a,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 Yh=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak",...oa];class Xh extends da{get font(){const t=fs(this).text;return this._font||(this._font=zh(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=fs(this).text;if(Array.isArray(e.text))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(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=fs(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text.toString())}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=$a,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=fs(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateSingallineAABBBounds(t){const e=fs(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=fs(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,i;const n=fs(this).text,r=fr.graphicUtil.textMeasure;let s,o;const a=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:l=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontFamily:d=n.fontFamily,fontSize:p=n.fontSize,fontWeight:f=n.fontWeight,stroke:g=n.stroke,lineWidth:m=n.lineWidth,wordBreak:y=n.wordBreak,ignoreBuf:v=n.ignoreBuf}=a,b=v?0:Math.max(2,.075*p),{lineHeight:x=(null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||n.fontSize)+b)}=a;if(!this.shouldUpdateShape()&&this.cache){s=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=Gh(c,s),e=Hh(u,x,p);return this._AABBBounds.set(t,e,t+s,e+x),g&&this._AABBBounds.expand(m/2),this._AABBBounds}if(Number.isFinite(h)){if(l){const e=!0===l?n.ellipsis:l,i=r.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d},h,e,!1);o=i.str,s=i.width}else{const e=r.clipText(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d},h,!1);o=e.str,s=e.width}this.cache.clipedText=o,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const A=Gh(c,s);let T=x;fr.global&&fr.global.isSafari()&&(T+=.2*p);const B=Hh(u,T,p,b);return this._AABBBounds.set(A,B,A+s,B+T),g&&this._AABBBounds.expand(m/2),this._AABBBounds}getBaselineMapAlign(){return Xh.baselineMapAlign}getAlignMapBaseline(){return Xh.alignMapBaseline}updateVerticalSinglelineAABBBounds(e){var i,n,r;const s=fs(this).text,o=fr.graphicUtil.textMeasure;let a;const h=this.attribute,{ignoreBuf:l=s.ignoreBuf}=h,c=l?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontSize:p=s.fontSize,fontWeight:f=s.fontWeight,fontFamily:g=s.fontFamily,stroke:m=s.stroke,lineHeight:y=(null!==(i=h.lineHeight)&&void 0!==i?i:(h.fontSize||s.fontSize)+c),lineWidth:v=s.lineWidth,verticalMode:b=s.verticalMode}=h;let{textAlign:x=s.textAlign,textBaseline:A=s.textBaseline}=h;if(!b){const t=x;x=null!==(n=Xh.baselineMapAlign[A])&&void 0!==n?n:"left",A=null!==(r=Xh.alignMapBaseline[t])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){a=this.cache.clipedWidth;const t=Gh(x,a),e=Hh(A,y,p);return this._AABBBounds.set(e,t,e+y,t+a),m&&this._AABBBounds.expand(v/2),this._AABBBounds}let T=[Ea(e.toString())];if(Number.isFinite(u)){if(d){const t=!0===d?s.ellipsis:d,e=o.clipTextWithSuffixVertical(T[0],{fontSize:p,fontWeight:f,fontFamily:g},u,t,!1);T=[e.verticalList],a=e.width}else{const t=o.clipTextVertical(T[0],{fontSize:p,fontWeight:f,fontFamily:g},u,!1);T=[t.verticalList],a=t.width}this.cache.verticalList=T,this.cache.clipedWidth=a}else a=0,T[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=T,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const B=Gh(x,a),S=Hh(A,y,p);return this._AABBBounds.set(S,B,S+y,B+a),m&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const i=fs(this).text,n=this.attribute,{fontFamily:r=i.fontFamily,textAlign:s=i.textAlign,textBaseline:o=i.textBaseline,fontSize:a=i.fontSize,fontWeight:h=i.fontWeight,lineHeight:l=n.lineHeight||n.fontSize||i.fontSize,ellipsis:c=i.ellipsis,maxLineWidth:u,stroke:d=i.stroke,lineWidth:p=i.lineWidth,wordBreak:f=i.wordBreak}=n;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.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 g=fr.graphicUtil.textMeasure,m=new Vh(r,{fontSize:a,fontWeight:h,fontFamily:r},g).GetLayoutByLines(t,s,o,l,!0===c?i.ellipsis:c||void 0,!1,u),{bbox:y}=m;return this.cache.layoutData=m,this.clearUpdateShapeTag(),this._AABBBounds.set(y.xOffset,y.yOffset,y.xOffset+y.width,y.yOffset+y.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i,n,r;const s=fs(this).text,o=fr.graphicUtil.textMeasure;let a;const h=this.attribute,{ignoreBuf:l=s.ignoreBuf}=h,c=l?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontFamily:p=s.fontFamily,fontSize:f=s.fontSize,fontWeight:g=s.fontWeight,stroke:m=s.stroke,lineHeight:y=(null!==(i=h.lineHeight)&&void 0!==i?i:(h.fontSize||s.fontSize)+c),lineWidth:v=s.lineWidth,verticalMode:b=s.verticalMode}=h;let{textAlign:x=s.textAlign,textBaseline:A=s.textBaseline}=h;if(!b){const t=x;x=null!==(n=Xh.baselineMapAlign[A])&&void 0!==n?n:"left",A=null!==(r=Xh.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=Fe(e,a)}));const t=Gh(x,a),e=this.cache.verticalList.length*y,i=Hh(A,e,f);return this._AABBBounds.set(i,t,i+e,t+a),m&&this._AABBBounds.expand(v/2),this._AABBBounds}const T=e.map((t=>Ea(t.toString())));T.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);T[i]=n.verticalList,a=n.width}else{const t=o.clipTextVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,!1);T[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=T,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=Fe(e,a)}));const B=Gh(x,a),S=this.cache.verticalList.length*y,w=Hh(A,S,f);return this._AABBBounds.set(w,B,w+S,B+a),m&&this._AABBBounds.expand(v/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fs(this).text[t]}needUpdateTags(t,e=Yh){return super.needUpdateTags(t,e)}needUpdateTag(t,e=Yh){return super.needUpdateTag(t,e)}clone(){return new Xh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Xh.NOWORK_ANIMATE_ATTR}}Xh.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},ua),Xh.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Xh.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const qh=["heightLimit","lineClamp"];class Kh extends Xh{_isValid(){const{text:t}=this.attribute;return ve(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n;const r=fs(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,lineHeight:l=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:p=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:m=r.ignoreBuf,heightLimit:y=0,lineClamp:v}=this.attribute,b=m?0:2;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.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 x=fr.graphicUtil.textMeasure,A=new Vh(s,{fontSize:h,fontWeight:g,fontFamily:s},x),T=t.map((t=>t.toString())),B=[],S=[0,0];let w=1/0;if(y>0&&(w=Math.max(Math.floor(y/l),1)),v&&(w=Math.min(w,v)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<T.length;t++){const e=T[t];let r=!0;if(t===w-1){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,u,c,!1);B.push({str:t.str,width:t.width});break}const s=A.textMeasure.clipText(e,A.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,u,c,!1);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(n=t.width)&&void 0!==n?n:0}else s.str="",s.width=0;r=!1}if(B.push({str:s.str,width:s.width}),s.str.length===e.length);else if(r){const i=e.substring(s.str.length);T.splice(t+1,0,i)}}let t=0;B.forEach((e=>{t=Math.max(t,e.width)})),S[0]=t}else{let t,e,i=0;for(let n=0,r=T.length;n<r;n++){if(n===w-1){const t=A.textMeasure.clipTextWithSuffix(T[n],A.textOptions,u,c,!1);B.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=T[n],t=A.textMeasure.measureTextWidth(e,A.textOptions,"break-word"===f),i=Math.max(i,t),B.push({str:e,width:t})}S[0]=i}S[1]=B.length*(l+b);const _={xOffset:0,yOffset:0,width:S[0],height:S[1]};A.LayoutBBox(_,o,a);const C=A.layoutWithBBox(_,B,o,a,l);return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(_.xOffset,_.yOffset,_.xOffset+_.width,_.yOffset+_.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<qh.length;e++){const i=qh[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<qh.length;e++){if(t===qh[e])return!0}return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Kh.NOWORK_ANIMATE_ATTR}}class $h{bounds(t,e){if(xe(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 Zh(t,e,i,n,r){return r?t.arc(i,n,e,0,Ie,!1,r):t.arc(i,n,e,0,Ie),!1}var Jh=new class extends $h{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 Zh(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Zh(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 Qh=new class extends $h{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 tl(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 el=new class extends $h{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 tl(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return tl(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return tl(t,e/2+r,i,n,s)}};function il(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var nl=new class extends $h{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return il(t,e/2,i,n)}drawOffset(t,e,i,n,r){return il(t,e/2+r,i,n)}};class rl extends $h{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 sl=new rl;var ol=new class extends rl{constructor(){super(...arguments),this.type="triangle"}};const al=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),hl=Math.sin(Ie/10)*al,ll=-Math.cos(Ie/10)*al;function cl(t,e,i,n){const r=hl*e,s=ll*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=Ie*o/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*r-l*s+i,l*r+h*s+n)}return t.closePath(),!0}var ul=new class extends $h{constructor(){super(...arguments),this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}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)}};const dl=Ge(3);function pl(t,e,i,n){const r=e,s=r/dl,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 fl=new class extends $h{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 pl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return pl(t,e/2+r,i,n)}};function gl(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 ml=new class extends $h{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return gl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return gl(t,e/2+r,i,n)}};function yl(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var vl=new class extends $h{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return yl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return yl(t,e/2+r,i,n)}};const bl=-.5,xl=Ge(3)/2,Al=1/Ge(12);function Tl(t,e,i,n){const r=e/2,s=e*Al,o=r,a=e*Al+e,h=-o,l=a;return t.moveTo(r+i,s+n),t.lineTo(o+i,a+n),t.lineTo(h+i,l+n),t.lineTo(bl*r-xl*s+i,xl*r+bl*s+n),t.lineTo(bl*o-xl*a+i,xl*o+bl*a+n),t.lineTo(bl*h-xl*l+i,xl*h+bl*l+n),t.lineTo(bl*r+xl*s+i,bl*s-xl*r+n),t.lineTo(bl*o+xl*a+i,bl*a-xl*o+n),t.lineTo(bl*h+xl*l+i,bl*l-xl*h+n),t.closePath(),!1}var Bl=new class extends $h{constructor(){super(...arguments),this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return Tl(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Tl(t,e/2+r,i,n)}};var Sl=new class extends $h{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 wl=new class extends $h{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 _l=new class extends $h{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 Cl=Ge(3);function Pl(t,e,i,n){const r=e*Cl;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var Ml=new class extends rl{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Pl(t,e/2/Cl,i,n)}drawOffset(t,e,i,n,r){return Pl(t,e/2/Cl+r,i,n)}};function El(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 kl=new class extends $h{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 El(t,e/4,i,n)}drawOffset(t,e,i,n,r){return El(t,e/4+r,i,n)}};function Rl(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 Ol=new class extends $h{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 Rl(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Rl(t,e/4+r,i,n)}};function Dl(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 Il=new class extends $h{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 Dl(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Dl(t,e/4+r,i,n)}};function Ll(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 Ul=new class extends $h{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 Ll(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Ll(t,e/4+r,i,n)}};function Nl(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Wl=new class extends $h{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return Nl(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return Nl(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 Fl(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var jl=new class extends $h{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return Fl(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return Fl(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 zl(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 Gl=new class extends $h{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 zl(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return zl(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 Hl(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}var Vl=new class extends $h{constructor(){super(...arguments),this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Hl(t,xe(e)?[e,e]:e,i,n)}drawOffset(t,e,i,n,r){return Hl(t,xe(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],i,n)}};const Yl=new Qe;class Xl{constructor(t,e,i=!1){this.pathStr="",this.type=t,ve(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(),en(r.path.commandList,t,i,n,e,e),o&&o(r.path,r.attribute)})),!1):(en(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(),en(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(en(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((({path:i})=>{Yl.x1=i.bounds.x1*t,Yl.y1=i.bounds.y1*t,Yl.x2=i.bounds.x2*t,Yl.y2=i.bounds.y2*t,e.union(Yl)}))}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 ql=[Jh,Qh,el,nl,Ml,ol,ul,fl,ml,vl,Bl,Sl,wl,sl,_l,kl,Ol,Il,Ul,Vl,Wl,jl,Gl],Kl={};ql.forEach((t=>{Kl[t.type]=t}));const $l=["symbolType","size",...oa];let Zl=class t extends da{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Ka}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return ve(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=fs(this).symbol,{symbolType:i=e.symbolType}=this.attribute;let n=Kl[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(!0===Sa(i)){const e=new Ba,{svg:n}=e.parse(i);if(!n)return null;const r=ve(n.path)?n.path:[n.path],s=new Qe,o=[];r.forEach((t=>{const e=(new Wn).fromString(t.d),i={fill:"black"};ih.forEach((e=>{t[e]&&(i[eh[e]]=t[e])})),o.push({path:e,attribute:i}),s.union(e.bounds)}));const a=s.width(),h=s.height(),l=1/Fe(a,h);return o.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new Xl(i,o,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new Wn).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/Fe(s,o);return r.transform(0,0,a,a),this._parsedPath=new Xl(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=fs(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=fr.graphicService.updateSymbolAABBBounds(i,fs(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=qs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fs(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,$l)}needUpdateTag(t){return super.needUpdateTag(t,$l)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=ve(e)?e:[e,e];return t.path?(new Wn).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Wn).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};Zl.userSymbolMap={},Zl.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},ua);const Jl=["segments","points","curveType",...oa];let Ql=class t extends da{constructor(t={}){super(t),this.type="line",this.numberType=za}isValid(){return super.isValid()&&this._isValid()}_isValid(){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=to(i,n,e))}doUpdateAABBBounds(){const t=fs(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updateLineAABBBounds(e,fs(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fs(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,Jl)}needUpdateTag(t){return super.needUpdateTag(t,Jl)}toCustomPath(){const t=this.attribute,e=new Wn,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}};Ql.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},ua);const tc=["width","height","cornerRadius",...oa];class ec extends da{constructor(t){super(t),this.type="rect",this.numberType=Ya}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=fs(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updateRectAABBBounds(e,fs(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fs(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,tc)}needUpdateTag(t){return super.needUpdateTag(t,tc)}toCustomPath(){const t=this.attribute,e=t.width,i=t.height,n=new Wn;return n.moveTo(0,0),n.rect(0,0,e,i),n}clone(){return new ec(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ec.NOWORK_ANIMATE_ATTR}}ec.NOWORK_ANIMATE_ATTR=ua;const ic=[[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 nc extends ec{constructor(t){super(t),this.type="rect3d",this.numberType=Xa}findFace(){const t={polygons:[],vertices:[],edges:[]},e=fs(this).rect3d,{width:i=e.width,height:n=e.width,length:r=je(e.width,e.height)}=this.attribute;for(let e=0;e<ic.length;e++){const s=ic[e];t.vertices.push([s[0]*i,s[1]*n,s[2]*r])}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 nc.NOWORK_ANIMATE_ATTR}}nc.NOWORK_ANIMATE_ATTR=ua;class rc extends da{constructor(t){super(t),this.type="glyph",this.numberType=Wa,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,e=!1,i){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.setValue(1/0,1/0,-1/0,-1/0);const t=fr.graphicService.updateGlyphAABBBounds(this.attribute,fs(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;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.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new rc(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return rc.NOWORK_ANIMATE_ATTR}}rc.NOWORK_ANIMATE_ATTR=ua;class sc{constructor(t,e,i,n,r,s,o,a,h,l,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=h,this.layoutDirection=l,this.directionKey=gr[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;switch(this.globalAlign){case"left":a=0;break;case"center":a=-r/2;break;case"right":a=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)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]+h)return l;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}else{const i=Math.floor((h-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,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=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,a,s+o,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,a,s+o,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===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}}}}return l}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=this.lines[i].getWidthWithEllips();n>t&&(t=n),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=this.lines[i].getWidthWithEllips();n>t&&(t=n),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=this.lines[i].getWidthWithEllips();n>t&&(t=n),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 oc{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic","number"==typeof i.lineHeight?this.lineHeight=i.lineHeight>this.fontSize?i.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:s,width:o}=Br(t,i);let a=0,h=0,l=0;this.height>r&&(a=(this.height-r)/2,h=Math.ceil(a),l=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+l),this.length=t.length,this.width=o||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)}updateWidth(){const{width:t}=Br(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="...",a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ar(s,("vertical"===a?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+="...","right"===r){const{width:e}=Br(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||yr;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const i=e&&e.fill||mr;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,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=Ar(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=Br(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const ac=["width","height","image",...oa];class hc extends da{constructor(t){super(t),this.type="image",this.numberType=ja,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()}))}doUpdateAABBBounds(){const t=fs(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updateImageAABBBounds(e,fs(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ur[t]}needUpdateTags(t){return super.needUpdateTags(t,ac)}needUpdateTag(t){return super.needUpdateTag(t,ac)}clone(){return new hc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return hc.NOWORK_ANIMATE_ATTR}}hc.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},ua);class lc extends hc{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=qs(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(ve(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=qs(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=ur.width,height:e=ur.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 cc{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 lc?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=gr[this.direction];const h=this.directionKey;this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof oc){const e=xr.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;let c=this.left,u=0;if(this.actualWidth<e&&!a)switch(this.textAlign){case"right":c=e-this.actualWidth;break;case"center":c=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?c=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof lc?(t["_"+h.x]=c,c+=t[h.width]+u,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?l-t.height:(l-t.height)/2):(t[h.left]=c,c+=t[h.width]+u)}))}draw(t,e,i,n,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof lc)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=Br("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add";break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}}this.paragraphs.map(((e,s)=>{if(e instanceof lc)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof lc)break;const{width:n}=Br("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}let e=0;return this.paragraphs.map(((t,i)=>{e+=t instanceof lc?t.width:t.getWidthWithEllips(this.direction)})),e}}class uc{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=gr[this.direction]}store(t){if(t instanceof lc){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 cc(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 lc?"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=Ar(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 oc(i,t.newLine,t.character),new oc(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const dc=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...oa];class pc extends da{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=qa}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:cr.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:cr.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:cr.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:cr.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:cr.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:cr.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:cr.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:cr.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=fs(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updateRichTextAABBBounds(e,fs(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return cr[t]}needUpdateTags(t){return super.needUpdateTags(t,dc)}needUpdateTag(t){return super.needUpdateTag(t,dc)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:i,maxHeight:n,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:h,textAlign:l,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const i=e[t],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)p.push(n);else{const t=new lc(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else if(e[t].text.includes("\n")){const i=e[t].text.split("\n");for(let n=0;n<i.length;n++)p.push(new oc(i[n],0!==n,e[t]))}else p.push(new oc(e[t].text,!1,e[t]));const f=new sc(0,0,("number"==typeof i&&(!r||r>i)?i:r)||0,("number"==typeof n&&(!s||s>n)?n:s)||0,o,a,h,l,c,u||"horizontal","number"==typeof i&&(!r||r>i),"number"==typeof n&&(!s||s>n),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new uc(f);for(let t=0;t<p.length;t++)g.deal(p[t]);g.send(),this._frameCache=f}clone(){return new pc(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;e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n)})),r}getNoWorkAnimateAttr(){return pc.NOWORK_ANIMATE_ATTR}}pc.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},ua);const fc=["path","customPath",...oa];class gc extends da{constructor(t){super(t),this.type="path",this.numberType=Ga}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=fs(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Wn?e.path:(pe(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Wn?this.cache:t.path)}doUpdateAABBBounds(){const t=fs(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updatePathAABBBounds(e,fs(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;ye(t.path,!0)?this.cache=(new Wn).fromString(t.path):t.customPath&&(this.cache=new Wn,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fs(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,fc)}needUpdateTag(t){return super.needUpdateTag(t,fc)}toCustomPath(){return(new Wn).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new gc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gc.NOWORK_ANIMATE_ATTR}}gc.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},ua);const mc=["segments","points","curveType",...oa];class yc extends da{constructor(t){super(t),this.type="area",this.numberType=Ua}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=fs(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updateAreaAABBBounds(e,fs(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=to(i,n,e))}getDefaultAttribute(t){return fs(this).area[t]}needUpdateTags(t){return super.needUpdateTags(t,mc)}needUpdateTag(t){return super.needUpdateTag(t,mc)}toCustomPath(){const t=new Wn,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 yc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return yc.NOWORK_ANIMATE_ATTR}}yc.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},ua);const vc=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...oa];class bc extends da{constructor(t){super(t),this.type="arc",this.numberType=Ia}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=fs(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:i=t.outerRadius,innerRadius:n=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(i-n);return Math.min(xe(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=fs(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=ti(e),i=e+s,n&&Ue(s)<Le-Re){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));const{outerRadius:a=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute,l=Math.abs(a-h)/2,c=l/a;if(l>Re&&a>Re)return{startAngle:e-r*c*s,endAngle:i+r*c*o,sc:r*c*s,ec:r*c*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=fs(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:s=i.padAngle}=this.attribute,{padRadius:o=Ge(n*n+r*r)}=this.attribute,a=Ue(e-t);let h=t,l=e,c=t,u=e;const d=s/2;let p=a,f=a;if(d>Re&&o>Re){const i=e>t?1:-1;let s=Ye(Number(o)/r*ze(d)),a=Ye(Number(o)/n*ze(d));return(p-=2*s)>Re?(s*=i,c+=s,u-=s):(p=0,c=u=(t+e)/2),(f-=2*a)>Re?(a*=i,h+=a,l-=a):(f=0,h=l=(t+e)/2),{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=fs(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=fr.graphicService.updateArcAABBBounds(i,fs(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=qs(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,vc)}needUpdateTag(t){return super.needUpdateTag(t,vc)}getDefaultAttribute(t){return fs(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const s=Ue(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new Wn;if(r<=Re)a.moveTo(0,0);else if(s>=Le-Re)a.moveTo(0+r*We(e),0+r*ze(e)),a.arc(0,0,r,e,i,!o),n>Re&&(a.moveTo(0+n*We(i),0+n*ze(i)),a.arc(0,0,n,i,e,o));else{const t=r*We(e),s=r*ze(e),h=n*We(i),l=n*ze(i);a.moveTo(0+t,0+s),a.arc(0,0,r,e,i,!o),a.lineTo(0+h,0+l),a.arc(0,0,n,i,e,o),a.closePath()}return a}clone(){return new bc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return bc.NOWORK_ANIMATE_ATTR}}bc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},ua);class xc extends bc{constructor(t){super(t),this.type="arc3d",this.numberType=La}doUpdateAABBBounds(){const t=fs(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updateArc3dAABBBounds(e,fs(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return xc.NOWORK_ANIMATE_ATTR}}xc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},ua);const Ac=["points","cornerRadius",...oa];class Tc extends da{constructor(t){super(t),this.type="polygon",this.numberType=Ha}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=fs(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updatePolygonAABBBounds(e,fs(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=to(i,n,e))}getDefaultAttribute(t){return fs(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,Ac)}needUpdateTag(t){return super.needUpdateTag(t,Ac)}toCustomPath(){const t=this.attribute.points,e=new Wn;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 Tc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Tc.NOWORK_ANIMATE_ATTR}}Tc.NOWORK_ANIMATE_ATTR=ua;class Bc extends Tc{constructor(t){super(t),this.type="pyramid3d",this.numberType=Va}doUpdateAABBBounds(){const t=fs(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fr.graphicService.updatePyramid3dAABBBounds(e,fs(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=qs(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=$e.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=Fe(r,e);const o=$e.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=Fe(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 Bc.NOWORK_ANIMATE_ATTR}}Bc.NOWORK_ANIMATE_ATTR=ua;let Sc=class{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}};Sc=X([U()],Sc);const wc=Symbol.for("RectBoundsContribution");let _c=class extends Sc{};_c=X([U()],_c);const Cc=Symbol.for("SymbolBoundsContribution");let Pc=class extends Sc{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;_a(i,n+s+a/2,!0,o)}return i}};Pc=X([U()],Pc);const Mc=Symbol.for("CircleBoundsContribution");let Ec=class extends Sc{};Ec=X([U()],Ec);const kc=Symbol.for("ArcBoundsContribution");let Rc=class extends Sc{};Rc=X([U()],Rc);const Oc=Symbol.for("PathBoundsContribution");let Dc=class extends Sc{};Dc=X([U()],Dc);const Ic=Symbol.for("MatrixAllocate"),Lc=Symbol.for("Mat4Allocate");function Uc(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class Nc{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new ii(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 ii(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(...t){this.pools=[]}}class Wc{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 Wc.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(...t){this.pools=[]}}const Fc=new Nc,jc=new Wc;function zc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],h=e[7],l=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+l*n,t[5]=o*r+c*n,t[6]=a*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-o*n,t[10]=u*r-a*n,t[11]=d*r-h*n,t}function Gc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=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-l*n,t[1]=o*r-c*n,t[2]=a*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=o*n+c*r,t[10]=a*n+u*r,t[11]=h*n+d*r,t}function Hc(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,h,l,c,u,d,p,f,g,m,y;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],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],m=e[10],y=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=m,t[11]=y,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+u*r+g*s+e[13],t[14]=h*n+d*r+m*s+e[14],t[15]=l*n+p*r+y*s+e[15]),t}function Vc(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 Yc(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],y=e[14],v=e[15];let b=i[0],x=i[1],A=i[2],T=i[3];return t[0]=b*n+x*a+A*u+T*g,t[1]=b*r+x*h+A*d+T*m,t[2]=b*s+x*l+A*p+T*y,t[3]=b*o+x*c+A*f+T*v,b=i[4],x=i[5],A=i[6],T=i[7],t[4]=b*n+x*a+A*u+T*g,t[5]=b*r+x*h+A*d+T*m,t[6]=b*s+x*l+A*p+T*y,t[7]=b*o+x*c+A*f+T*v,b=i[8],x=i[9],A=i[10],T=i[11],t[8]=b*n+x*a+A*u+T*g,t[9]=b*r+x*h+A*d+T*m,t[10]=b*s+x*l+A*p+T*y,t[11]=b*o+x*c+A*f+T*v,b=i[12],x=i[13],A=i[14],T=i[15],t[12]=b*n+x*a+A*u+T*g,t[13]=b*r+x*h+A*d+T*m,t[14]=b*s+x*l+A*p+T*y,t[15]=b*o+x*c+A*f+T*v,t}function Xc(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:o=i.z,dx:a=i.dx,dy:h=i.dy,dz:l=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:m=e.attribute.anchor,anchor:y}=e.attribute,v=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=m[1];v[2]=null!==(n=m[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),Hc(t,t,[r+a,s+h,o+l]),Hc(t,t,[v[0],v[1],v[2]]),zc(t,t,f),Gc(t,t,p),Hc(t,t,[-v[0],-v[1],v[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=jc.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}Hc(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],h=e[3],l=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+l*n,t[1]=o*r+c*n,t[2]=a*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-o*n,t[6]=u*r-a*n,t[7]=d*r-h*n}(i,i,g),Hc(i,i,[-n[0],-n[1],0]),Yc(t,t,i)}}function qc(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t,e,i,n,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=i,this.circleBoundsContribitions=n,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new ne(["graphic"]),onSetStage:new ne(["graphic","stage"]),onRemove:new ne(["graphic"]),onRelease:new ne(["graphic"]),onAddIncremental:new ne(["graphic","group","stage"]),onClearIncremental:new ne(["graphic","group","stage"]),beforeUpdateAABBBounds:new ne(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new ne(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Qe,this.tempAABBBounds2=new Qe}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 Ei(t);return en(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){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._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),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{width:r,height:s,path:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),a||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateGlyphAABBBounds(t,e,i,n){return n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}updateRichTextAABBBounds(t,e,i,n){if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:h=e.textAlign,textBaseline:l=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:h}=t.getActualSize();let l=r||e||0,c=s||h||0;c="number"==typeof a&&c>a?a:c||0,l="number"==typeof o&&l>o?o:l||0,i.set(0,0,l,c)}let c=0;switch(l){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-i.height()}let u=0;switch(h){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),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){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:h=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(l){_a(s,l/Math.abs(a+h),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),Ze(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){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||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),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 h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){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){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}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,i,n){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){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||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),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>Le-Re?i.set(-o,-o,o,o):Zs(r,s,o,i),i}updateArcAABBBounds(t,e,i,n,r){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||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),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){const{outerRadius:r=e.outerRadius}=t;return i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;if(r<s){const t=r;r=s,s=t}let{endAngle:o=e.endAngle,startAngle:a=e.startAngle}=t;if(a>o){const t=a;a=o,o=t}return r<=Re?i.set(0,0,0,0):Math.abs(o-a)>Le-Re?i.set(-r,-r,r,r):(Zs(a,o,r,i),Zs(a,o,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){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||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),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(ve(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.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.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){const{scaleX:s=i.scaleX,scaleY:o=i.scaleY,stroke:a=i.stroke,shadowBlur:h=i.shadowBlur,lineWidth:l=i.lineWidth,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){_a(u,l/Math.abs(s+o),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(h){_a(u,h/Math.abs(s+o),n,c),e.union(u)}this.combindShadowAABBBounds(e,r),Ze(e,e,r.transMatrix)}},t.DefaultGraphicService=X([U(),q(0,I(Ja)),q(1,I(Jt)),q(1,N(wc)),q(2,I(Jt)),q(2,N(Cc)),q(3,I(Jt)),q(3,N(Mc)),q(4,I(Jt)),q(4,N(kc)),q(5,I(Jt)),q(5,N(Oc)),K("design:paramtypes",[Object,Object,Object,Object,Object,Object])],t.DefaultGraphicService);class Kc extends rh{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(t=!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 $c(t){return new bc(t)}function Zc(t){return new yc(t)}function Jc(t){return new jh(t)}function Qc(t){return new rh(t)}function tu(t){return new Ql(t)}function eu(t){return new gc(t)}function iu(t){return new ec(t)}function nu(t){return new nc(t)}function ru(t){return new Xh(t)}function su(t){return new Kh(t)}function ou(t){return new Zl(t)}function au(t){return new hc(t)}function hu(t){return new Tc(t)}function lu(t){return new Kc(t)}function cu(t){return new pc(t)}const uu={arc:$c,area:Zc,circle:Jc,group:Qc,image:au,line:tu,path:eu,rect:iu,rect3d:nu,symbol:ou,text:ru,richtext:cu,polygon:hu,shadowRoot:lu,wrapText:su},du=ru({text:""});const pu=cu({});function fu(e,i,n,r,s){var o;const{offsetX:a=0,offsetY:h=0,offsetZ:l=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+h,l),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+h,l)}else c&&(i=!i,e.lineTo(c.x+a,c.y+h,l))}t=n}else t=n}))}else g.forEach((t=>{t.defined?(f&&e.moveTo(t.p0.x+a,t.p0.y+h,l),yu(e,t,1,s),f=!1):f=!0}));return}if(n<=0)return;let m;"x"===r?m=t.Direction.ROW:"y"===r?m=t.Direction.COLUMN:"auto"===r&&(m=i.direction);const y=n*i.tryUpdateLength(m);let v=0,b=!0,x=null;for(let t=0,i=g.length;t<i;t++){const i=g[t],n=i.getLength(m),r=(y-v)/n;if(v+=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+h,l),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+h,l)}else s&&(b=!b,e.lineTo(s.x+a,s.y+h,l))}x=i}else{if(!i.defined){f=!0;continue}f&&e.moveTo(i.p0.x+a,i.p0.y+h,l),yu(e,i,je(r,1),s),f=!1}}}function gu(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 mu(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,h,l;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!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}function yu(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]=hn(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 vu(e,i,n,r){var s;const{drawConnect:o=!1,mode:a="none"}=r||{};if(o&&"none"===a)return;const{top:h,bottom:l}=i;if(n>=1){const t=[],i=[];let n=!0;if(o){let n,s,o=!0;const a=h.curves.length;h.curves.forEach(((h,c)=>{const u=l.curves[a-c-1];let d=h,p=u;if(h.originP1===h.originP2)return n=h,void(s=u);if(n&&n.originP1===n.originP2&&(d=n,p=s),h.defined)o||(t.push(d),i.push(p),bu(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=h;let a,l;n&&!1!==n.defined?(a=d,l=p):n&&!1!==s.defined&&(a=h,l=u),o?(o=!o,t.push(a||h),i.push(l||u)):a&&(o=!o,t.push(a||h),i.push(l||u),bu(e,t,i,r),t.length=0,i.length=0)}n=h})),bu(e,t,i,r)}else{for(let s=0,o=h.curves.length;s<o;s++){const a=h.curves[s];n!==a.defined?(n?(xu(e,t,i,r),t.length=0,i.length=0):(t.push(a),i.push(l.curves[o-s-1])),n=!n):n&&(t.push(a),i.push(l.curves[o-s-1]))}xu(e,t,i,r)}return}if(n<=0)return;let{direction:c}=r||{};const{curves:u}=h,d=null!==(s=u[u.length-1].p3)&&void 0!==s?s:u[u.length-1].p1,p=Ue(d.x-u[0].p0.x),f=Ue(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 m=0,y=!0;const v=[],b=[];let x,A,T=!0;for(let t=0,i=h.curves.length;t<i;t++){const n=h.curves[t],s=n.getLength(c),a=(g-m)/s;if(a<0)break;if(m+=s,o){const s=l.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){x=n,A=s;continue}if(x&&x.originP1===x.originP2&&(o=x,a=A),n.defined)T||(v.push(o),b.push(a),bu(e,v,b,r),v.length=0,b.length=0,T=!T);else{const{originP1:t,originP2:i}=n;let h,l;t&&!1!==t.defined?(h=o,l=a):t&&!1!==i.defined&&(h=n,l=s),T?(T=!T,v.push(h||n),b.push(l||s)):h&&(T=!T,v.push(h||n),b.push(l||s),bu(e,v,b,r),v.length=0,b.length=0)}x=n}else{let s=null,o=null;y!==n.defined?(y?(xu(e,v,b,r),v.length=0,b.length=0):(s=n,o=l.curves[i-t-1]),y=!y):y&&(s=n,o=l.curves[i-t-1]),s&&o&&(a<1&&(s=s.p2&&s.p3?hn(s,a)[0]:cn(s,a)[0],o=o.p2&&o.p3?hn(o,1-a)[1]:cn(o,1-a)[1]),s.defined=y,o.defined=y,v.push(s),b.push(o)),s=null,o=null}}o?bu(e,v,b,r):xu(e,v,b,r)}function bu(t,e,i,n){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=n||{};let h=e[0];t.moveTo(h.p0.x+r,h.p0.y+s,o),h=e[e.length-1];let l=h.p3||h.p1;t.lineTo(l.x+r,l.y+s,o),h=i[i.length-1],t.lineTo(h.p0.x+r,h.p0.y+s,o),h=i[0],l=h.p3||h.p1,t.lineTo(l.x+r,l.y+s,o),t.closePath()}function xu(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),Au(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(a&&t.lineTo(h.p0.x+r,h.p0.y+s,o),Au(t,h,1,n),a=!1):a=!0}t.closePath()}function Au(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]=hn(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 Tu(t,e,i){switch(e){case"linear":default:return mn(t,i);case"basis":return An(t,i);case"monotoneX":return Mn(t,i);case"monotoneY":return kn(t,i);case"step":return On(t,.5,i);case"stepBefore":return On(t,0,i);case"stepAfter":return On(t,1,i);case"linearClosed":return Ln(t,i)}}t.BaseRender=class{init(e){e&&(this.renderContribitions=e,this._renderContribitions=e.getContributions(),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,h,l,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}afterRenderStep(t,e,i,n,r,s,o,a,h,l,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}valid(t,e,i,n){const{fill:r=e.fill,background:s,stroke:o=e.stroke,opacity:a=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:l=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=yh(a,h,r),p=bh(a,c),f=gh(r,s),g=mh(o,l);return!(!t.valid||!u)&&(!(!f&&!g)&&(!!(d||p||i||n||s)&&{fVisible:d,sVisible:p,doFill:f,doStroke:g}))}transform(t,e,i,n=!1){const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:h=e.scaleX,scaleY:l=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,p=i.modelMatrix,f=i.camera,g={x:s,y:o,z:a,lastModelMatrix:p},m=f&&(n||qc(t));if(m){const n=jc.allocate(),r=jc.allocate();Xc(r,t,e),Yc(n,p||n,r),g.x=0,g.y=0,g.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),jc.free(r)}if(d&&!p){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,g.z=a,i.setTransformForCurrent()}else if(m)g.x=0,g.y=0,g.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(f&&i.project){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,this.transformWithoutTranslate(i,g.x,g.y,g.z,h,l,c)}else i.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}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),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+u.y*a.x+(c.y-u.y)*o.x)*d,f=(c.y*h.y+l.y*(a.y-h.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(l.x*(h.x-a.x)-c.x*h.x+u.x*a.x+(c.x-u.x)*o.x)*d,m=-(c.x*h.y+l.x*(a.y-h.y)-u.x*a.y+(u.x-c.x)*o.y)*d,y=(l.x*(u.y*a.x-c.y*h.x)+l.y*(c.x*h.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,v=(l.x*(u.y*a.y-c.y*h.y)+l.y*(c.x*h.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;n.setTransform(p,f,g,m,y,v,!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;s.highPerformanceSave();const o=this.transform(t,e,s,i),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,Ah(t,s,a,h,0,r)||(this.drawShape(t,s,a,h,n,r),this.z=0,s.modelMatrix!==c&&jc.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}},t.BaseRender=X([U()],t.BaseRender),t.DefaultCanvasArcRender=class extends t.BaseRender{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=Ia,this.init(t)}drawArcTailCapPath(t,e,i,n,r,s,o,a){const h=a-o,l=t.getParsedAngle(),c=l.startAngle;let u=l.endAngle;u=a;const d=Ue(u-c),p=u>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:m,innerDeltaAngle:y,outerStartAngle:v,outerEndAngle:b,innerEndAngle:x,innerStartAngle:A}=t.getParsePadAngle(c,u),T=g,B=g,S=g,w=g,_=Math.max(B,T),C=Math.max(S,w);let P=_,M=C;const E=r*We(v),k=r*ze(v),R=s*We(x),O=s*ze(x);let D,I,L,U;if((C>Re||_>Re)&&(D=r*We(b),I=r*ze(b),L=s*We(A),U=s*ze(A),d<Oe)){const t=Th(E,k,L,U,D,I,R,O);if(t){const e=E-t[0],i=k-t[1],n=D-t[0],o=I-t[1],a=1/ze(Ve((e*n+i*o)/(Ge(e*e+i*i)*Ge(n*n+o*o)))/2),h=Ge(t[0]*t[0]+t[1]*t[1]);M=je(C,(s-h)/(a-1)),P=je(_,(r-h)/(a+1))}}if(P>Re){const t=je(T,P),s=je(B,P),o=Bh(L,U,E,k,r,t,Number(p)),a=Bh(D,I,R,O,r,s,Number(p));if(P<_&&t===s)e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,P,Ne(o.y01,o.x01),Ne(a.y01,a.x01),!p);else{const t=u-h-.03,o=Ne(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,Ne(a.y11,a.x11),Ne(a.y01,a.x01),!p)}}else e.moveTo(i+E,n+k);if(!(s>Re)||y<.001)e.lineTo(i+R,n+O),f=!0;else if(M>Re){const t=je(w,M),r=je(S,M),o=Bh(R,O,D,I,s,-r,Number(p)),a=Bh(E,k,L,U,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),M<C&&t===r){const t=Ne(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,M,Ne(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,Ne(o.y01,o.x01),Ne(o.y11,o.x11),!p);const t=Ne(o.cy+o.y11,o.cx+o.x11),a=u-h-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*We(A),n+s*ze(A));return f}drawShape(t,e,i,n,r,s,o,a){const h=fs(t,null==s?void 0:s.theme).arc,{fill:l=h.fill,stroke:c=h.stroke,x:u=h.x,y:d=h.y}=t.attribute,p=this.valid(t,h,o,a);if(!p)return;const{fVisible:f,sVisible:g,doFill:m,doStroke:y}=p,{outerRadius:v=h.outerRadius,innerRadius:b=h.innerRadius,cap:x=h.cap,forceShowCap:A=h.forceShowCap}=t.attribute;let T=0;const B=(ue(x)&&x||x[0])&&"conical"===l.gradient;if(B){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();Ue(n-i)<Le-Re&&(T=e||0,l.startAngle-=T,l.endAngle-=T)}let S=!1;const{isFullStroke:w,stroke:_}=Ys(c);if((m||w)&&(e.beginPath(),Sh(t,e,i,n,v,b),S=!0,this.beforeRenderStep(t,e,i,n,m,y,f,g,h,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),m&&(o?o(e,t.attribute,h):f&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill())),y&&w&&(a?a(e,t.attribute,h):g&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,h),e.stroke()))),!w&&y&&(e.beginPath(),Sh(t,e,i,n,v,b,_),S||this.beforeRenderStep(t,e,i,n,m,y,f,g,h,r,o,a),a?a(e,t.attribute,h):g&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),(ue(x)&&x||x[1])&&A){const{startAngle:s,endAngle:l}=t.getParsedAngle();if(Ue(l-s)>=Le-Re){e.beginPath();const s=Math.abs(v-b)/2/v,{endAngle:l=h.endAngle,fill:c=h.fill}=t.attribute,u=l;if(this.drawArcTailCapPath(t,e,i,n,v,b,u,u+s),S||this.beforeRenderStep(t,e,i,n,m,y,f,g,h,r,o,a),m){const r=c;if("conical"===r.gradient){const s=Ph(0,0,l,r);o||yh&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=s,e.fill())}}y&&(a||g&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))}}this.afterRenderStep(t,e,i,n,m,y,f,g,h,r,o,a),B&&(l.startAngle+=T,l.endAngle+=T)}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}},t.DefaultCanvasArcRender=X([U(),q(0,I(Jt)),q(0,N(Mh)),K("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class extends t.BaseRender{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=Na,this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=fs(t,null==s?void 0:s.theme).circle,{radius:l=h.radius,startAngle:c=h.startAngle,endAngle:u=h.endAngle,x:d=h.x,y:p=h.y}=t.attribute,f=this.valid(t,h,o,a);if(!f)return;const{fVisible:g,sVisible:m,doFill:y,doStroke:v}=f;e.beginPath(),e.arc(i,n,l,c,u),e.closePath(),this.beforeRenderStep(t,e,i,n,y,v,g,m,h,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),y&&(o?o(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,d-i,p-n,h),e.fill())),v&&(a?a(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,y,v,g,m,h,r,o,a)}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}},t.DefaultCanvasCircleRender=X([U(),q(0,I(Jt)),q(0,N(kh)),K("design:paramtypes",[Object])],t.DefaultCanvasCircleRender),t.DefaultCanvasLineRender=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=za}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){var g,m,y,v,b;if(!e)return;t.beginPath();const x=null!==(g=this.z)&&void 0!==g?g:0;fu(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x}),d.cache&&!ve(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,o,a);const{x:A=0,x:T=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,o,A-c,T-u,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,o,A-c,T-u,a),t.stroke()));let{connectedType:B,connectedX:S,connectedY:w,connectedStyle:_}=o;if(ve(a)?(B=null!==(m=null!=B?B:a[0].connectedType)&&void 0!==m?m:a[1].connectedType,S=null!==(y=null!=S?S:a[0].connectedX)&&void 0!==y?y:a[1].connectedX,w=null!==(v=null!=w?w:a[0].connectedY)&&void 0!==v?v:a[1].connectedY,_=null!==(b=null!=_?_:a[0].connectedStyle)&&void 0!==b?b:a[1].connectedStyle):(B=null!=B?B:a.connectedType,S=null!=S?S:a.connectedX,w=null!=w?w:a.connectedY,_=null!=_?_:a.connectedStyle),"connect"!==B&&"zero"!==B&&(B="none"),"none"!==B){t.beginPath(),fu(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x,drawConnect:!0,mode:B,zeroX:S,zeroY:w});const g=[];ve(a)?a.forEach((t=>g.push(t))):g.push(a),g.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,_,A-c,T-u,g),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,_,A-c,T-u,g),t.stroke()))}return!1}drawShape(t,e,i,n,r,s,o,a){const h=fs(t,null==s?void 0:s.theme).line,{fill:l=h.fill,stroke:c=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:d=h.strokeOpacity}=t.attribute;if(!this.valid(t,h,o,a))return;if(t.shouldUpdateShape()){const{points:e,segments:i,closePath:n}=t.attribute;let{curveType:r=h.curveType}=t.attribute;n&&"linear"===r&&(r="linearClosed");const s=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 s=Nn(t.points,r,{startPoint:e});return n=s,s})).filter((t=>!!t)),"linearClosed"===r){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=Nn(s,r)}t.clearUpdateShapeTag()}const{clipRange:p=h.clipRange,clipRangeByDimension:f=h.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===p){let s=!1;t.cache.forEach(((g,m)=>{s||(s=this.drawSegmentItem(e,g,!!l,!!c,u,d,r[m],[h,t.attribute],p,f,i,n,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),g=p*s;let m=0,y=!1;t.cache.forEach(((s,p)=>{if(y)return;const v=s.getLength(),b=(g-m)/v;m+=v,b>0&&(y=this.drawSegmentItem(e,s,!!l,!!c,u,d,r[p],[h,t.attribute],je(b,1),f,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,u,d,t.attribute,h,p,f,i,n,t,o,a)}},t.DefaultCanvasLineRender=X([U()],t.DefaultCanvasLineRender),t.DefaultCanvasAreaRender=class extends t.BaseRender{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=Ua,this.init(t)}drawShape(t,e,i,n,r,s,o,a){var h,l,c,u,d,p;const f=fs(t,null==s?void 0:s.theme).area,{fillOpacity:g=f.fillOpacity,z:m=f.z,strokeOpacity:y=f.strokeOpacity}=t.attribute,v=this.valid(t,f,o,a);if(!v)return;const{doFill:b,doStroke:x}=v,{clipRange:A=f.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:i,closePath:n}=t.attribute;let{curveType:r=f.curveType}=t.attribute;if(n&&"linear"===r&&(r="linearClosed"),i&&i.length){let e,n;const s=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}),null;1===i?e={x:n.endX,y:n.endY}:i>1&&(e.x=n.endX,e.y=n.endY);const s=Tu(t.points,r,{startPoint:e});return n=s,s})).filter((t=>!!t));let o;const a=[];for(let t=i.length-1;t>=0;t--){const e=i[t].points,n=[];for(let t=e.length-1;t>=0;t--)n.push({x:null!==(h=e[t].x1)&&void 0!==h?h:e[t].x,y:null!==(l=e[t].y1)&&void 0!==l?l:e[t].y});if(0!==t){const e=i[t-1].points,r=e[e.length-1];r&&n.push({x:null!==(c=r.x1)&&void 0!==c?c:r.x,y:null!==(u=r.y1)&&void 0!==u?u:r.y})}o=Tu(n,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r),a.unshift(o)}t.cacheArea=a.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const i=e,n=[];for(let t=e.length-1;t>=0;t--)n.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const s=Tu(i,r),o=Tu(n,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r);t.cacheArea={top:s,bottom:o}}}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===A){let h=!1;t.cacheArea.forEach(((l,c)=>{h||(h=this.drawSegmentItem(e,l,b,g,x,y,s[c],[f,t.attribute],A,i,n,m,t,r,o,a))}))}else{const h=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=A*h;let c=0,u=!1;t.cacheArea.forEach(((h,d)=>{if(u)return;const p=h.top.getLength(),v=(l-c)/p;c+=p,v>0&&(u=this.drawSegmentItem(e,h,b,g,x,y,s[d],[f,t.attribute],je(v,1),i,n,m,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,b,g,x,y,t.attribute,f,A,i,n,m,t,r,o,a)}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,g){let m=!1;return m=m||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!1,f,g),m=m||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!0,f,g),m}_drawSegmentItem(e,i,n,r,s,o,a,h,l,c,u,d,p,f,g,m,y){var v,b,x,A;let{connectedType:T,connectedX:B,connectedY:S,connectedStyle:w}=a;const _=[];if(g&&(ve(h)?(T=null!==(v=null!=T?T:h[0].connectedType)&&void 0!==v?v:h[1].connectedType,B=null!==(b=null!=B?B:h[0].connectedX)&&void 0!==b?b:h[1].connectedX,S=null!==(x=null!=S?S:h[0].connectedY)&&void 0!==x?x:h[1].connectedY,w=null!==(A=null!=w?w:h[0].connectedStyle)&&void 0!==A?A:h[1].connectedStyle):(T=null!=T?T:h.connectedType,B=null!=B?B:h.connectedX,S=null!=S?S:h.connectedY,w=null!=w?w:h.connectedStyle),"connect"!==T&&"zero"!==T&&(T="none"),ve(h)?h.forEach((t=>_.push(t))):_.push(h),_.push(a)),g&&"none"===T)return!1;if(!i)return;e.beginPath();const{points:C,segments:P}=p.attribute;let M,E,k=t.Direction.ROW;if(P){const t=P[P.length-1];E=P[0].points[0],M=t.points[t.points.length-1]}else E=C[0],M=C[C.length-1];k=Ue(M.x-E.x)>Ue(M.y-E.y)?t.Direction.ROW:t.Direction.COLUMN,vu(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:u,offsetZ:d,direction:k,drawConnect:g,mode:T,zeroX:B,zeroY:S}),this.beforeRenderStep(p,e,c,u,!!r,!1,n,!1,h,f,m,null,{attribute:a}),e.setShadowStyle&&e.setShadowStyle(p,a,h);const{x:R=0,x:O=0}=a;if(!1!==n&&(m?m(e,a,h):r&&(e.setCommonStyle(p,g?w:a,R-c,O-u,g?_:h),e.fill())),this.afterRenderStep(p,e,c,u,!!r,!1,n,!1,h,f,m,null,{attribute:a}),!1!==s)if(y)y(e,a,h);else{const{stroke:n=h&&h[1]&&h[1].stroke}=a;ve(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),fu(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,k===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d,drawConnect:g,mode:T,zeroX:B,zeroY:S})),e.setStrokeStyle(p,g?w:a,R-c,O-u,g?_:h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=X([U(),q(0,I(Jt)),q(0,N(Eh)),K("design:paramtypes",[Object])],t.DefaultCanvasAreaRender),t.DefaultCanvasPathRender=class extends t.BaseRender{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=Ga,this.init(t)}drawShape(t,e,i,n,r,s,o,a){var h,l;const c=fs(t,null==s?void 0:s.theme).path,{x:u=c.x,y:d=c.y}=t.attribute,p=null!==(h=this.z)&&void 0!==h?h:0,f=this.valid(t,c,o,a);if(!f)return;const{fVisible:g,sVisible:m,doFill:y,doStroke:v}=f;if(e.beginPath(),t.pathShape)en(t.pathShape.commandList,e,i,n,1,1,p);else{en((null!==(l=t.attribute.path)&&void 0!==l?l:c.path).commandList,e,i,n,1,1,p)}this.beforeRenderStep(t,e,i,n,y,v,g,m,c,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,c),v&&(a?a(e,t.attribute,c):m&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,c),e.stroke())),y&&(o?o(e,t.attribute,c):g&&(e.setCommonStyle(t,t.attribute,u-i,d-n,c),e.fill())),this.afterRenderStep(t,e,i,n,y,v,g,m,c,r,o,a)}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).path;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPathRender=X([U(),q(0,I(Jt)),q(0,N(Dh)),K("design:paramtypes",[Object])],t.DefaultCanvasPathRender);const Bu=Oe/2;function Su(t,e,i,n,r,s){let o;if(xe(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:o=[0,0,0,0];break;case 1:o=[t[0],t[0],t[0],t[0]];break;case 2:case 3:o=[t[0],t[1],t[0],t[1]];break;default:o=t.slice(0,5)}}else o=[0,0,0,0];if(n<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,i,n,r);const[a,h,l,c]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],u=Math.min(n/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],p=[a[0]+d[0],a[1]],f=[a[0],a[1]+d[0]],g=[h[0]-d[1],h[1]],m=[h[0],h[1]+d[1]],y=[l[0]-d[2],l[1]],v=[l[0],l[1]-d[2]],b=[c[0]+d[3],c[1]],x=[c[0],c[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!Ce(g,m)){const e=g[0],i=g[1]+d[1];t.arc(e,i,d[1],-Bu,0,!1)}if(t.lineTo(v[0],v[1]),!Ce(y,v)){const e=v[0]-d[2],i=v[1];t.arc(e,i,d[2],0,Bu,!1)}if(t.lineTo(b[0],b[1]),!Ce(b,x)){const e=b[0],i=b[1]-d[3];t.arc(e,i,d[3],Bu,Oe,!1)}if(t.lineTo(f[0],f[1]),!Ce(p,f)){const e=p[0],i=p[1]+d[0];t.arc(e,i,d[0],Oe,Oe+Bu,!1)}return t.closePath(),t}function wu(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 _u(t,e){return Math.sqrt(t*t+e*e)}function Cu(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasRectRender=class extends t.BaseRender{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Ya,this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=fs(t,null==s?void 0:s.theme).rect,{fill:l=h.fill,background:c,stroke:u=h.stroke,width:d=h.width,height:p=h.height,cornerRadius:f=h.cornerRadius,opacity:g=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:b=h.visible,x:x=h.x,y:A=h.y}=t.attribute,T=vh(g,m,d,p,l),B=xh(g,v,d,p),S=gh(l,c),w=mh(u,y);if(!t.valid||!b)return;if(!S&&!w)return;if(!(T||B||o||a||c))return;0===f||ve(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(i,n,d,p)):(e.beginPath(),Su(e,i,n,d,p,f));const _={doFill:S,doStroke:w};this.beforeRenderStep(t,e,i,n,S,w,T,B,h,r,o,a,_),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),_.doFill&&(o?o(e,t.attribute,h):T&&(e.setCommonStyle(t,t.attribute,x-i,A-n,h),e.fill())),_.doStroke&&(a?a(e,t.attribute,h):B&&(e.setStrokeStyle(t,t.attribute,x-i,A-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,S,w,T,B,h,r,o,a)}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).rect;this._draw(t,r,!1,i,n)}},t.DefaultCanvasRectRender=X([U(),q(0,I(Jt)),q(0,N(Lh)),K("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends t.BaseRender{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Ka,this.init(t)}drawShape(t,e,i,n,r,s,o,a){var h;const l=fs(t,null==s?void 0:s.theme).symbol,{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY}=t.attribute,g=this.valid(t,l,o,a);if(!g)return;const{fVisible:m,sVisible:y,doFill:v,doStroke:b}=g,x=t.getParsedPath();if(!x)return;const{keepDirIn3d:A=l.keepDirIn3d}=t.attribute,T=null!==(h=this.z)&&void 0!==h?h:0;if(e.beginPath(),A&&e.camera&&e.project){const r=e.project(i,n,T),s=e.camera;e.camera=null,!1===x.draw(e,c,r.x,r.y,void 0,((r,s)=>{s.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,s,u-i,d-n),e.fill())),s.stroke&&(a?a(e,t.attribute,l):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f),e.stroke()))}))&&e.closePath(),e.camera=s}else!1===x.draw(e,c,i,n,T,((r,s)=>{s.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,s,u-i,d-n),e.fill())),s.stroke&&(a?a(e,t.attribute,l):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f),e.stroke()))}))&&e.closePath();this.beforeRenderStep(t,e,i,n,v,b,m,y,l,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),v&&!x.isSvg&&(o?o(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill())),b&&!x.isSvg&&(a?a(e,t.attribute,l):y&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(d-n)/f,l),e.stroke())),this.afterRenderStep(t,e,i,n,v,b,m,y,l,r,o,a)}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}},t.DefaultCanvasSymbolRender=X([U(),q(0,I(Jt)),q(0,N(Uh)),K("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender),t.DefaultCanvasTextRender=class extends t.BaseRender{constructor(t){super(),this.textRenderContribitions=t,this.numberType=$a,this.init(t)}drawShape(t,e,i,n,r,s,o,a){var h,l,c;const u=fs(t,null==s?void 0:s.theme).text,{text:d,fill:p=u.fill,stroke:f=u.stroke,fillOpacity:g=u.fillOpacity,strokeOpacity:m=u.strokeOpacity,opacity:y=u.opacity,lineWidth:v=u.lineWidth,visible:b=u.visible,underline:x=u.underline,lineThrough:A=u.lineThrough,keepDirIn3d:T=u.keepDirIn3d,direction:B=u.direction,fontSize:S=u.fontSize,verticalMode:w=u.verticalMode,x:_=u.x,y:C=u.y}=t.attribute;let{textAlign:P=u.textAlign,textBaseline:M=u.textBaseline}=t.attribute;if(!w&&"vertical"===B){const e=P;P=null!==(h=t.getBaselineMapAlign()[M])&&void 0!==h?h:"left",M=null!==(l=t.getAlignMapBaseline()[e])&&void 0!==l?l:"top"}const E=null!==(c=t.attribute.lineHeight)&&void 0!==c?c:S,k=this.valid(t,u,o,a);if(!k)return;const{fVisible:R,sVisible:O,doFill:D,doStroke:I}=k,L=!T,U=this.z||0;e.beginPath(),this.beforeRenderStep(t,e,i,n,D,I,R,O,u,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,u),L&&this.transformUseContext2d(t,u,U,e);const N=(r,s,h,l)=>{let c=i+s;const d=n+h;if(l){e.highPerformanceSave(),c+=S;const t=Fc.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Fc.free(t)}I&&(a?a(e,t.attribute,u):O&&(e.setStrokeStyle(t,t.attribute,_-i,C-n,u),e.strokeText(r,c,d,U))),D&&(o?o(e,t.attribute,u):R&&(e.setCommonStyle(t,t.attribute,_-i,C-n,u),e.fillText(r,c,d,U),this.drawUnderLine(x,A,t,c,d,U,u,e))),l&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(Array.isArray(d))if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,U),"horizontal"===B){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:h}=r.bbox;I&&(a?a(e,t.attribute,u):O&&(e.setStrokeStyle(t,t.attribute,_-i,C-n,u),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+i,(t.topOffset||0)+h+n,U)})))),D&&(o?o(e,t.attribute,u):R&&(e.setCommonStyle(t,t.attribute,_-i,C-n,u),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+i,(r.topOffset||0)+h+n,U),this.drawMultiUnderLine(x,A,t,(r.leftOffset||0)+i,(r.topOffset||0)+h+n,U,r.width,u,e)}))))}else{const i=t.cache,{verticalList:n}=i;e.textAlign="left",e.textBaseline="top";const r=E*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=Fe(e,s)}));let o=0,a=0;"bottom"===M?a=-r:"middle"===M&&(a=-r/2),"center"===P?o-=s/2:"right"===P&&(o-=s),n.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),n=s-i;let h=o;"center"===P?h+=n/2:"right"===P&&(h+=n),t.forEach((t=>{const{text:i,width:n,direction:s}=t;N(i,r-(e+1)*E+a,h,s),h+=n}))}))}else{const i=t.cache;if("horizontal"===B){e.setTextStyle(t.attribute,u,U);const i=t.clipedText;let n=0;E!==S&&("top"===M?n=(E-S)/2:"middle"===M||"bottom"===M&&(n=-(E-S)/2)),N(i,0,n,0)}else if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,u,U);const{verticalList:n}=i;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===M?o=-E:"middle"===M&&(o=-E/2),"center"===P?r-=s/2:"right"===P&&(r-=s),e.textAlign="left",e.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;N(e,o,r,n),r+=i}))}}L&&this.restoreTransformUseContext2d(t,u,U,e),this.afterRenderStep(t,e,i,n,D,I,R,O,u,r,o,a)}draw(t,e,i,n){const r=fs(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:h=o.textAlign,textBaseline:l=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,f=i.clipedWidth,g=Gh(h,f),m=Hh(l,c,c),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){y.lineWidth=t,a.setStrokeStyle(i,y,n,r,o),a.beginPath();const e=r+m+c;a.moveTo(n+g,e,s),a.lineTo(n+g+f,e,s),a.stroke()}if(e){y.lineWidth=e,a.setStrokeStyle(i,y,n,r,o),a.beginPath();const t=r+m+c/2;a.moveTo(n+g,t,s),a.lineTo(n+g+f,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,h){if(e+t<=0)return;const{textAlign:l=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,f=Gh(l,o),g=Hh("alphabetic",c,c),m={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let y=-3;if(t){m.lineWidth=t,h.setStrokeStyle(i,m,n,r,a),h.beginPath();const e=r+g+c+y;h.moveTo(n+f,e,s),h.lineTo(n+f+o,e,s),h.stroke()}if(y=-1,e){m.lineWidth=e,h.setStrokeStyle(i,m,n,r,a),h.beginPath();const t=r+g+c/2+y;h.moveTo(n+f,t,s),h.lineTo(n+f+o,t,s),h.stroke()}}},t.DefaultCanvasTextRender=X([U(),q(0,I(Jt)),q(0,N(Nh)),K("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{},t.AbstractGraphicRender=X([U()],t.AbstractGraphicRender),t.DefaultCanvasPolygonRender=class extends t.BaseRender{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=Ha,this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=fs(t,null==s?void 0:s.theme).polygon,{points:l=h.points,cornerRadius:c=h.cornerRadius,x:u=h.x,y:d=h.y,closePath:p=h.closePath}=t.attribute,f=this.valid(t,h,o,a);if(!f)return;const{fVisible:g,sVisible:m,doFill:y,doStroke:v}=f;e.beginPath(),c<=0||ve(c)&&c.every((t=>0===t))?wu(e.camera?e:e.nativeContext,l,i,n):function(t,e,i,n,r,s=!0){var o;if(e.length<3)return void wu(t,e,i,n);let a=0,h=e.length-1;s||(a+=1,h-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=a;s<=h;s++){const a=e[0===s?h:(s-1)%e.length],l=e[s%e.length],c=e[(s+1)%e.length],u=l.x-a.x,d=l.y-a.y,p=l.x-c.x,f=l.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,m=Math.abs(Math.tan(g));let y=Array.isArray(r)?null!==(o=r[s%e.length])&&void 0!==o?o:0:r,v=y/m;const b=_u(u,d),x=_u(p,f),A=Math.min(b,x);v>A&&(v=A,y=A*m);const T=Cu(l,v,b,u,d),B=Cu(l,v,x,p,f),S=2*l.x-T.x-B.x,w=2*l.y-T.y-B.y,_=_u(S,w),C=Cu(l,_u(v,y),_,S,w);let P=Math.atan2(T.y-C.y,T.x-C.x);const M=Math.atan2(B.y-C.y,B.x-C.x);let E=M-P;E<0&&(P=M,E=-E),E>Math.PI&&(E-=Math.PI),0===s?t.moveTo(T.x+i,T.y+n):t.lineTo(T.x+i,T.y+n),E&&t.arcTo(l.x+i,l.y+n,B.x+i,B.y+n,y),t.lineTo(B.x+i,B.y+n)}s||t.lineTo(e[h+1].x+i,e[h+1].y+n)}(e.camera?e:e.nativeContext,l,i,n,c,p),p&&e.closePath(),this.beforeRenderStep(t,e,i,n,y,v,g,m,h,r,o,a),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),y&&(o?o(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill())),v&&(a?a(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,y,v,g,m,h,r,o,a)}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPolygonRender=X([U(),q(0,I(Jt)),q(0,N(Ih)),K("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const Pu=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class extends t.BaseRender{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=ja,this.init(t)}drawShape(t,e,i,n,r,s,o){const a=fs(t).image,{width:h=a.width,height:l=a.height,repeatX:c=a.repeatX,repeatY:u=a.repeatY,cornerRadius:d=a.cornerRadius,image:p}=t.attribute,f=this.valid(t,a,o);if(!f)return;const{fVisible:g,sVisible:m,doFill:y,doStroke:v}=f;if(this.beforeRenderStep(t,e,i,n,y,!1,g,!1,a,r,o),e.setShadowStyle&&e.setShadowStyle(t,a),y)if(o)o(e,t.attribute,a);else if(g){if(!p||!t.resources)return;const r=t.resources.get(p);if("success"!==r.state)return;let s=!1;0===d||ve(d)&&d.every((t=>0===t))||(e.beginPath(),Su(e,i,n,h,l,d),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,i,n,a);let o=0;if("repeat"===c&&(o|=1),"repeat"===u&&(o|=2),o){const t=e.createPattern(r.data,Pu[o]);e.fillStyle=t,e.fillRect(i,n,h,l)}else e.drawImage(r.data,i,n,h,l);s&&e.restore()}this.afterRenderStep(t,e,i,n,y,!1,g,!1,a,r,o)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;if("success"!==t.resources.get(n).state)return;const{context:r}=e.drawParams;if(!r)return;const s=fs(t).image;this._draw(t,s,!1,i)}},t.DefaultCanvasImageRender=X([U(),q(0,I(Jt)),q(0,N(Oh)),K("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const Mu=Symbol.for("IncrementalDrawContribution"),Eu=Symbol.for("ArcRender"),ku=Symbol.for("Arc3dRender"),Ru=Symbol.for("AreaRender"),Ou=Symbol.for("CircleRender"),Du=Symbol.for("GraphicRender"),Iu=Symbol.for("GroupRender"),Lu=Symbol.for("LineRender"),Uu=Symbol.for("PathRender"),Nu=Symbol.for("PolygonRender"),Wu=Symbol.for("RectRender"),Fu=Symbol.for("Rect3DRender"),ju=Symbol.for("SymbolRender"),zu=Symbol.for("TextRender"),Gu=Symbol.for("RichTextRender"),Hu=Symbol.for("Pyramid3dRender"),Vu=Symbol.for("GlyphRender"),Yu=Symbol.for("ImageRender"),Xu=Symbol.for("RenderSelector"),qu=Symbol.for("DrawContribution");function Ku(t,e,i){let n=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),l=Math.sign(a)*Math.sqrt(o*o+a*a);return h+l===0?0:(n=n/Math.abs(h+l)*2*i,n)}function $u(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(ve(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o,a,h;const l=i.AABBBounds;if(!l)return;let c=l.x2-l.x1,u=l.y2-l.y1,d=l.x1-n,p=l.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!==(h=e.y1)&&void 0!==h?h: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,n=0,r=0){var s,o;const a=i.AABBBounds;if(!a)return;let h=a.x2-a.x1,l=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;h/=t,l/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*h,u+(null!==(o=e.y)&&void 0!==o?o:0)*l,e.startAngle,e.endAngle);let p;return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(h+c,l+u,p)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i,n=0,r=0){var s,o,a,h,l,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 m=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!==(h=e.x1)&&void 0!==h?h:.5)*d,g+(null!==(l=e.y1)&&void 0!==l?l:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{m.addColorStop(t.offset,t.color)})),m}(t,o,i,n,r)),s||"orange")}const Zu=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return Mr(Object.assign({nativeCanvas:fr.global.createCanvas(t)},t));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};return Mr(Object.assign({nativeCanvas:fr.global.createCanvas(e)},e))}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(...t){this.pools=[]}};t.DefaultBaseBackgroundRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{background:p}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=fs(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,h),e.drawImage(r.data,s.x1,s.y1,s.width(),s.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},t.DefaultBaseBackgroundRenderContribution=X([U()],t.DefaultBaseBackgroundRenderContribution),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,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=X([U(),q(0,I(Jt)),q(0,N(Wh)),K("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution),t.DefaultBaseTextureRenderContribution=class{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=Zu.allocate({width:t,height:t,dpr:1}),a=o.getContext("2d");if(!a)return null;a.clearRect(0,0,t,t),r(s,a);const h=n.createPattern(o.nativeCanvas,"repeat");return Zu.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,Le),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,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:m=h.texturePadding}=t.attribute;if(!p)return;let y=this.textureMap.get(p);if(!y)switch(p){case"circle":y=this.createCirclePattern(g,m,f,e);break;case"diamond":y=this.createDiamondPattern(g,m,f,e);break;case"rect":y=this.createRectPattern(g,m,f,e);break;case"vertical-line":y=this.createVerticalLinePattern(g,m,f,e);break;case"horizontal-line":y=this.createHorizontalLinePattern(g,m,f,e);break;case"bias-lr":y=this.createBiasLRLinePattern(g,m,f,e);break;case"bias-rl":y=this.createBiasRLLinePattern(g,m,f,e);break;case"grid":y=this.createGridPattern(g,m,f,e)}y&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=y,e.fill(),e.highPerformanceRestore())}},t.DefaultBaseTextureRenderContribution=X([U()],t.DefaultBaseTextureRenderContribution),t.DefaultArcRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerRadius:m=h.innerRadius,outerRadius:y=h.outerRadius,startAngle:v=h.startAngle,endAngle:b=h.endAngle,opacity:x=h.opacity,x:A=h.x,y:T=h.y,scaleX:B=h.scaleX,scaleY:S=h.scaleY}=t.attribute,w=!(!d||!d.stroke),_=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=Ku(e,r,e.dpr),o=r/y;if(t.setAttributes({outerRadius:y+s,innerRadius:m-s,startAngle:v-o,endAngle:b+o}),e.beginPath(),Sh(t,e,i,n,y+s,m-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(w){const r=h.outerBorder.opacity;h.outerBorder.opacity=x,e.setStrokeStyle(t,d,(A-i)/B,(T-n)/S,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Ku(e,r,e.dpr),o=r/y;if(t.setAttributes({outerRadius:y-s,innerRadius:m+s,startAngle:v+o,endAngle:b-o}),e.beginPath(),Sh(t,e,i,n,y-s,m+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(_){const r=h.innerBorder.opacity;h.innerBorder.opacity=x,e.setStrokeStyle(t,p,(A-i)/B,(T-n)/S,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:y,innerRadius:m,startAngle:v,endAngle:b})}},t.DefaultArcRenderContribution=X([U()],t.DefaultArcRenderContribution),t.DefaultArcBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultArcBackgroundRenderContribution=X([U()],t.DefaultArcBackgroundRenderContribution),t.DefaultArcTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultArcTextureRenderContribution=X([U()],t.DefaultArcTextureRenderContribution),t.DefaultCircleRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,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:m=h.radius,startAngle:y=h.startAngle,endAngle:v=h.endAngle,opacity:b=h.opacity,x:x=h.x,y:A=h.y,scaleX:T=h.scaleX,scaleY:B=h.scaleY}=t.attribute,S=!(!d||!d.stroke),w=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=Ku(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,m+s,y,v),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(S){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/T,(A-n)/B,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Ku(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,m-s,y,v),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(w){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/T,(A-n)/B,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultCircleRenderContribution=X([U()],t.DefaultCircleRenderContribution),t.DefaultCircleBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultCircleBackgroundRenderContribution=X([U()],t.DefaultCircleBackgroundRenderContribution),t.DefaultCircleTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultCircleTextureRenderContribution=X([U()],t.DefaultCircleTextureRenderContribution),t.DefaultGroupBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{background:d}=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;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}},t.DefaultGroupBackgroundRenderContribution=X([U()],t.DefaultGroupBackgroundRenderContribution),t.DefaultImageBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{background:d,width:p,height:f}=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=fs(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;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(ge(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:h,y:l,width:c,height:u}=function(t){const e=qs(t.attribute.boundsPadding),i=t.AABBBounds;let n=i.x1,r=i.y1,s=i.width(),o=i.height();xe(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]);return{x:n,y:r,width:s,height:o}}(t);s?Su(e,h-o,l-a,c+2*o,u+2*a,s):e.rect(h-o,l-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()}}},t.DefaultImageBackgroundRenderContribution=X([U()],t.DefaultImageBackgroundRenderContribution),t.DefaultRectRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{width:m=h.width,height:y=h.height,cornerRadius:v=h.cornerRadius,opacity:b=h.opacity,x:x=h.x,y:A=h.y,scaleX:T=h.scaleX,scaleY:B=h.scaleY}=t.attribute,S=!(!d||!d.stroke),w=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=Ku(e,r,e.dpr),o=i-s,a=n-s,l=2*s;if(0===v||ve(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,m+l,y+l)):(e.beginPath(),Su(e,o,a,m+l,y+l,v)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(S){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/T,(A-n)/B,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Ku(e,r,e.dpr),o=i+s,a=n+s,l=2*s;if(0===v||ve(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,m-l,y-l)):(e.beginPath(),Su(e,o,a,m-l,y-l,v)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(w){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/T,(A-n)/B,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultRectRenderContribution=X([U()],t.DefaultRectRenderContribution),t.DefaultRectBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultRectBackgroundRenderContribution=X([U()],t.DefaultRectBackgroundRenderContribution),t.DefaultRectTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultRectTextureRenderContribution=X([U()],t.DefaultRectTextureRenderContribution),t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=X([U()],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,h,l,c,u){const{width:d=h.width,height:p=h.height,stroke:f=h.stroke}=t.attribute;if(Array.isArray(f)&&f.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),e.beginPath(),e.moveTo(i,n),f[0]?e.lineTo(i+d,n):e.moveTo(i+d,n),f[1]?e.lineTo(i+d,n+p):e.moveTo(i+d,n+p),f[2]?e.lineTo(i,n+p):e.moveTo(i,n+p),f[3]){const t=f[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=X([U()],t.SplitRectAfterRenderContribution),t.DefaultSymbolRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,m=f&&!1!==f.visible;if(!g&&!m)return;const{size:y=h.size,opacity:v=h.opacity,x:b=h.x,y:x=h.y,scaleX:A=h.scaleX,scaleY:T=h.scaleY}=t.attribute,B=!(!p||!p.stroke),S=!(!f||!f.stroke);if(g){const{distance:r=h.outerBorder.distance}=p,s=Ku(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,y,i,n,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.outerBorder);else if(B){const r=h.outerBorder.opacity;h.outerBorder.opacity=v,e.setStrokeStyle(t,p,(b-i)/A,(x-n)/T,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=f,s=Ku(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,y,i,n,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,f,h.innerBorder);else if(S){const r=h.innerBorder.opacity;h.innerBorder.opacity=v,e.setStrokeStyle(t,f,(b-i)/A,(x-n)/T,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultSymbolRenderContribution=X([U()],t.DefaultSymbolRenderContribution);class Ju extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}}class Qu extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}}const td=Symbol.for("RenderService"),ed=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(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)}},t.DefaultRenderService=X([U(),q(0,I(qu)),K("design:paramtypes",[Object])],t.DefaultRenderService);var id=new n((e=>{e(t.DefaultRenderService).toSelf(),e(td).toService(t.DefaultRenderService)}));const nd=Symbol.for("GraphicPicker"),rd=Symbol.for("PickerService"),sd=Symbol.for("BoundsPicker"),od=Symbol.for("GlobalPickerService");t.DefaultGlobalPickerService=class{constructor(t){this.global=t,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 ii(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 Ke(e.x,e.y);i.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const h=!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 Ke(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||!h||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],t.DefaultGlobalPickerService);const ad=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){if(!t.shadowRoot)return null;const{parentMatrix:s}=r||{};if(!s)return null;const o=e.pickContext;o.highPerformanceSave();const a=t.shadowRoot,h=Fc.allocateByObj(s),l=new Ke(i.x,i.y);s.transformPoint(l,l);const c=t.transMatrix;h.multiply(c.a,c.b,c.c,c.d,c.e,c.f);const u=e.pickGroup(a,l.clone(),h,n);return o.highPerformanceRestore(),u}},t.ShadowRootPickItemInterceptorContribution=X([U()],t.ShadowRootPickItemInterceptorContribution),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,h=!1;if(t.forEachChildren((t=>(a=t.numberType===La,!a))),t.forEachChildren((t=>(h=!!t.findFace,!h))),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+=Le;for(;a<0;)a+=Le;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(h){const a=t.getChildren(),h=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})));h.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),h.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),h.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,o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}},t.Canvas3DPickItemInterceptor=X([U()],t.Canvas3DPickItemInterceptor);var hd=new n((e=>{e(rd).toService(od),e(t.DefaultGlobalPickerService).toSelf().inSingletonScope(),e(od).toService(t.DefaultGlobalPickerService),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(ad).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(ad).toService(t.ShadowRootPickItemInterceptorContribution),te(e,ad)})),ld=new n((e=>{e(t.DefaultGraphicService).toSelf().inSingletonScope(),e(Za).toService(t.DefaultGraphicService),e(_c).toSelf().inSingletonScope(),e(wc).toService(_c),te(e,wc),e(Pc).toSelf().inSingletonScope(),e(Cc).toService(Pc),te(e,Cc),e(Ec).toSelf().inSingletonScope(),e(Mc).toService(Ec),te(e,Mc),e(Rc).toSelf().inSingletonScope(),e(kc).toService(Rc),te(e,kc),e(Dc).toSelf().inSingletonScope(),e(Oc).toService(Dc),te(e,Oc),e(Ja).toConstantValue(uu)}));const cd=Symbol.for("AutoEnablePlugins"),ud=Symbol.for("PluginService");let dd=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&&_r.isBound(cd)&&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))}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};dd=X([U(),q(0,I(Jt)),q(0,N(cd)),K("design:paramtypes",[Object])],dd);var pd=new n((t=>{t(dd).toSelf(),t(ud).toService(dd),ee(t,cd)})),fd=new n((t=>{te(t,re)})),gd=new n((e=>{e(t.DefaultTextMeasureContribution).toSelf().inSingletonScope(),e(wr).toService(t.DefaultTextMeasureContribution),te(e,wr)}));let md=class{constructor(t){this.global=t,this.type="static",this.offscreen=!1}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,t=i.canvasId?this.global.getElementById(i.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Mr({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,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()}};md=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],md);let yd=class{constructor(t){this.global=t,this.type="virtual",this.offscreen=!1}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(){}};yd=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],yd);let vd=class{constructor(t){this.global=t,this.type="dynamic",this.offscreen=!0}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const n=Mr({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},e),{x:0,y:0,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,{x:s=0,y:o=0,width:a=this.layer.viewWidth,height:h=this.layer.viewHeight}=i;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,o,a,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,h),n.nativeContext.restore()}merge(t){}};vd=X([U(),q(0,I(se)),K("design:paramtypes",[Object])],vd);var bd=new n((t=>{t(md).toSelf(),t(vd).toSelf(),t(yd).toSelf(),t(lh).toService(md),t(ch).toService(vd),t(uh).toService(yd)}));function xd(t,e,i,n=!1,r=!1){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],h=s[e];r&&h.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<h.length;t++)if(i(h[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}function Ad(t,e,i,n=!1){return $(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function Td(t,e,i,n=!1){const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return o=!0,!0;return!1}),n);let a=null,h=!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(h){o=!0,a=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(a=t,!0):(t._uid===e&&(h=!0),!1)),n);return a}const Bd=Symbol.for("DrawItemInterceptor"),Sd=new Qe;let wd=class{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.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){Sd.copy(n.dirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e)}return n.renderGroup(t.shadowRoot,i),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(Sd),!0}};wd=X([U()],wd);let _d=class{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&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();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}};_d=X([U()],_d);let Cd=class{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){let s;if(t.attribute.interactive){s=t.interactiveGraphic,s||(s=t.clone(),t.interactiveGraphic=s);const e=t.globalTransMatrix;s.setAttributes({x:0,y:0,scaleX:1,scaleY:1,angle:0,postMatrix:e,interactive:!1},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const n=i.stage.getLayer("_builtin_interactive");return n&&n.add(s),!0}if(s){i.stage.tryInitInteractiveLayer();const t=i.stage.getLayer("_builtin_interactive");t&&t.removeChild(s)}return!1}};Cd=X([U()],Cd);let Pd=class{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 h=jc.allocate();Vc(h,a);const l=s.modelMatrix;if(l){if(h){const t=jc.allocate();s.modelMatrix=Yc(t,l,h)}}else s.modelMatrix=h;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===La,!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+=Le;for(;a<0;)a+=Le;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",n.renderGroup(t,i),i.hack_pieFace="inside",n.renderGroup(t,i),i.hack_pieFace="top",n.renderGroup(t,i),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,!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)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==l&&jc.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};Pd=X([U()],Pd);let Md=class{constructor(t,e,i,n){this.contributions=t,this.renderSelector=e,this.layerService=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Je,this.backupDirtyBounds=new Je}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))}draw(t,e){e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,x:r=0,y:s=0,width:o,height:a}=e;if(!i)return;const h=this.dirtyBounds.setValue(0,0,o,a);if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(l=h,c=n.dirtyBounds,u=!1,null===l?c:null===c?l:(fi=l.x1,gi=l.x2,mi=l.y1,yi=l.y2,vi=c.x1,bi=c.x2,xi=c.y1,Ai=c.y2,u&&(fi>gi&&(fi=(d=[gi,fi])[0],gi=d[1]),mi>yi&&(mi=(p=[yi,mi])[0],yi=p[1]),vi>bi&&(vi=(f=[bi,vi])[0],bi=f[1]),xi>Ai&&(xi=(g=[Ai,xi])[0],Ai=g[1])),fi>=bi||gi<=vi||mi>=Ai||yi<=xi?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(fi,vi),y1:Math.max(mi,xi),x2:Math.min(gi,bi),y2:Math.min(yi,Ai)}));h.x1=Math.floor(t.x1),h.y1=Math.floor(t.y1),h.x2=Math.ceil(t.x2),h.y2=Math.ceil(t.y2)}var l,c,u,d,p,f,g;this.backupDirtyBounds.copy(h),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);const m=h.width()*i.dpr!==i.canvas.width||h.height()*i.dpr!==i.canvas.height;i.save(),i.translate(r,s,!0),m&&(i.beginPath(),i.rect(h.x1,h.y1,h.width(),h.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:Zn.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Zn.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),i.restore(),i.restore(),i.draw(),i.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=Td(e,i,Zn.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i){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(!_i(t.AABBBounds,this.dirtyBounds,!1))return;const n=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{var n;i?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):xd(t,Zn.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(n=e.context)||void 0===n?void 0:n.camera))}}),this.dirtyBounds.copy(n)}_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||_r.get(Mu);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 h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._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:h._uid,break:!1}))}}getRenderContribution(t){let e=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),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;if(!t.isContainer&&!_i(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=r),r?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),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 console.warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){const{clear:n}=i;if(n){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=i,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=$u(e,n,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}afterDraw(t,e){}};X([I(se),K("design:type",Object)],Md.prototype,"global",void 0),X([Kt(),K("design:type",Function),K("design:paramtypes",[]),K("design:returntype",void 0)],Md.prototype,"init",null),Md=X([U(),q(0,L(Du)),q(1,I(Xu)),q(2,I(hh)),q(3,I(Jt)),q(3,N(Bd)),K("design:paramtypes",[Array,Object,Object,Object])],Md);let Ed=class{selector(t){return null}};Ed=X([U()],Ed);let kd=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Fa}drawShape(e,i,n,r,s,o,a,h){const l=fs(e,null==o?void 0:o.theme).group,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:m=l.clip,fillOpacity:y=l.fillOpacity,strokeOpacity:v=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:A=l.lineWidth,visible:T=l.visible}=e.attribute,B=vh(p,y,f,g,c),S=xh(p,v,f,g),w=gh(c,u),_=mh(d,A);if(!e.valid||!T)return;if(!m){if(!w&&!_)return;if(!(B||S||a||h||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||ve(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),Su(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const C={doFill:w,doStroke:_};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,w,_,B,S,l,s,a,h,C)})),m&&i.clip(),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),C.doFill&&(a?a(i,e.attribute,l):B&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fill())),C.doStroke&&(h?h(i,e.attribute,l):S&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())),this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,w,_,B,S,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=fs(t,null==n?void 0:n.theme).group,a=r.modelMatrix;if(r.camera){const e=jc.allocate(),i=jc.allocate();Xc(i,t,o),Yc(e,a||e,i),r.modelMatrix=e,jc.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:h=o.scrollX,scrollY:l=o.scrollY}=t.attribute;let c;(h||l)&&r.translate(h,l),n&&n.drawingCb&&(c=n.drawingCb()),r.modelMatrix!==a&&jc.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};kd=X([U(),q(0,I(Jt)),q(0,N(Rh)),K("design:paramtypes",[Object])],kd);let Rd=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=za}drawShape(t,e,i,n,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=fs(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:m=l.visible}=t.attribute,y=yh(d,p,c),v=bh(d,f),b=gh(c),x=mh(u,g);if(!t.valid||!m)return;if(!b&&!x)return;if(!(y||v||o||a))return;const{context:A}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,A,h[r-1],h[r],t.attribute.segments[r],[l,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(),gu(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};Rd=X([U()],Rd);let Od=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=Ua}drawShape(t,e,i,n,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const l=fs(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,f=yh(d,u,c),g=gh(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,h[r-1],h[r],t.attribute.segments[r],[l,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(),mu(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};var Dd;Od=X([U()],Od),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Dd||(Dd={}));let Id=class extends Md{constructor(t,e,i,n,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=i,this.areaRender=n,this.layerService=r,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=Dd.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new ne([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return $(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,x:r=0,y:s=0}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r,s,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Zn.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Zn.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 $(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return $(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>$(this,void 0,void 0,(function*(){if(2!==t.count)yield Ad(t,Zn.zIndex,((i,n)=>{if(this.status===Dd.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 $(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return $(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return $(this,void 0,void 0,(function*(){this.rendering&&(this.status=Dd.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Dd.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 $(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:()=>$(this,void 0,void 0,(function*(){yield Ad(t,Zn.zIndex,(t=>$(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};X([I(se),K("design:type",Object)],Id.prototype,"global",void 0),Id=X([U(),q(0,L(Du)),q(1,I(Xu)),q(2,I(Rd)),q(3,I(Od)),q(4,I(hh)),q(5,I(Jt)),q(5,N(Bd)),K("design:paramtypes",[Array,Object,Object,Object,Object,Object])],Id);let Ld=class extends t.BaseRender{constructor(){super(...arguments),this.type="rect3d",this.numberType=Xa}drawShape(t,e,i,n,r,s,o,a){var h;const l=fs(t,null==s?void 0:s.theme).rect3d,{fill:c=l.fill,stroke:u=l.stroke,width:d=l.width,height:p=l.height,opacity:f=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:y=l.strokeOpacity,visible:v=l.visible}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=vh(f,g,d,p,c),A=xh(f,y,d,p),T=gh(c),B=mh(u,m);if(!t.valid||!v)return;if(!T&&!B)return;if(!(x||A||o||a))return;const{light:S,camera:w}=r.stage||{},_=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,_,r,e,S,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,_,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]},h=s[n[1]],l={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,o,a,h){const l=Lo.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]],m={x:e+d[0],y:i+d[1],z:n+d[2]},y={x:e+p[0],y:i+p[1],z:n+p[2]},v={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(m.x,m.y,m.z),o.lineTo(y.x,y.y,y.z),o.lineTo(v.x,v.y,v.z),o.lineTo(b.x,b.y,b.z),o.closePath(),h?h(o,null,null):(o.fillStyle=a?a.computeColor(u,l):s,o.fill())}))}draw(t,e,i){const n=fs(t).rect;this._draw(t,n,!1,i)}};Ld=X([U()],Ld);let Ud=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=qa}drawShape(t,e,i,n,r){const s=fs(t).richtext,{width:o=s.width,height:a=s.height,opacity:h=s.opacity,fillOpacity:l=s.fillOpacity,visible:c=s.visible}=t.attribute;if(!t.valid||!c)return;if(!yh(h,l,!0))return;e.translate(i,n);t.getFrameCache().draw(e,this.drawIcon)}drawIcon(t,e,i,n,r){var s;const o=fs(t).richtextIcon,{width:a=o.width,height:h=o.height,opacity:l=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:m}=t.attribute,{backgroundWidth:y=a,backgroundHeight:v=h}=t.attribute;if(m&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-a)/2,r=(v-h)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,y,v)):(e.beginPath(),Su(e,i-t,n-r,y,v,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=l,e.drawImage(b.data,i,n,a,h))}draw(t,e,i){const n=fs(t).richtext;this._draw(t,n,!1,i)}};Ud=X([U()],Ud);let Nd=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=Wa}drawShape(t,e,i,n,r,s,o,a){const h=fs(t),l=t.getSubGraphic();l.length&&l.forEach((t=>{r.drawContribution.renderItem(t,r,{theme:h})}))}draw(t,e,i,n){const r=fs(t).glyph;this._draw(t,r,!1,i,n)}};Nd=X([U()],Nd);let Wd=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=La}drawShape(e,i,n,r,s,o,a,h){var l;const c=fs(e,null==o?void 0:o.theme).arc,{fill:u=c.fill}=e.attribute,d=this.valid(e,c,a,h);if(!d)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:m}=d,y=null!==(l=this.z)&&void 0!==l?l:0,{outerRadius:v=c.outerRadius,innerRadius:b=c.innerRadius,height:x=10}=e.attribute,A=Lo.Get(u,t.ColorType.Color255),{light:T}=s.stage||{},B=s.hack_pieFace,S={top:y,bottom:y+x},w={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===B||"top"===B?(i.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=Ue(h-a),c=h>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=Re)e.moveTo(i,n,r);else if(l>=Le-Re)e.moveTo(i+s*We(a),n+s*ze(a),r),e.arc(i,n,s,a,h,!c,r),o>Re&&(e.moveTo(i+o*We(h),n+o*ze(h),r),e.arc(i,n,o,h,a,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:m}=t.getParsePadAngle(a,h),y=s*We(p),v=s*ze(p),b=o*We(g),x=o*ze(g);l<.001?u=!0:(e.moveTo(i+y,n+v,r),e.arc(i,n,s,p,f,!c,r)),!(o>Re)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,m,c,r))}e.closePath()}(e,i,n,r,S[B],v,b),i.setShadowStyle&&i.setShadowStyle(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(w[B],A):u,i.fill())),m&&(h?h(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke()))):"outside"!==B&&"inside"!==B||("inside"===B&&(i.save(),i.beginPath(),i.arc(n,r,b,0,Le,!0,S.top),i.clip()),i.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=Ue(l-h),u=l>h;let d=!1;if(o<=Re)e.moveTo(i,n,r);else if(c>=Le-Re)e.moveTo(i+o*We(h),n+o*ze(h),r),e.arc(i,n,o,h,l,!u,r),e.lineTo(i+o*We(l),n+o*ze(l),s),e.arc(i,n,o,l,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(h,l),f=o*We(c),g=o*ze(c),m=o*We(p),y=o*ze(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!u,r),e.lineTo(i+m,n+y,s),e.arc(i,n,o,p,c,u,s))}e.closePath()}(e,i,n,r,S.top,S.bottom,"outside"===B?v:b,((t,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:h}=e.getParsePadAngle(t,i);return"outside"===B?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:h}})),i.setShadowStyle&&i.setShadowStyle(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(w[B],A):u,i.fill())),m&&(h?h(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())),"inside"===B&&i.restore())}draw(t,e,i,n){const r=fs(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}};Wd=X([U()],Wd);let Fd=class extends t.BaseRender{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Va}drawShape(t,e,i,n,r,s,o,a){var h;const l=fs(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(h=this.z)&&void 0!==h?h:0;if(!this.valid(t,l,o,a))return;const{light:f,camera:g}=r.stage||{},m=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,p,m,d,r,e,f,g,t,l,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,p,m,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a=s[n[1]],h={x:t+o[0],y:e+o[1],z:i+o[2]},l={x:t+a[0],y:e+a[1],z:i+a[2]};r.beginPath(),r.moveTo(h.x,h.y,h.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,o,a,h,l,c,u,d){const p=Lo.Get(o,t.ColorType.Color255),f=r.vertices,g=f.map((t=>a.view(t[0],t[1],t[2])[2])),m=[];r.polygons.forEach(((t,e)=>{if(!s[e])return;m.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=g[i[0]],o=g[i[1]],a=g[i[2]],h=g[i[3]];t.ave_z=r+o+a+h})),m.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),m.forEach((t=>{const{polygon:r,normal:s}=t.polygon,l=f[r[0]],g=f[r[1]],m=f[r[2]],y=f[r[3]],v={x:e+l[0],y:i+l[1],z:n+l[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]},x={x:e+m[0],y:i+m[1],z:n+m[2]},A={x:e+y[0],y:i+y[1],z:n+y[2]};a.beginPath(),a.moveTo(v.x,v.y,v.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.lineTo(A.x,A.y,A.z),a.closePath(),d?d(a,c.attribute,u):(a.fillStyle=h?h.computeColor(s,p):o,a.fill())}))}draw(t,e,i){const n=fs(t).polygon;this._draw(t,n,!1,i)}};Fd=X([U()],Fd);let jd=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};jd=X([U()],jd);let zd=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};zd=X([U()],zd);let Gd=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};Gd=X([U()],Gd);let Hd=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};Hd=X([U()],Hd);let Vd=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};Vd=X([U()],Vd);let Yd=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){var p,f,g,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:y=t.attribute}=d||{},{texture:v=(null!==(p=t.attribute.texture)&&void 0!==p?p:no(h,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:no(h,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:no(h,"textureSize")),texturePadding:A=(null!==(m=t.attribute.texturePadding)&&void 0!==m?m:no(h,"texturePadding"))}=y;if(!v)return;let T=this.textureMap.get(v);if(!T)switch(v){case"circle":T=this.createCirclePattern(x,A,b,e);break;case"diamond":T=this.createDiamondPattern(x,A,b,e);break;case"rect":T=this.createRectPattern(x,A,b,e);break;case"vertical-line":T=this.createVerticalLinePattern(x,A,b,e);break;case"horizontal-line":T=this.createHorizontalLinePattern(x,A,b,e);break;case"bias-lr":T=this.createBiasLRLinePattern(x,A,b,e);break;case"bias-rl":T=this.createBiasRLLinePattern(x,A,b,e);break;case"grid":T=this.createGridPattern(x,A,b,e)}T&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=T,e.fill(),e.highPerformanceRestore())}};Yd=X([U()],Yd);var Xd=new n((e=>{e(Md).toSelf(),e(qu).toService(Md),e(Id).toSelf(),e(Mu).toService(Id),e(Ed).toSelf(),e(Xu).toService(Ed),e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(Ou).to(t.DefaultCanvasCircleRender),e(Du).to(t.DefaultCanvasCircleRender),e(t.DefaultCircleRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleTextureRenderContribution).toSelf().inSingletonScope(),e(kh).toService(t.DefaultCircleRenderContribution),e(kh).toService(t.DefaultCircleBackgroundRenderContribution),e(kh).toService(t.DefaultCircleTextureRenderContribution),te(e,kh),e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(Wu).to(t.DefaultCanvasRectRender),e(Du).to(t.DefaultCanvasRectRender),e(Ld).toSelf().inSingletonScope(),e(Fu).toService(Ld),e(Du).toService(Fu),e(t.DefaultRectRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectTextureRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectBeforeRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectAfterRenderContribution).toSelf().inSingletonScope(),e(Lh).toService(t.DefaultRectRenderContribution),e(Lh).toService(t.DefaultRectBackgroundRenderContribution),e(Lh).toService(t.DefaultRectTextureRenderContribution),e(Lh).toService(t.SplitRectBeforeRenderContribution),e(Lh).toService(t.SplitRectAfterRenderContribution),te(e,Lh),e(t.DefaultCanvasTextRender).toSelf().inSingletonScope(),e(zu).to(t.DefaultCanvasTextRender),e(Du).to(t.DefaultCanvasTextRender),te(e,Nh),e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(Uu).to(t.DefaultCanvasPathRender),e(Du).to(t.DefaultCanvasPathRender),e(Gd).toSelf().inSingletonScope(),e(Hd).toSelf().inSingletonScope(),e(Dh).toService(Gd),e(Dh).toService(Hd),te(e,Dh),e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(ju).to(t.DefaultCanvasSymbolRender),e(Du).to(t.DefaultCanvasSymbolRender),e(t.DefaultSymbolRenderContribution).toSelf().inSingletonScope(),e(Ju).toSelf().inSingletonScope(),e(Qu).toSelf().inSingletonScope(),e(Uh).toService(t.DefaultSymbolRenderContribution),e(Uh).toService(Ju),e(Uh).toService(Qu),te(e,Uh),e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(Eu).to(t.DefaultCanvasArcRender),e(Du).to(t.DefaultCanvasArcRender),e(Wd).toSelf().inSingletonScope(),e(ku).toService(Wd),e(Du).toService(ku),e(t.DefaultArcRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcTextureRenderContribution).toSelf().inSingletonScope(),e(Mh).toService(t.DefaultArcRenderContribution),e(Mh).toService(t.DefaultArcBackgroundRenderContribution),e(Mh).toService(t.DefaultArcTextureRenderContribution),te(e,Mh),e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Lu).to(t.DefaultCanvasLineRender),e(Du).to(t.DefaultCanvasLineRender),e(Rd).toSelf().inSingletonScope(),e(Od).toSelf().inSingletonScope(),e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(Ru).to(t.DefaultCanvasAreaRender),e(Du).to(t.DefaultCanvasAreaRender),e(Vd).toSelf().inSingletonScope(),e(Yd).toSelf().inSingletonScope(),e(Eh).toService(Vd),e(Eh).toService(Yd),te(e,Eh),e(kd).toSelf().inSingletonScope(),e(Iu).to(kd),e(Du).to(kd),e(t.DefaultGroupBackgroundRenderContribution).toSelf().inSingletonScope(),e(Rh).toService(t.DefaultGroupBackgroundRenderContribution),te(e,Rh),e(t.DefaultCanvasPolygonRender).toSelf().inSingletonScope(),e(Nu).to(t.DefaultCanvasPolygonRender),e(Du).to(t.DefaultCanvasPolygonRender),e(jd).toSelf().inSingletonScope(),e(zd).toSelf().inSingletonScope(),e(Ih).toService(jd),e(Ih).toService(zd),te(e,Ih),e(Nd).toSelf().inSingletonScope(),e(Vu).toService(Nd),e(Du).toService(Vu),e(t.DefaultCanvasImageRender).toSelf().inSingletonScope(),e(Yu).toService(t.DefaultCanvasImageRender),e(Du).toService(Yu),e(t.DefaultImageBackgroundRenderContribution).toSelf().inSingletonScope(),e(Oh).toService(t.DefaultImageBackgroundRenderContribution),te(e,Oh),e(Ud).toSelf().inSingletonScope(),e(Gu).toService(Ud),e(Du).toService(Gu),e(Fd).toSelf().inSingletonScope(),e(Hu).toService(Fd),e(Du).toService(Hu),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),e(Nh).toService(t.DefaultBaseInteractiveRenderContribution),e(Mh).toService(t.DefaultBaseInteractiveRenderContribution),e(Dh).toService(t.DefaultBaseInteractiveRenderContribution),e(Uh).toService(t.DefaultBaseInteractiveRenderContribution),e(Lh).toService(t.DefaultBaseInteractiveRenderContribution),e(Oh).toService(t.DefaultBaseInteractiveRenderContribution),e(kh).toService(t.DefaultBaseInteractiveRenderContribution),e(Eh).toService(t.DefaultBaseInteractiveRenderContribution),e(Ih).toService(t.DefaultBaseInteractiveRenderContribution),te(e,Wh),te(e,Du),e(wd).toSelf().inSingletonScope(),e(Bd).toService(wd),e(_d).toSelf().inSingletonScope(),e(Bd).toService(_d),e(Pd).toSelf().inSingletonScope(),e(Bd).toService(Pd),e(Cd).toSelf().inSingletonScope(),e(Bd).toService(Cd),te(e,Bd)}));_r.load(fh),_r.load(ld),_r.load(id),_r.load(hd),_r.load(pd),function(t){t.load(fd),t.load(gd),t.load(bd)}(_r),function(t){t.load(Xd)}(_r);const qd=_r.get(se);fr.global=qd;const Kd=_r.get(ah);fr.graphicUtil=Kd;const $d=_r.get(oh);fr.transformUtil=$d;const Zd=_r.get(Za);fr.graphicService=Zd;const Jd=_r.get(od),Qd=_r.get(hh);fr.layerService=Qd;class tp{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=ms.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,fr.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),fr.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){fr.graphicService.hooks.onAttributeUpdate.taps=fr.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),fr.graphicService.hooks.onSetStage.taps=fr.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class ep{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=ms.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 ip{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=ms.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,fr.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))})),fr.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){fr.graphicService.hooks.onAddIncremental.taps=fr.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),fr.graphicService.hooks.onClearIncremental.taps=fr.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,fr.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({x:t.x,y:t.y,width:i.viewWidth,height:i.viewHeight,stage:t,layer:i,clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class np{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=ms.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)})),fr.graphicService.hooks.onRelease.tap(this.key,(t=>{this.removeDom(t)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key))}drawHTML(t){"browser"===fr.global.env&&t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Zn.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Zn.zIndex)})).forEach((t=>{this.renderGroupHTML(t)}))}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeDom(t){t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear())}renderGraphicHTML(t){const{html:e}=t.attribute;if(!e)return void(t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear()));const i=t.stage;if(!i)return;const{dom:n,container:r,width:s,height:o,style:a,anchorType:h="boundsLeftTop"}=e;t.bindDom||(t.bindDom=new Map);const l=t.bindDom.get(n);if(l&&(!r||r===l.container))return;let c,u;t.bindDom.forEach((({wrapGroup:t})=>{fr.global.removeDom(t)})),c="string"==typeof n?(new DOMParser).parseFromString(n,"text/xml").firstChild:n;const d=r||(!0===i.params.enableHtmlAttribute?null:i.params.enableHtmlAttribute);u=d?"string"==typeof d?fr.global.getElementById(d):d:t.stage.window.getContainer();const p=fr.global.createDom({tagName:"div",width:s,height:o,style:a,parent:u});p&&(p.appendChild(c),t.bindDom.set(n,{dom:c,container:r,wrapGroup:p})),p.style.pointerEvents="none",p.style.position||(p.style.position="absolute",u.style.position="relative");let f=0,g=0;if("position"===h){const e=t.transMatrix;f=e.e,g=e.f}else{const e=t.AABBBounds;f=e.x1,g=e.y1}const m=fr.global.getElementTopLeft(u,!1),y=i.window.getTopLeft(!1),v=f+y.left-m.left,b=g+y.top-m.top;p.style.left=`${v}px`,p.style.top=`${b}px`}}const rp=new Qe;class sp{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=ms.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()})),fr.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&&(rp.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(rp,t.parent&&t.parent.globalTransMatrix)))})),fr.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))})),fr.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){fr.graphicService.hooks.beforeUpdateAABBBounds.taps=fr.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),fr.graphicService.hooks.afterUpdateAABBBounds.taps=fr.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)),fr.graphicService.hooks.onRemove.taps=fr.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}class op{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=ms.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new Qe}tryLayout(t){const e=t.parent;if(!e||!t.needUpdateLayout())return;const i=fs(e).group,{display:n=i.display}=e.attribute;if("flex"!==n)return;const{flexDirection:r=i.flexDirection,flexWrap:s=i.flexWrap,justifyContent:o=i.justifyContent,alignItems:a=i.alignItems,alignContent:h=i.alignContent,clip:l=i.clip}=e.attribute;let c=0,u=0,d=0;if(e.forEachChildren((t=>{const e=t.AABBBounds;"column"===r||"column-reverse"===r?(u+=e.height(),c=Math.max(c,e.width())):(c+=e.width(),u=Math.max(u,e.height())),d+=e.x1,d+=e.y1,d+=e.x2,d+=e.y2})),!isFinite(d))return;const p=e.attribute.width||c,f=e.attribute.height||u;e.attribute.width||(e.attribute.width=0),e.attribute.height||(e.attribute.height=0),this.tempBounds.copy(e._AABBBounds);const g={main:{len:p,field:"x"},cross:{len:f,field:"y"},dir:1},m=g.main,y=g.cross;"row-reverse"===r?g.dir=-1:"column"===r?(m.len=f,y.len=p,m.field="y",y.field="x"):"column-reverse"===r&&(m.len=f,y.len=p,m.field="y",y.field="x",g.dir=-1);let v=0,b=0;const x=[];e.forEachChildren((t=>{const e=t.AABBBounds,i="x"===m.field?e.width():e.height(),n="x"===y.field?e.width():e.height();x.push({mainLen:i,crossLen:n}),v+=i,b=Math.max(b,n)}));const A=[];if(v>m.len&&"wrap"===s){let t=0,e=0;x.forEach((({mainLen:i,crossLen:n},r)=>{t+i>m.len?0===t?(A.push({idx:r,mainLen:t+i,crossLen:n}),t=0,e=0):(A.push({idx:r-1,mainLen:t,crossLen:n}),t=i,e=n):(t+=i,e=Math.max(e,n))})),A.push({idx:x.length-1,mainLen:t,crossLen:e})}else A.push({idx:x.length-1,mainLen:v,crossLen:b});const T=e.getChildren();let B=0;if(A.forEach((t=>{this.layoutMain(e,T,o,m,x,B,t),B=t.idx+1})),b=A.reduce(((t,e)=>t+e.crossLen),0),1===A.length)if("flex-end"===a){const t=y.len;this.layoutCross(T,a,y,t,x,A[0],0)}else if("center"===a){const t=y.len/2;this.layoutCross(T,a,y,t,x,A[0],0)}else T.forEach((t=>{t.attribute[y.field]=ap(t,y.field)}));else if("flex-start"===h){B=0;let t=0;A.forEach(((e,i)=>{this.layoutCross(T,"flex-start",y,t,x,A[i],B),B=e.idx+1,t+=e.crossLen}))}else if("center"===h){B=0;let t=Math.max(0,(y.len-b)/2);A.forEach(((e,i)=>{this.layoutCross(T,"center",y,t+e.crossLen/2,x,A[i],B),B=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){B=0;const t=Math.max(0,(y.len-b)/A.length/2);let e=t;A.forEach(((i,n)=>{this.layoutCross(T,"flex-start",y,e,x,A[n],B),B=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){B=0;const t=Math.max(0,(y.len-b)/(2*A.length-2));let e=0;A.forEach(((i,n)=>{this.layoutCross(T,"flex-start",y,e,x,A[n],B),B=i.idx+1,e+=i.crossLen+2*t}))}T.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),e.addUpdateLayoutTag(),l||this.tempBounds.equals(e.AABBBounds)||this.tryLayout(e)}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+ap(e[i],n.field),t+=r[i].mainLen}else if("flex-end"===i){let t=n.len;for(let i=s;i<=o.idx;i++)t-=r[i].mainLen,e[i].attribute[n.field]=t+ap(e[i],n.field)}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+ap(e[i],n.field),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++)e[t].attribute[n.field]=a+ap(e[t],n.field),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++)e[i].attribute[n.field]=t+ap(e[i],n.field),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++)e[t].attribute[n.field]=a+ap(e[t],n.field),a+=r[t].mainLen+2*i}}layoutCross(t,e,i,n,r,s,o){if("flex-end"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen+ap(t[e],i.field);else if("center"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen/2+ap(t[e],i.field);else for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n+ap(t[e],i.field)}activate(t){this.pluginService=t,Zd.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)})),Zd.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)}))}deactivate(t){Zd.hooks.onAttributeUpdate.taps=Zd.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),Zd.hooks.onSetStage.taps=Zd.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}function ap(t,e){if(!t.attribute.boundsPadding)return 0;if("number"==typeof(i=t.attribute.boundsPadding)&&Number.isFinite(i))return t.attribute.boundsPadding;if(ve(t.attribute.boundsPadding)&&1===t.attribute.boundsPadding.length)return t.attribute.boundsPadding[0];var i;const n=qs(t.attribute.boundsPadding);return"x"===e?n[3]:"y"===e?n[0]:0}const hp=new Os;hp.addTimeline(Ls);hp.setFPS(60);class lp{constructor(e,i,n=.8){this.dir=e,this.color=i,this.colorRgb=Lo.Get(i,t.ColorType.Color1),this.ambient=n;const r=Ge(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=je(Fe((e[0]*n[0]+e[1]*n[1]+e[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=ye(i)?Lo.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 cp(t,e,i,n){let r,s,o,a,h,l,c,u,d,p;const f=e[0],g=e[1],m=e[2],y=n[0],v=n[1],b=n[2],x=i[0],A=i[1],T=i[2];return Math.abs(f-x)<Re&&Math.abs(g-A)<Re&&Math.abs(m-T)<Re?Wc.identity(t):(c=f-x,u=g-A,d=m-T,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=v*d-b*u,s=b*c-y*d,o=y*u-v*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,h=d*r-c*o,l=c*s-u*r,p=Math.hypot(a,h,l),p?(p=1/p,a*=p,h*=p,l*=p):(a=0,h=0,l=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+o*m),t[13]=-(a*f+h*g+l*m),t[14]=-(c*f+u*g+d*m),t[15]=1,t)}function up(t,e,i,n,r,s,o){const a=1/(e-i),h=1/(n-r),l=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*h,t[14]=(o+s)*l,t[15]=1,t}function dp(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],y=e[14],v=e[15];let b=i[0],x=i[1],A=i[2],T=i[3];return t[0]=b*n+x*a+A*u+T*g,t[1]=b*r+x*h+A*d+T*m,t[2]=b*s+x*l+A*p+T*y,t[3]=b*o+x*c+A*f+T*v,b=i[4],x=i[5],A=i[6],T=i[7],t[4]=b*n+x*a+A*u+T*g,t[5]=b*r+x*h+A*d+T*m,t[6]=b*s+x*l+A*p+T*y,t[7]=b*o+x*c+A*f+T*v,b=i[8],x=i[9],A=i[10],T=i[11],t[8]=b*n+x*a+A*u+T*g,t[9]=b*r+x*h+A*d+T*m,t[10]=b*s+x*l+A*p+T*y,t[11]=b*o+x*c+A*f+T*v,b=i[12],x=i[13],A=i[14],T=i[15],t[12]=b*n+x*a+A*u+T*g,t[13]=b*r+x*h+A*d+T*m,t[14]=b*s+x*l+A*p+T*y,t[15]=b*o+x*c+A*f+T*v,t}function pp(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 fp{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=jc.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=jc.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return cp(this._viewMatrixCached,t,e,i),this._vp||(this._vp=jc.allocate()),this._vp=dp(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=jc.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=jc.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return up(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=jc.allocate()),this._vp=dp(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 pp(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;pp(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]}}}const gp="white";class mp extends rh{set viewBox(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}get viewBox(){return this._viewBox}get x(){return this._viewBox.x1}set x(t){this._viewBox.translate(t-this._viewBox.x1,0)}get y(){return this._viewBox.y1}set y(t){this._viewBox.translate(0,t-this._viewBox.y1)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this._viewBox.width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this._viewBox.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:gp}set background(t){this._background=t}get defaultLayer(){return this.at(0)}constructor(t){var e;super({}),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 ds,this.hooks={beforeRender:new ne(["stage"]),afterRender:new ne(["stage"])},this.global=_r.get(se),this.window=_r.get(dh),this.renderService=_r.get(td),this.pickerService=_r.get(rd),this.pluginService=_r.get(ud),this.layerService=_r.get(hh),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this._viewBox=new Qe,t.viewBox?this._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):this._viewBox.setValue(0,0,this.width,this.height),this.state="normal",this.renderCount=0,this._subView=!(this._viewBox.width()===this.width&&this._viewBox.height()===this.height),this._background=null!==(e=t.background)&&void 0!==e?e:gp,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,this.global.supportEvent&&(this.eventSystem=new Ps({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,viewport:{viewBox:this._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}})),t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),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||hp,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Is,this.ticker.addTimeline(this.timeline),this.timeline.pause(),this.optmize(t.optimize)}optmize(t){this.optmizeRender(null==t?void 0:t.skipRenderWithOutRange)}optmizeRender(t=!0){t&&(this._skipRender=this.window.isVisible()?0:1,this.window.onVisibleChange((t=>{t?(this.dirtyBounds&&this.dirtyBounds.setValue(0,0,this._viewBox.width(),this._viewBox.height()),this._skipRender>1&&this.renderNextFrame(),this._skipRender=0):this._skipRender=1})))}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:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=a,{dir:g=[1,1,-1],color:m="white",ambient:y}=h,v=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[v,b,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(o=l.dz)&&void 0!==o?o:0)];let A=0,T=0,B=0;c||(A=Math.sin(u)+v,T=Math.sin(d)+b,B=Math.cos(u)*Math.cos(d)*1),this.light=new lp(g,m,y);const S={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[A,T,B],center:x,up:[0,1,0]}};this.camera?this.camera.params=S:this.camera=new fp(S),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 ep))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new tp))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new ip))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Je;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new sp,this.pluginService.register(t)),t.activate(this.pluginService)}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new op))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new np))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{t.deactivate(this.pluginService)})))}tryUpdateAABBBounds(){const t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t){const e=this.layerService.createLayer(this,{main:!1,layerMode:t});return this.appendChild(e),e}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(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){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.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){}renderNextFrame(t,e){("rendering"!==this.state||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(){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.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear()),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},Object.assign({renderStyle:this.renderStyle},e)))}))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){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,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){const i=this.pickerService.pick(this.children,new Ke(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.eventSystem&&this.eventSystem.release(),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){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,e){this.forEachChildren(((i,n)=>{i.drawTo(t,Object.assign(Object.assign({},e),{renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!!this.dirtyBounds}))}))}renderToNewWindow(t=!0,e){const i=_r.get(dh);if(t)i.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""});else{const t=e?e.width():Math.min(this.viewWidth,this.window.width-this.x),n=e?e.height():Math.min(this.viewHeight,this.window.height-this.y);i.create({width:t,height:n,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""})}const n=e?-e.x1:0,r=e?-e.y1:0;return this.renderTo(i,{x:n,y:r,width:e?e.x2:i.width,height:e?e.y2:i.height}),i}toCanvas(t=!0,e){const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t)}getCursor(){return this._cursor}}var yp;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(yp||(yp={}));const vp=new ii(1,0,0,1,0,0),bp={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new ii(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new ii(1,0,0,1,0,0),this.path=new Wn}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Fc.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(Fc.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Fc.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){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,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){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,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=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(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,o=!0){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,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){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},bp),function(t,e,i){return rs(t,0,!1,e,i)}(this.path.commandList,bp.x,bp.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},bp);const i=Ku(this,this.lineWidth,this.dpr);return function(t,e,i,n){return rs(t,e,!0,i,n)}(this.path.commandList,i,bp.x,bp.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(t=!0,e=this.dpr){this.setTransformFromMatrix(vp,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Fc.free(t))),this.stack.length=0}},t.EmptyContext2d=X([U(),K("design:paramtypes",[Object,Number])],t.EmptyContext2d);const xp={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){const{nativeCanvas:e,width:i=xp.WIDTH,height:n=xp.HEIGHT,dpr:r=xp.DPR,x:s,y:o,canvasControled:a=!0}=t;this._x=null!=s?s:0,this._y=null!=o?o:0,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=a,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._id=e.id,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(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BaseCanvas.env="browser",t.BaseCanvas=X([U(),K("design:paramtypes",[Object])],t.BaseCanvas),t.BaseEnvContribution=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Qe}removeDom(t){return!1}createDom(t){return null}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=X([U()],t.BaseEnvContribution),t.BaseWindowHandlerContribution=class{constructor(){this._uid=ms.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}},t.BaseWindowHandlerContribution=X([U(),K("design:paramtypes",[])],t.BaseWindowHandlerContribution),t.DefaultPickService=class{constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e,this.type="default"}_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;let r=0,s=0;if(i&&i.bounds){if(!i.bounds.contains(e.x,e.y))return n;r=i.bounds.x1,s=i.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new ii(1,0,0,1,r,s);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){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=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=jc.allocate();if(Vc(i,e),o){if(i){const t=jc.allocate();s.modelMatrix=Yc(t,o,i),jc.free(i)}}else Vc(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&&jc.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,h=Fc.allocateByObj(i),l=new Ke(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,l.clone(),i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params);const d=!1!==t.attribute.pickable&&c;return h.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u&&u.graphic||xd(t,Zn.zIndex,(s=>{if(s.isContainer){const i=new Ke(e.x,e.y),o=fs(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;i.x-=a,i.y-=l,r=this.pickGroup(s,i,h,n)}else{const o=new Ke(e.x,e.y);h.transformPoint(o,o);const a=fs(t).group,{scrollX:l=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=l,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&&jc.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),Fc.free(h),r}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=X([U(),q(0,I(se)),q(1,I(Jt)),q(1,N(ad)),K("design:paramtypes",[Object,Object])],t.DefaultPickService),t.ACustomAnimate=Us,t.ARC3D_NUMBER_TYPE=La,t.ARC_NUMBER_TYPE=Ia,t.AREA_NUMBER_TYPE=Ua,t.Animate=Ws,t.AnimateGroup=class extends Us{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?Ds[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Us{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?Ds[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Application=pr,t.Arc=bc,t.Arc3d=xc,t.Arc3dRender=ku,t.ArcRender=Eu,t.ArcRenderContribution=Mh,t.Area=yc,t.AreaRender=Ru,t.AreaRenderContribution=Eh,t.AttributeAnimate=class extends Us{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=cd,t.Basis=bn,t.BeforeRenderConstribution=ed,t.BoundsContext=Ei,t.BoundsPicker=sd,t.CIRCLE_NUMBER_TYPE=Na,t.CanvasFactory=Cr,t.CanvasTextLayout=Vh,t.CbAnimate=Ns,t.Circle=jh,t.CircleRender=Ou,t.CircleRenderContribution=kh,t.ClipAngleAnimate=class extends ao{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g,m;const y=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},v=null!==(a=y.width)&&void 0!==a?a:0,b=null!==(h=y.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",A=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,T=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let B=0,S=0;"anticlockwise"===T?(S="in"===x?A+2*Math.PI:A,S=A+2*Math.PI):(B=A,S="out"===x?A+2*Math.PI:A);const w=fr.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:v/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!==(m=null==r?void 0:r.radius)&&void 0!==m?m:(v+b)/2,innerRadius:0,startAngle:B,endAngle:S,fill:!0});let _,C;"anticlockwise"===T?(_={startAngle:A+2*Math.PI},C={startAngle:A}):(_={endAngle:A},C={endAngle:A+2*Math.PI}),super("in"===x?_:C,"in"===x?C:_,i,n,{group:null==r?void 0:r.group,clipGraphic:w})}},t.ClipDirectionAnimate=class extends ao{constructor(t,e,i,n,r){var s,o,a,h,l,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!==(h=null!==(a=null==r?void 0:r.width)&&void 0!==a?a:f.width)&&void 0!==h?h:0,m=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:f.height)&&void 0!==c?c:0,y=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",v=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=fr.graphicService.creator.rect({x:0,y:0,width:"in"===y&&"x"===v?0:g,height:"in"===y&&"y"===v?0:m,fill:!0});let A={},T={};"y"===v?"negative"===b?(A={y:m,height:0},T={y:0,height:m}):(A={height:0},T={height:m}):"negative"===b?(A={x:g,width:0},T={x:0,width:g}):(A={width:0},T={width:g}),super("in"===y?A:T,"in"===y?T:A,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=ao,t.ClipRadiusAnimate=class extends ao{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g;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,v=null!==(h=m.height)&&void 0!==h?h:0,b=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,A=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((y/2)**2+(v/2)**2),T=fr.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:v/2,outerRadius:"out"===b?A:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),B={outerRadius:x},S={outerRadius:A};super("in"===b?B:S,"in"===b?S:B,i,n,{group:null==r?void 0:r.group,clipGraphic:T})}},t.ColorInterpolate=_h,t.ColorStore=Lo,t.Container=qt,t.ContainerModule=n,t.Context2dFactory=Pr,t.ContributionProvider=Jt,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 un(new Ke(this._lastX,this._lastY),new Ke(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new ln(new Ke(this._lastX,this._lastY),new Ke(t,e),new Ke(i,n),new Ke(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=Ts,t.CustomPath2D=Wn,t.CustomSymbolClass=Xl,t.DefaultArcAttribute=Jn,t.DefaultAreaAttribute=Qn,t.DefaultAttribute=Zn,t.DefaultCircleAttribute=tr,t.DefaultConnectAttribute=Kn,t.DefaultDebugAttribute=$n,t.DefaultFillStyle=Hn,t.DefaultGlyphAttribute=ir,t.DefaultGroupAttribute=er,t.DefaultImageAttribute=ur,t.DefaultLayout=zn,t.DefaultLineAttribute=nr,t.DefaultMat4Allocate=Wc,t.DefaultMatrixAllocate=Nc,t.DefaultMorphingAnimateConfig=Gs,t.DefaultPathAttribute=rr,t.DefaultPolygonAttribute=sr,t.DefaultRect3dAttribute=ar,t.DefaultRectAttribute=or,t.DefaultRichTextAttribute=cr,t.DefaultRichTextIconAttribute=dr,t.DefaultStateAnimateConfig=zs,t.DefaultStrokeStyle=Yn,t.DefaultStyle=qn,t.DefaultSymbolAttribute=hr,t.DefaultSymbolBackgroundRenderContribution=Ju,t.DefaultSymbolTextureRenderContribution=Qu,t.DefaultTextAttribute=lr,t.DefaultTextStyle=Xn,t.DefaultTicker=Os,t.DefaultTimeline=Is,t.DefaultTransform=Gn,t.DrawContribution=qu,t.DynamicLayerHandlerContribution=ch,t.EnvContribution=re,t.EventManager=ws,t.EventSystem=Ps,t.EventTarget=_s,t.FadeInPlus=class extends Us{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=oo.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 oo.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case oo.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case oo.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case oo.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=vs,t.FederatedMouseEvent=bs,t.FederatedPointerEvent=xs,t.FederatedWheelEvent=As,t.GLYPH_NUMBER_TYPE=Wa,t.GRAPHIC_UPDATE_TAG_KEY=oa,t.GROUP_NUMBER_TYPE=Fa,t.Generator=ms,t.GlobalPickerService=od,t.Glyph=rc,t.GlyphRender=Vu,t.Graphic=da,t.GraphicAnimate=class extends Us{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=Ja,t.GraphicPicker=nd,t.GraphicRender=Du,t.GraphicService=Za,t.GraphicUtil=ah,t.Group=rh,t.GroupFadeIn=class extends Us{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 Us{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=Iu,t.GroupRenderContribution=Rh,t.IMAGE_NUMBER_TYPE=ja,t.Image=hc,t.ImageRender=Yu,t.ImageRenderContribution=Oh,t.IncreaseCount=class extends Us{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;this.fromNumber=xe(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=xe(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)}onEnd(){}onUpdate(t,e,i){var n,r;!1!==this.valid&&(i.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(null!==(r=null===(n=this.params)||void 0===n?void 0:n.fixed)&&void 0!==r?r:0))}},t.IncrementalDrawContribution=Mu,t.InputText=class extends Us{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||ve(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=fr.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),h=this.target.clipedWidth+2;a.setAttribute("x",h)}},t.InteractiveSubRenderContribution=Wh,t.LINE_NUMBER_TYPE=za,t.Layer=sh,t.LayerService=hh,t.Line=Ql,t.LineRender=Lu,t.Linear=gn,t.LinearClosed=In,t.ManualTickHandler=Ms,t.ManualTicker=class extends Os{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Ms;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=Lc,t.MatrixAllocate=Ic,t.Meteor=class extends Us{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 Ke(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=_n,t.MonotoneY=Cn,t.MorphingPath=Zo,t.MotionPath=class extends Us{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=Qo,t.NOWORK_ANIMATE_ATTR=ua,t.Node=ys,t.PATH_NUMBER_TYPE=Ga,t.POLYGON_NUMBER_TYPE=Ha,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=Va,t.Path=gc,t.PathRender=Uu,t.PathRenderContribution=Dh,t.PickItemInterceptor=ad,t.PickerService=rd,t.PluginService=ud,t.Polygon=Tc,t.PolygonRender=Nu,t.PolygonRenderContribution=Ih,t.Pyramid3d=Bc,t.Pyramid3dRender=Hu,t.RAFTickHandler=ks,t.RECT3D_NUMBER_TYPE=Xa,t.RECT_NUMBER_TYPE=Ya,t.RICHTEXT_NUMBER_TYPE=qa,t.RafBasedSTO=ro,t.Rect=ec,t.Rect3DRender=Fu,t.Rect3d=nc,t.RectRender=Wu,t.RectRenderContribution=Lh,t.ReflectSegContext=pn,t.RenderSelector=Xu,t.RenderService=td,t.ResourceLoader=ra,t.RichText=pc,t.RichTextRender=Gu,t.RotateBySphereAnimate=class extends Us{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=Le-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}="function"==typeof this.params?this.params():this.params,s=2*Math.PI*e,o=this.theta+s,a=this.phi,h=r*Math.sin(a)*Math.cos(o)+n.x,l=r*Math.cos(a)+n.y,c=r*Math.sin(a)*Math.sin(o)+n.z;for(i.x=h,i.y=l,i.z=c,i.alpha=o+Oe/2;i.alpha>Le;)i.alpha-=Le;i.alpha=Le-i.alpha,i.zIndex=-1e4*i.z}},t.SVG_ATTRIBUTE_MAP=Qa,t.SVG_ATTRIBUTE_MAP_KEYS=th,t.SVG_PARSE_ATTRIBUTE_MAP=eh,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=ih,t.SYMBOL_NUMBER_TYPE=Ka,t.SegContext=dn,t.Stage=mp,t.StaticLayerHandlerContribution=lh,t.Step=Rn,t.StreamLight=class extends Us{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){var t;const e=this.target.attachShadow(),i=this.target.AABBBounds.height(),n=fr.graphicService.creator.rect(Object.assign(Object.assign({height:i,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(t=this.params)||void 0===t?void 0:t.attribute),{x:0,y:0,width:0}));this.rect=n,e.add(n)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(e,i,n){var r,s,o,a,h,l;const c=null!==(r=this.target.attribute.width)&&void 0!==r?r:250,u=null!==(o=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==o?o:c,d=null!==(l=null===(h=null===(a=this.params)||void 0===a?void 0:a.attribute)||void 0===h?void 0:h.width)&&void 0!==l?l:60,p=-d,f=p+(u-p)*i,g=Math.max(f,0),m=Math.min(Math.min(f+d,d),u-f),y=m+g>c?Math.max(c-g,0):m;this.rect.setAttributes({x:g,width:y},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}},t.SubAnimate=Fs,t.Symbol=Zl,t.SymbolRender=ju,t.SymbolRenderContribution=Uh,t.TEXT_NUMBER_TYPE=$a,t.TagPointsUpdate=class extends Us{constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===(null==r?void 0:r.newPointAnimateType)?"appear":"grow"}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,h=-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)){h=t,o=r.get(this.toPoints[t].context);break}let l=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=r.get(t.context);return i?(l=i,[i,t]):"appear"===this.newPointAnimateType?[t,t]:e<a&&s?[s,t]:e>h&&o?[o,t]:[l,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new Ke(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=Qs(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=Xh,t.TextMeasureContribution=wr,t.TextRender=zu,t.TextRenderContribution=Nh,t.Theme=ds,t.TimeOutTickHandler=Es,t.TransformUtil=oh,t.VGlobal=se,t.VWindow=dh,t.VirtualLayerHandlerContribution=uh,t.WILDCARD="*",t.WindowHandlerContribution=ph,t.WrapText=Kh,t.XMLParser=Ba,t.addArcToBezierPath=Qi,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=mo,t.alignSubpath=lo,t.application=fr,t.applyTransformOnBezierCurves=bo,t.bezier=Zi,t.bezierCurversToPath=xo,t.binarySplitPolygon=Eo,t.bindContributionProvider=te,t.bindContributionProviderNoSingletonScope=ee,t.boundStroke=_a,t.builtinSymbols=ql,t.builtinSymbolsMap=Kl,t.calcLineCache=Nn,t.centroidOfSubpath=po,t.circleBounds=Zs,t.clock=Bs,t.cloneGraphic=ia,t.colorEqual=function(t,e){const i=Do.parseColorString(t),n=Do.parseColorString(e);return!(!i||!n)&&(i.r===n.r&&i.g===n.g&&i.b===n.b&&i.opacity===n.opacity)},t.colorStringInterpolationToStr=Vo,t.container=_r,t.cornerTangents=Bh,t.createArc=$c,t.createArc3d=function(t){return new xc(t)},t.createArea=Zc,t.createCircle=Jc,t.createColor=$u,t.createConicalGradient=function(t,e,i,n,r,s,o,a,h){const l=Math.floor(180*r/Math.PI),c=wh.GetCanvas(),u=wh.GetCtx();if(!u)return null;const d=Ch.GetSize(a),p=Ch.GetSize(h);let f=Ch.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)))),m=l+1,y=r/Math.max(1,m-1),v=_h.GetOrCreate(e,m),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=m-1;t<e&&!(s+t*y>o);t++){const e=v.getColor(t);u.beginPath(),u.rotate(y),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&&Ch.Set(e,i,n,s,o,f,d,p),f},t.createGlyph=function(t){return new rc(t)},t.createGroup=Qc,t.createImage=au,t.createLine=tu,t.createMat4=Uc,t.createPath=eu,t.createPolygon=hu,t.createPyramid3d=function(t){return new Bc(t)},t.createRect=iu,t.createRect3d=nu,t.createRectPath=Su,t.createRichText=cu,t.createShadowRoot=lu,t.createStage=function(t){return new mp(t)},t.createSymbol=ou,t.createText=ru,t.createWrapText=su,t.cubicCalc=on,t.cubicLength=sn,t.cubicPointAt=an,t.cubicSubdivide=ho,t.defaultTicker=hp,t.defaultTimeline=Ls,t.drawArc=Ji,t.drawArcPath=Sh,t.drawAreaSegments=vu,t.drawIncrementalAreaSegments=mu,t.drawIncrementalSegments=gu,t.drawPathProxy=Ah,t.drawSegments=fu,t.enumCommandMap=Di,t.fillVisible=yh,t.findBestMorphingRotation=go,t.findNextGraphic=Td,t.foreach=xd,t.foreachAsync=Ad,t.genBasisSegments=An,t.genBasisTypeSegments=xn,t.genLinearClosedSegments=Ln,t.genLinearClosedTypeSegments=Un,t.genLinearSegments=mn,t.genLinearTypeSegments=yn,t.genMonotoneXSegments=Mn,t.genMonotoneYSegments=kn,t.genMonotpneXTypeSegments=Pn,t.genMonotpneYTypeSegments=En,t.genNumberType=Pa,t.genStepSegments=On,t.genStepTypeSegments=Dn,t.getAttributeFromDefaultAttrList=no,t.getConicGradientAt=Ph,t.getContextFont=zh,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]+=Gh(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=jc.allocate();return Hc(a,a,[o[0],o[1],0]),r&&zc(a,a,r),n&&Gc(a,a,n),Hc(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=Xc,t.getRichTextBounds=function(t){return pu.setAttributes(t),pu.AABBBounds},t.getScaledStroke=Ku,t.getTextBounds=function(t){return du.setAttributes(t),du.AABBBounds},t.getTheme=fs,t.getThemeFromGroup=gs,t.globalTheme=ps,t.graphicCreator=uu,t.graphicService=Zd,t.graphicUtil=Kd,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.inject=I,t.injectable=U,t.interpolateColor=No,t.interpolateGradientConicalColor=jo,t.interpolateGradientLinearColor=Wo,t.interpolateGradientRadialColor=Fo,t.interpolatePureColorArray=zo,t.intersect=Th,t.isSvg=Sa,t.isTransformKey=io,t.isXML=wa,t.layerService=Qd,t.lookAt=cp,t.mat3Tomat4=Vc,t.mat4Allocate=jc,t.matrixAllocate=Fc,t.morphPath=Jo,t.multiInject=L,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 h=("clone"===(null==n?void 0:n.splitPath)?ia:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:na)(i,a.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=a.map(((t,e)=>qo(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=a.map(((t,e)=>$o(t.attribute,l)));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())};h.forEach(((t,i)=>{var r,s,h;const l=(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(l),d.play(new Zo({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:Gs.duration,null!==(h=n.easing)&&void 0!==h?h:Gs.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 Qo({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:Gs.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:Gs.easing))}},t.multiply=dp,t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],y=e[14],v=e[15];let b=i.a,x=i.b,A=0,T=0;return t[0]=b*n+x*a+A*u+T*g,t[1]=b*r+x*h+A*d+T*m,t[2]=b*s+x*l+A*p+T*y,t[3]=b*o+x*c+A*f+T*v,b=i.c,x=i.d,A=0,T=0,t[4]=b*n+x*a+A*u+T*g,t[5]=b*r+x*h+A*d+T*m,t[6]=b*s+x*l+A*p+T*y,t[7]=b*o+x*c+A*f+T*v,b=0,x=0,A=1,T=0,t[8]=b*n+x*a+A*u+T*g,t[9]=b*r+x*h+A*d+T*m,t[10]=b*s+x*l+A*p+T*y,t[11]=b*o+x*c+A*f+T*v,b=i.e,x=i.f,A=0,T=1,t[12]=b*n+x*a+A*u+T*g,t[13]=b*r+x*h+A*d+T*m,t[14]=b*s+x*l+A*p+T*y,t[15]=b*o+x*c+A*f+T*v,t},t.multiplyMat4Mat4=Yc,t.named=N,t.newThemeObj=ls,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)?ia:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:na)(t,r.length,!1),o=null==i?void 0:i.onEnd;let a=r.length;const h=()=>{a--,0===a&&o&&o()};r.forEach(((e,n)=>{var o;const a=s[n],l=(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);Jo(a,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.ortho=up,t.parsePadding=qs,t.parseStroke=Ys,t.parseSvgPath=ji,t.pathToBezierCurves=vo,t.pickerService=Jd,t.point=vn,t.pointEqual=Js,t.pointInterpolation=Qs,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=Xe(t.x,t.y,e.x,e.y,i),{x:o,y:a}=Xe(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)=>Js(t,e[i]))):!Number.isNaN(t.x+t.y)&&Js(t,e))},t.pointsInterpolation=to,t.postConstruct=Kt,t.rafBasedSto=so,t.rectFillVisible=vh,t.rectStrokeVisible=xh,t.recursiveCallBinarySplit=ko,t.renderCommandList=en,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.rotateX=zc,t.rotateY=Gc,t.runFill=gh,t.runStroke=mh,t.segments=$i,t.shouldUseMat4=qc,t.snapLength=rn,t.splitArc=Bo,t.splitArea=_o,t.splitCircle=So,t.splitGraphic=na,t.splitLine=Co,t.splitPath=Oo,t.splitPolygon=Ro,t.splitRect=To,t.splitToGrids=Ao,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=bh,t.textDrawOffsetX=Gh,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=Hh,t.transformKeys=eo,t.transformMat4=pp,t.transformUtil=$d,t.translate=Hc,t.verticalLayout=Ea,t.vglobal=qd,t.waitForAllSubLayers=function(t){return $(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{fr.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=Mr,t.wrapContext=function(t,e){return _r.getNamed(Pr,fr.global.env)(t,e)},t.xul=function(t){const e=ve(t)?t[0]:t,i=[];if(!e)return i;if(!0===wa(e)){const t=(new Ba).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};Da(t,e);const i=t["#text"];i&&(e.text=i);return e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};Da(t,e);const i=e.image;i&&(e.image=i.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">"));return e}(t.tc[e]))}))}return i}}));